% TABLE2_4 Computation of Table 2.4.
%
f1='%7.0f %9.2e %9.2e %9.2e\n';
fprintf('\n')
disp('  Table 2.4 Condition number and error')
disp('  magnification for discrete 20-point')
disp('  Chebyshev measure on [0,1) using')
disp('  ordinary moments')
fprintf('\n')
disp('      n  (2.1.36)    maga      magb')
N=20; mom=zeros(1,2*N);
ab=r_hahn(N-1); ab(:,1)=ab(:,1)/N; 
ab(1,2)=ab(1,2)/N; ab(2:N,2)=ab(2:N,2)/(N^2);
k=1:N;
for r=1:2*N
  mom(r)=sum(((k-1)/N).^(r-1))/N;
end
for n=2:3:11
  acl=acondGlow(n,ab(1:n,:));
  [abcheb,normsq]=chebyshev(n,mom);
  errab=abs(abcheb-ab(1:n,:))./moll(ab(1:n,:));
  maga=max(errab(:,1)/eps);
  magb=max(errab(:,2)/eps);
  fprintf(f1,n,acl,maga,magb)
end
