function [U,d]=Uconj_ext_log1(dig,n)
%UCONJ_EXT_LOG1 The matrix U of the extended Stenger conjecture
%and its eigenvalues for an algebraic/logarithmic weight function
%   [U,D]=UCONJ_EXT_LOG1(DIG,N) generates, partly in DIG-digit
%   arithmetic, the NxN matrix U, N <= 30, and its eigenvalues 
%   D for an algebraic/logarithmic weight function with 
%   parameter A. The elements of U are computed by suitable 
%   Gauss quadratures.

global a ab ab0_jac ab0_log 
U=zeros(n);
abn=ab(1:n,:); 
xwn=gauss(n,abn); xn=xwn(:,1);
m=ceil(n/2);
ab0m_jac=ab0_jac(1:m,:); xw0m_jac=gauss(m,ab0m_jac);
x0m_jac=xw0m_jac(:,1); w0m_jac=xw0m_jac(:,2);
ab0m_log=ab0_log(1:m,:); xw0m_log=gauss(m,ab0m_log);
x0m_log=xw0m_log(:,1); w0m_log=xw0m_log(:,2);
for j=1:n
  cn=xn(j);
  const=cn^(a+1);
  for k=1:n
    s1=0;
    for i=1:m
      x=cn*x0m_jac(i);  
      lag=lagrange(n,xn,x);
      s1=s1+w0m_jac(i)*lag(k);
    end
    s2=0;
    for i=1:m
      x=cn*x0m_log(i);
      lag=lagrange(n,xn,x);
      s2=s2+w0m_log(i)*lag(k);
    end
    U(j,k)=const*(log(1/cn)*s1+s2);
  end
end
digits(dig);
sU=vpa(U); d=eig(sU);
d=double(d);
U=double(sU);
