% TABLE2_19 Computations for Table 2.19.
%
clear a
global a
N=30; Mmax=200; eps0=1e5*eps;
for a=[-.9 -.5 0 .8 2.3 5.8]
  exact=sqrt(pi)*(gamma(a+1))^2/(2^(a+1)*gamma(a+3/2));
  ab=r_modbess(N,a,Mmax,eps0);
  s=0; s0=1;
  n=0;
  while abs(s-s0)>abs(s)*eps0
    n=n+1;
    if n>N, error('n exceeds N'), end
    s0=s;
    xw=gauss(n,ab);
    s=sum(xw(:,2).*exp(-xw(:,1)));
  end
  a,n,s,err=abs((s-exact)/exact)
end
