Blame view

fvn_fnlib/r9lgic.f 737 Bytes
38581db0c   daniau   git-svn-id: https...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
        function r9lgic (a, x, alx)
  c july 1977 edition.  w. fullerton, c3, los alamos scientific lab.
  c
  c compute the log complementary incomplete gamma function for large x
  c and for a .le. x.
  c
        external r1mach
        data eps / 0.0 /
  c
        if (eps.eq.0.0) eps = 0.5*r1mach(3)
  c
        xpa = x + 1.0 - a
        xma = x - 1.0 - a
  c
        r = 0.0
        p = 1.0
        s = p
        do 10 k=1,200
          fk = k
          t = fk*(a-fk)*(1.0+r)
          r = -t/((xma+2.0*fk)*(xpa+2.0*fk)+t)
          p = r*p
          s = s + p
          if (abs(p).lt.eps*s) go to 20
   10   continue
        call seteru (57hr9lgic  no convergence in 200 terms of continued f
       1raction, 57, 1, 2)
  c
   20   r9lgic = a*alx - x + alog(s/xpa)
  c
        return
        end