
function demo_simpson3ottavi

f=@(x) (exp(x)-1)./x;
estremi=[1 2];

for k=1:3
    N=100^k;
    S(k)=composta_simpson3ottavi (f,estremi,N);
    fprintf('\n \t S( %2.0f ): %1.15f',k,S(k));
end

err(1)=abs(S(3)-S(1)); 
err(2)=abs(S(3)-S(2));

fprintf('\n \t err(1): %1.3e',err(1));
fprintf('\n \t err(2): %1.3e',err(2));

fprintf('\n');

% RISULTATI.
% demo_simpson3ottavi
% 
%  	 S(  1 ): 2.365969359087189
%  	 S(  2 ): 2.365969359086009
%  	 S(  3 ): 2.365969359085944
%  	 err(1): 1.245e-12
%  	 err(2): 6.484e-14
