function [ab,dig]=dig_lsrbinet(N,c,dig0,dd,nofdig)
%DIG_LSRBINET Number of digits needed for the lower subrange
%Binet weight function on [0,c], 0<c<Inf.
%   [AB,DIG]=DIG_LSRBINET(N,C,DIG0,DD,NOFDIG) determines the number
%   DIG of digits needed to obtain the first N recurrence coefficients
%   for the weight function w(x)=-log(1-exp(-x)) on [0,C], 0 < C < Inf, 
%   to an accuracy of NOFDIG decimal digits using a moment-based method.
%   The routine successively increments an initial estimate DIG0 by
%   by DD units until the required accuracy is achieved. The recurrence 
%   coefficients to NOFDIG digits are placed into the Nx2 array AB.

eps0=.5*10^(-nofdig); maxerr=1; 
i=dig0-dd; 
while maxerr>eps0
  i=i+dd; dig=i
  if i==dig0
    mom=smom_lsrbinet(dig,N,c);
    ab0=schebyshev(dig,N,mom);
  else
    mom=smom_lsrbinet(dig,N,c);
    ab1=schebyshev(dig,N,mom);
    serr=abs((ab1-ab0)./ab1);
    err=double(serr);
    maxerr=max(max(err)); 
    ab0=ab1;
  end
end
ab=vpa(ab1,nofdig);
