Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pygamm.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pygamm.f
1 
2 C*********************************************************************
3 
4 C...PYGAMM
5 C...Gives ordinary Gamma function Gamma(x) for positive, real arguments;
6 C...see M. Abramowitz, I. A. Stegun: Handbook of Mathematical Functions
7 C...(Dover, 1965) 6.1.36.
8 
9  FUNCTION pygamm(X)
10 
11 C...Double precision and integer declarations.
12  IMPLICIT DOUBLE PRECISION(a-h, o-z)
13  IMPLICIT INTEGER(i-n)
14  INTEGER pyk,pychge,pycomp
15 C...Local array and data.
16  dimension b(8)
17  DATA b/-0.577191652d0,0.988205891d0,-0.897056937d0,0.918206857d0,
18  &-0.756704078d0,0.482199394d0,-0.193527818d0,0.035868343d0/
19 
20  nx=int(x)
21  dx=x-nx
22 
23  pygamm=1d0
24  dxp=1d0
25  DO 100 i=1,8
26  dxp=dxp*dx
27  pygamm=pygamm+b(i)*dxp
28  100 CONTINUE
29  IF(x.LT.1d0) THEN
31  ELSE
32  DO 110 ix=1,nx-1
33  pygamm=(x-ix)*pygamm
34  110 CONTINUE
35  ENDIF
36 
37  RETURN
38  END