1 #include "isajet/pilot.h"
2 DOUBLE PRECISION FUNCTION DINCGM(A,X,EPS)
3 C***********************************************************************
4 C* Series expansion of incomplete gamma function, from Abramowitz and *
5 C* Stegun. A and X are the two arguments, while EPS is the relative *
6 C* precision. More accurately, if X > 0, EPS is the ratio of the last *
7 C* term in the series and the sum; note that for X > 0, the series is *
8 C* alternating. For X < 0, this ratio is required to be < EPS/100. *
9 C***********************************************************************
11 DOUBLE PRECISION A,X,EPS,SUM,TERM,XN
12 C IF(DABS(A).LT.1.D-10) THEN
13 C WRITE(*,*) ' Function diverges for A = 0!'
18 TERM = 1.D0 !Term for n = 0
26 IF((DABS(TERM/SUM).GT.EPS.AND.X.GE.0.D0).OR.
27 & (DABS(TERM/SUM).GT.1.D-2*EPS.AND.X.LE.0.D0)) GOTO 1