function [U,d]=Uconj_log2(dig,n)
%UCONJ_LOG2 The Stenger conjecture.
%   Tests the validity of the Stenger U-conjecture for
%   a square logarithmic weight function

global a ab0 ab1 ab2
m=ceil(n/2);
C=zeros(n);
ab2n=ab2(1:n,:);
ab0m=ab0(1:m,:); ab1m=ab1(1:m,:); ab2m=ab2(1:m,:); 
xw2n=gauss(n,ab2n); x2n=xw2n(:,1);
xw0m=gauss(m,ab0m); x0m=xw0m(:,1); w0m=xw0m(:,2);
xw1m=gauss(m,ab1m); x1m=xw1m(:,1); w1m=xw1m(:,2);
xw2m=gauss(m,ab2m); x2m=xw2m(:,1); w2m=xw2m(:,2);
for j=1:n
  for k=1:n
    s0=0;
    for i=1:m
       lag=lagrange(n,x2n,x2n(j)*x0m(i));
       s0=s0+w0m(i)*lag(k);
    end
    s1=0;
    for i=1:m
      lag=lagrange(n,x2n,x2n(j)*x1m(i));
      s1=s1+w1m(i)*lag(k);
    end
    s2=0;
    for i=1:m
      lag=lagrange(n,x2n,x2n(j)*x2m(i));
      s2=s2+w2m(i)*lag(k);
    end
    C(j,k)=x2n(j)^(a+1)*(s0*(log(1/x2n(j)))^2+2*s1*log(1/x2n(j))+s2);  
  end
end
if n==5
  for k=1:n
    PS=prestable(C,k);
  end
  disp('U is prestable for n=5')
end
digits(dig);
U=vpa(C);
d=eig(U);
d=double(d);
U=double(U);
