%SNQUAD_RAM
%
function [n,IR]=snquad_Ram(dig,t,n0,dn,nofdig)  
digits(dig) 
t=vpa(t);
format long
n=n0-dn; 
err=vpa(1);
while err>.5*10^(-nofdig)
  n=n+dn
  ab=sr_jacobi01(dig,n);
  xw=sgauss(dig,n,ab); x=xw(:,1); w=xw(:,2);
  s=vpa(0);
  for k=1:n
    s=s+w(k)*sgam_upinc(dig,x(k),t)/gamma(x(k));
  end
  if n==n0
    IR0=s*exp(t);
  else
    IR=s*exp(t);
    err=abs((IR-IR0)/IR); double(err)
    IR0=IR;
  end
end
