z0lgmc.f 691 Bytes
complex(kind(1.d0)) function z0lgmc (z)
      implicit none
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(kind(1.d0)) z, q, z9ln2r
      real(kind(1.d0)) zabsz

      external z9ln2r
c
      zabsz = abs(z)
c
      q = 1.0/z
      if (zabsz.le.1.23) z0lgmc = (z+0.5)*log(1.0+q) - 1.0
      if (zabsz.gt.1.23) z0lgmc = ((1.+.5*q)*z9ln2r(q) - .25) * q**2
c
      return
      end