Blame view

fvn_fnlib/c0lgmc.f 625 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
        complex function c0lgmc (z)
  c august 1980 edition.  w. fullerton c3, los alamos scientific lab.
  c
  c evaluate  (z+0.5)*clog((z+1.0)/z) - 1.0  with relative error accuracy.
  c let q = 1.0/z so that
  c     (z+0.5)*clog(1+1/z) - 1 = (z+0.5)*(clog(1+q) - q + q*q/2) - q*q/4
  c        = (z+0.5)*q**3*c9ln2r(q) - q**2/4,
  c where  c9ln2r  is (clog(1+q) - q + 0.5*q**2) / q**3.
  c
        complex z, q, c9ln2r, clog
        external c9ln2r
  c
        cabsz = cabs(z)
  c
        q = 1.0/z
        if (cabsz.le.1.23) c0lgmc = (z+0.5)*clog(1.0+q) - 1.0
        if (cabsz.gt.1.23) c0lgmc = ((1.+.5*q)*c9ln2r(q) - .25) * q**2
  c
        return
        end