% TABLE2_11 Computations for Table 2.11
%
clear irout
global irout
f1='\n                          y=%4.1f\n\n';
f2=' %4.0f  %18.10e %18.10e %10.2e %9.2e\n';
f3=' %54.2e %9.2e\n';
fprintf('\n')
disp('                   One mass point at -1')
%disp('                 Two mass points at -1,+1')
%disp('                 Three mass points on [-1,1]')
fprintf('\n')
N=40;
Y=[.5 2 10];
for iy=1:3
  y=Y(iy);
  fprintf(f1,y)
  disp('    n           a                  b            discra    discrb')
%
% One mass point at -1
%
  ty=[-1 y];
%
% Two mass points at -1,+1
%
%  ty=[-1 y;1 1];
%
% Three mass points on [-1,1]
%
%  ty=[-1 y;0 2;1 1];
%
  abmm=[];
  for ia=1:10
    alpha=-.8+(ia-1)*.2;
    for ib=1:10
      beta=-.8+(ib-1)*.2;
      irout=1;
      absti=r_jacplusdis(N,alpha,beta,ty);
      irout=0;
      ablan=r_jacplusdis(N,alpha,beta,ty);
      if(ia==2 & ib==7)
        n=[1,7,18,40];
        discrab=abs((absti(n,:)-ablan(n,:))./moll(ablan(n,:)));
        abd=[(n-1)' ablan(n,:) discrab];
        fprintf(f2,abd')
      end
      abm=max(abs(absti-ablan)./moll(ablan));
      abmm=[abmm;abm];
    end
  end
  abmax=max(abmm);
  fprintf(f3,abmax')
end
