Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
meix.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file meix.f
1 C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 C++ Copyright S. Zhang and J. M. Jing ++
3 C++ Computation of Special Functions, John Wiley & Sons, New York, ++
4 C++ 1996 and http://jin.ece.illinois.edu . ++
5 C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6 C
7  SUBROUTINE eix(X,EI)
8 C
9 C ============================================
10 C Purpose: Compute exponential integral Ei(x)
11 C Input : x --- Argument of Ei(x)
12 C Output: EI --- Ei(x) ( x > 0 )
13 C ============================================
14 C
15  IMPLICIT DOUBLE PRECISION (a-h,o-z)
16  IF (x.EQ.0.0) THEN
17  ei=-1.0d+300
18  ELSE IF (x.LE.40.0) THEN
19  ei=1.0d0
20  r=1.0d0
21  DO 15 k=1,100
22  r=r*k*x/(k+1.0d0)**2
23  ei=ei+r
24  IF (dabs(r/ei).LE.1.0d-15) go to 20
25 15 CONTINUE
26 20 ga=0.5772156649015328d0
27  ei=ga+dlog(x)+x*ei
28  ELSE
29  ei=1.0d0
30  r=1.0d0
31  DO 25 k=1,20
32  r=r*k/x
33 25 ei=ei+r
34  ei=dexp(x)/x*ei
35  ENDIF
36  RETURN
37  END