%RUN_SUCONJ_EXT_HAHN

%Checks the extended Stenger conjecture for (N+1)-point
%discrete Hahn weight functions

tic
global a b sab w 
dig=48; digits(dig);
%for b=[[-.9:.6:.9] [1.7:.7:3.8] [4.7:.9:7.4]]
for b=0
%  for a=[[-.9:.6:.9] [1.7:.7:3.8] [4.7:.9:7.4]]
  for a=b
    [a b]
    sa=vpa(a); sb=vpa(b);
    for N=30
      w=vpa(zeros(N+1,1));
      p=vpa(1:N);
      w(1)=prod(sb+p)/prod(p); w(N+1)=prod(sa+p)/prod(p);
      for k=2:N
        p=vpa(1:k-1); q=vpa(1:N-k+1);
        w(k)=prod(sa+p)*prod(sb+q)/(prod(p)*prod(q));
      end
      sab=sr_hahn(dig,N,a,b);
      for n=30
        [U,d,xn,flxn]=sUconj_ext_hahn(dig,n);
%        double(d)
%        plot(d,'k*','MarkerSize',16);set(gca,'FontSize',24) 
%        semilogx(d,'k*','MarkerSize',16);set(gca,'FontSize',24)
%        axis([10^(-3) 10 -.25 .25])
        for i=1:n
          if real(double(d(i)))<=0 
            disp('conjecture is false');
            [N n], [xn flxn], double(d)
            break
          end
        end
      end
    end
  end
end
toc
