function [ab,dig]=dig_gprudnikov(N,nu,alpha,dig0,dd,nofdig)
%DIG_GPRUDNIKOV Number of digits needed for polynomials orthogonal
%relative to a generalized Prudnikov weight function. 
%   [AB,DIG]=DIG_GPRUDNIKOV(N,NU,ALPHA,DIG0,DD,NOFDIG} determines the
%   number DIG of digits needed to obtain the first N recurrence
%   coefficients for a generalized Prudnikov weight function to an
%   accuracy of NOFDIG digits using the classical Chebyshev algorithm. 
%   It successively increments an initial estimate DIG0 by DD units
%   until the required accuracy is achieved. The recurrence coefficients
%   to NOFDIG digits are placed into the Nx2 array AB.   

if nu<0|alpha<=-1
  error('parameter(s) out of range')
end
i=dig0-dd; 
maxerr=1
while maxerr>.5*10^(-nofdig)
  i=i+dd; dig=i
  mom=smom_gprudnikov(dig,N,nu,alpha);
  if i==dig0
    ab0=schebyshev(dig,N,mom');
  else
    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);
