% TABLE2_7 Computation of Table 2.7
%
f1='%7.0f %9.2e %9.2e %9.2e\n';
fprintf('\n')
disp('   Table 2.7 Condition number and error')
disp('   magnification for the half-range')
disp('   Hermite measure using Hermite moments')
fprintf('\n')
disp('      n  (2.1.64)    maga      magb')
N=10;
load -ascii abhrhermite;
abexact=abhrhermite; abexact(1,2)=sqrt(pi)/2;
abm=r_hermite(2*N); mom=zeros(1,2*N);
t=1; mom(1)=.5*abm(1,2);
for k=1:N
  t=(1.5-k)*t; mom(2*k)=t;
end
[abcheb,normsq]=chebyshev(N,mom,abm);
iopt=0;
for n=2:2:N
  rc=rcondG(n,iopt,abexact,abm,mom);
  ea=abs(abcheb(1:n,1)-abexact(1:n,1))./moll(abexact(1:n,1));
  eb=abs(abcheb(1:n,2)-abexact(1:n,2))./moll(abexact(1:n,2));
  maga=max(ea)/eps;
  magb=max(eb)/eps;
  fprintf(f1,n,rc,maga,magb)
end
