function [U,d]=Uconj_ext_jac(dig,n)
%CONJ_JAC The matrix U of the extended Stenger conjecture 
%and its eigenvalues for a Jacobi weight function
%   [U,D]=UCONJ_EXT_JAC(DIG,N,A,B) generates, partly in
%   DIG-digit arithmetic, the NxN matrix U and its eigenvalues
%   D for Jacobi polynomials with parameters A and B. The elements
%   of U are computed by sufficiently high-order Gauss-Jacobi
%   quadrature with Jacobi parameters 0 and B, guaranteeing 
%   4-decimal accuracy for all eigenvalues.

global a b ab ab0 
eps0=.5e-04;
U=zeros(n);
abn=ab(1:n,:); 
xwn=gauss(n,abn); xn=xwn(:,1);
err=1; d1=zeros(n,1); m=0;
while err>eps0
  d0=d1; m=m+20; if m>300, error('m exceeds 300'); end
  ab0m=ab0(1:m,:); xw0m=gauss(m,ab0m);
  x0m=xw0m(:,1); w0m=xw0m(:,2);
  for j=1:n
    cn=xn(j);
    const=((1+cn)/2)^(a+b+1);
    for k=1:n
      s=0;
      for i=1:m
        x=((1+cn)/2)*x0m(i)-(1-cn)/2;  
        lag=lagrange(n,xn,x);
        s=s+w0m(i)*lag(k)*((3-cn)/(1+cn)-x0m(i))^a;
      end
      U(j,k)=const*s;
    end
  end
  digits(dig);
  sU=vpa(U); d=eig(sU);
  d1=double(d);
  err=errd(n,d1,d0);
end
d=d1; U=double(sU);
[m err]
