      double precision function dcosh (x)
c august 1977 edition.  w. fullerton, c3, los alamos scientific lab.
      double precision x, y , ymax, d1mach, dexp, dsqrt
      external d1mach, dexp, dsqrt
      data ymax / 0.0d0 /
c
      if (ymax.eq.0.0d0) ymax = 1.0d0/dsqrt(d1mach(3))
c
      y = dexp (dabs(x))
      dcosh = 0.5d0*y
      if (y.lt.ymax) dcosh = 0.5d0*(y + 1.0d0/y)
c
      return
      end