%
% TESTBERN
%
f0='%14.8f %12.8f %20.12f\n';
f1='%48.12f\n';
rhomax=0; rhomin=10^20;
for a=-.5:.01:.5
  for b=a:.01:.5
    q=b;
    ab=r_jacobi(100,a,b);
    rhonmax=0; rhonmin=10^20;
    for n=[5 10 20 50 100]
%    for n=[5 24 43 62 81 100]
%    for n=[5 100]
%    for n=[5 200]
      rho=bernstein(n,a,b,q,ab);
      if rho>rhonmax
        rhonmax=rho; 
      end
      if rho<rhonmin
        rhonmin=rho; 
      end
    end
    if rhonmax>rhomax
      rhomax=rhonmax;
      amax=a; bmax=b;
    end
    if rhonmin<rhomin
      rhomin=rhonmin;
      amin=a; bmin=b;
    end
  end
end
%rhohat=.997780002408/rhomax;
fprintf(f0,amin,bmin,rhomin)
fprintf(f0,amax,bmax,rhomax)
%fprintf(f1,rhohat)
