
function demo_milne_boole

f=@(x) (3*exp(x)+5)./(x+1);
estremi=[0 1];

for k=1:3
    N=10^k;
    S(k)=composta_milne_boole (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.
% L'integrale esatto e' 6.841894152049535e+00.
% >> demo_milne_boole
%	 S(  1 ): 6.841894152739337
% 	 S(  2 ): 6.841894152049532
% 	 S(  3 ): 6.841894152049544
% 	 err