Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:21:10

0001  
0002 C*********************************************************************
0003  
0004 C...PYGAMM
0005 C...Gives ordinary Gamma function Gamma(x) for positive, real arguments;
0006 C...see M. Abramowitz, I. A. Stegun: Handbook of Mathematical Functions
0007 C...(Dover, 1965) 6.1.36.
0008  
0009       FUNCTION PYGAMM(X)
0010  
0011 C...Double precision and integer declarations.
0012       IMPLICIT DOUBLE PRECISION(A-H, O-Z)
0013       IMPLICIT INTEGER(I-N)
0014       INTEGER PYK,PYCHGE,PYCOMP
0015 C...Local array and data.
0016       DIMENSION B(8)
0017       DATA B/-0.577191652D0,0.988205891D0,-0.897056937D0,0.918206857D0,
0018      &-0.756704078D0,0.482199394D0,-0.193527818D0,0.035868343D0/
0019  
0020       NX=INT(X)
0021       DX=X-NX
0022  
0023       PYGAMM=1D0
0024       DXP=1D0
0025       DO 100 I=1,8
0026         DXP=DXP*DX
0027         PYGAMM=PYGAMM+B(I)*DXP
0028   100 CONTINUE
0029       IF(X.LT.1D0) THEN
0030         PYGAMM=PYGAMM/X
0031       ELSE
0032         DO 110 IX=1,NX-1
0033           PYGAMM=(X-IX)*PYGAMM
0034   110   CONTINUE
0035       ENDIF
0036  
0037       RETURN
0038       END