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

global a ab ab0_jac ab0_log1 ab0_log2 
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_log1=ab0_log1(1:m,:); xw0m_log1=gauss(m,ab0m_log1);
x0m_log1=xw0m_log1(:,1); w0m_log1=xw0m_log1(:,2);
ab0m_log2=ab0_log2(1:m,:); xw0m_log2=gauss(m,ab0m_log2);
x0m_log2=xw0m_log2(:,1); w0m_log2=xw0m_log2(:,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_log1(i);
      lag=lagrange(n,xn,x);
      s2=s2+w0m_log1(i)*lag(k);
    end
    s3=0;
    for i=1:m
      x=cn*x0m_log2(i);
      lag=lagrange(n,xn,x);
      s3=s3+w0m_log2(i)*lag(k);
    end
    U(j,k)=const*((log(1/cn))^2*s1+2*log(1/cn)*s2+s3);
  end
end
digits(dig);
sU=vpa(U); d=eig(sU);
d=double(d);
U=double(sU);
