1 REAL FUNCTION fGAMMA(X)
98 REAL C,CONV,EPS,FACT,HALF,ONE,P,PI,Q,RES,SQRTPI,SUM,TWELVE, &
99 two,x,xbig,xden,xinf,xminin,xnum,y,y1,ysq,z,zero
100 dimension c(7),p(8),q(8)
104 DATA one,half,twelve,two,zero/1.0e0,0.5e0,12.0e0,2.0e0,0.0e0/, &
105 sqrtpi/0.9189385332046727417803297e0/, &
106 pi/3.1415926535897932384626434e0/
113 DATA xbig,xminin,eps/35.040e0,1.18e-38,1.19e-7/, &
121 DATA p/-1.71618513886549492533811e+0,2.47656508055759199108314e+1,&
122 -3.79804256470945635097577e+2,6.29331155312818442661052e+2,&
123 8.66966202790413211295064e+2,-3.14512729688483675254357e+4,&
124 -3.61444134186911729807069e+4,6.64561438202405440627855e+4/
125 DATA q/-3.08402300119738975254353e+1,3.15350626979604161529144e+2,&
126 -1.01515636749021914166146e+3,-3.10777167157231109440444e+3,&
127 2.25381184209801510330112e+4,4.75584627752788110767815e+3,&
128 -1.34659959864969306392456e+5,-1.15132259675553483497211e+5/
140 DATA c/-1.910444077728e-03,8.4171387781295e-04, &
141 -5.952379913043012e-04,7.93650793500350248e-04, &
142 -2.777777777777681622553e-03,8.333333333333333331554247e-02, &
164 IF (res /= zero)
THEN
165 IF (y1 /= aint(y1*half)*two) parity = .true.
166 fact = -pi / sin(pi*res)
181 IF (y >= xminin)
THEN
188 ELSE IF (y < twelve)
THEN
210 xnum = (xnum + p(i)) * z
211 xden = xden * z + q(i)
213 res = xnum / xden + one
219 ELSE IF (y1 > y)
THEN
236 sum = sum / ysq + c(i)
238 sum = sum/y - y + sqrtpi
239 sum = sum + (y-half)*log(y)
250 IF (parity) res = -res
251 IF (fact /= one) res = fact / res