function [abs_errorY,rss_errorY,err_vec]=err_analysis(fun,X,error_X)
% function [abs_error,rss_error,err_vec]=err_analysis(fun,X,error_X)
%
% fun is a string giving the name of the function 
% Y=fun(X)
%
% Input variables X are assumed to be in error by an amount error_X
% Output scalar Y has associated errors of two types.
% If error_X are interpreted as absolute errors,
% then abs_errorY is the absolute error of output Y.
% If error_X are interpreted as roor-mean square (rss or sigma) errors of a Gaussian random variable,
% then rss_errorY is the roor-mean square (sigma) error of output Y.
% err_vec=abs(error_X.*PfunPx)
dx=error_X/10;
[PfunPx]=partials(fun,X,dx);
err_vec=abs(error_X.*PfunPx);
abs_errorY=sum(err_vec);
rss_errorY=sqrt(sum(err_vec.*err_vec));
