%RUN_UCONJ_EXT_HAHN

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

tic
global N a b ab w 
dig=32;
%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]
    for N=30
      w=zeros(N+1,1);
      p=1:N;
      w(1)=prod(a+p)/prod(p); w(N+1)=prod(b+p)/prod(p);
      for k=2:N
        p=1:k-1; q=1:N-k+1;
        w(k)=prod(a+p)*prod(b+q)/(prod(p)*prod(q));
      end
      ab=r_hahn(N,a,b);
      for n=29
        [U,d,xn,flxn]=Uconj_ext_hahn(dig,n); 
%        plot(d,'k*','MarkerSize',16);set(gca,'FontSize',24) 
%       semilogx(d,'k*','MarkerSize',16);set(gca,'FontSize',24)
%        axis([-.5 1.5 -.4 .4])
        for i=1:n
          if real(d(i))<=0 
            disp('conjecture is false');
            [N n], d, [xn flxn]
            break
          end
        end
      end
    end
  end
end
toc
