% MOMLAGLOG  Generates the first 2N moments to dig 
%    decimal places of the weight function 
%    w(x)=x^a*exp(-x)*(x-1-log x) on R_{+}.
%    It requires Release 5.1 (R2008b) or later
%    releases of the Matlab Symbolic Math Toolbox.
%   
function mom=momlaglog(dig,N,a)
digits(dig); 
for k=1:2*N
  psi=feval(symengine,'psi',a+k);
  psi=vpa(psi);
  mom(k)=gamma(vpa(a+k))*(a+k-1-psi);
end
