% GJExample2
%
digits(32); dig=digits;
ab1=vpaconvert('coeffjaclog11');
N=18;
exact=(sqrt(2*vpa(pi))/8)*gamma(vpa(1/4))^2;
derr=1;
while derr>1.5e-32
  N=N+1
  ab=ab1(1:N,:);
  xw=sgauss(dig,N,ab);
  K1=sum(xw(:,2)./sqrt(1+xw(:,1)));
  err=abs((K1-exact)/exact);
  derr=subs(err);
end
K1=vpa(K1), derr
ab2=vpaconvert('coeffjaclog21');
derr=1; N=18; K2=vpa(1);
while derr>1.5e-32
  K0=K2; N=N+1
  ab=ab2(1:N,:);
  xw=sgauss(dig,N,ab);
  K2=sum(xw(:,2)./sqrt(1+xw(:,1)));
  err=abs(K2-K0); derr=subs(err);
end
K2=vpa(K2)
ab3=vpaconvert('coeffjaclog31');
derr=1; N=18; K3=vpa(1);
while derr>1.5e-32
  K0=K3; N=N+1
  ab=ab3(1:N,:);
  xw=sgauss(dig,N,ab);
  K3=sum(xw(:,2)./sqrt(1+xw(:,1)));
  err=abs(K3-K0); derr=subs(err);
end
K3=vpa(K3)
