clear all

f=@(x) 4./(1+x.^2); a=0; b=1; % true value pi=3.141592653589793
tol=1e-6;

% f=@humps; a=0; b=1; % true value 5*atan(16/13)+10*pi-6=29.858325395498674
% tol=1e-5;

[Q,k]=quad(f,a,b,tol);
fprintf('quad:        Q=%19.15f    fcount=%5d\n', Q,k)

[Q,k]=GLeg2(f,a,b,tol);
fprintf('GLeg2:       Q=%19.15f    fcount=%5d\n', Q,k)

[Q,k]=GLeg4(f,a,b,tol);
fprintf('GLeg4:       Q=%19.15f    fcount=%5d\n', Q,k)

[Q,k]=GLob4(f,a,b,tol);
fprintf('GLob4:       Q=%19.15f    fcount=%5d\n', Q,k)

[Q,k]=quadl(f,a,b,tol);
fprintf('quadl:       Q=%19.15f    fcount=%5d\n', Q,k)



