% EXAMPLE3_32  Computations for Example 3.32
clear mc mp iq idelta irout AB Z eps0 Nmax ab0 M
global mc mp iq idelta irout AB Z eps0 Nmax ab0 M
f1='%4.0f %5.0f %24.14e %14.4e %7.0f %7.0f\n';
%disp('                                 M=2*N')
%disp('                                  M=N')
%disp('                                  M=2')
disp('                                   M=0')
fprintf('\n')
mc=1; mp=0; iq=1; idelta=2; irout=1; 
AB=[-1 1];
eps0=100*eps; Nm=10; Nmax=200;
om=.1;
%om=.001;
ab0=r_jacobi01(Nmax,0,-1/2);
exact=7.672462586370557501;
%exact=96.7036882293816;
disp('   n     m          integral              error        Ncap   kount')
for N=1:Nm
%  M=2*N;
%  M=N;
%  M=2;
  M=0;
  Z(1,1)=1/om; Z(1,2)=1;
  for m=2:M
    Z(m,1)=1/(m-1); Z(m,2)=1;
  end
  [abmod,Ncap,kount]=r_mod(N,ab0);
  xw=gauss_rational(N,abmod);
  int=sum(xw(:,2).*fex32(xw(:,1),om));
  err=abs((int-exact)/exact);
  if ~all(N-[1 4 7 10])
    fprintf(f1,N,M,int,err,Ncap,kount)
  end
end
