% GLExample
%
f0='%10.0f %12.4e\n';
digits(32); dig=digits;
ab1=vpaconvert('coefflaglog1');
derr=1; N=89; I=vpa(1);
%derr=1; N=29; I=vpa(1);
while derr>1.5e-32
  I0=I; N=N+1;
  ab=ab1(1:N,:);
  xw=sgauss(dig,N,ab);
  I=sum(xw(:,2)./(1+exp(-xw(:,1)-7/2)));
%  I=sum(xw(:,2).*(1+exp(-xw(:,1)-7/2)));
  err=abs(I-I0); derr=subs(err);
end
I=vpa(I)
ab2=vpaconvert('coefflaglog2');
derr=1; N=91; I=vpa(1);
%derr=1; N=29; I=vpa(1);
while derr>1.5e-32
  I0=I; N=N+1
  ab=ab2(1:N,:);
  xw=sgauss(dig,N,ab);
  I=sum(xw(:,2)./(1+exp(-xw(:,1)-7/2)));
%  I=sum(xw(:,2).*(1+exp(-xw(:,1)-7/2)));
  err=abs(I-I0); derr=subs(err);
end
I=vpa(I)
ab3=vpaconvert('coefflaglog3');
derr=1; N=93; I=vpa(1);
%derr=1; N=29; I=vpa(1);
while derr>1.5e-32
  I0=I; N=N+1
  ab=ab3(1:N,:);
  xw=sgauss(dig,N,ab);
  I=sum(xw(:,2)./(1+exp(-xw(:,1)-7/2)));
%  I=sum(xw(:,2).*(1+exp(-xw(:,1)-7/2)));
  err=abs(I-I0); derr=subs(err);
end
I=vpa(I)
