dli.f 648 Bytes
double precision function dli (x)
c sept 1983 edition.  w. fullerton, c3, los alamos scientific lab.
      double precision x, sqeps, dei, d1mach, dlog, dsqrt
      external d1mach, dei
      data sqeps / 0.0d0 /
c
      if (sqeps.eq.0.0d0) sqeps = dsqrt(d1mach(3))
c
      if (x.le.0.d0) call seteru (
     1  41hdli     log integral undefined for x le 0, 41, 2, 2)
      if (x.eq.1.d0) call seteru (
     1  40hdli     log integral undefined for x = 1, 40, 3, 2)
      if (dabs(1.d0-x).lt.sqeps) call seteru (57hdli     answer lt half
     1precision because x too close to 1, 57, 1, 1)
c
      dli = dei (dlog(x))
c
      return
      end