      complex function cexp (z)
c august 1980 version.  w. fullerton, c3, los alamos scientific lab.
      complex z
      external cos, exp, sin
c
      r = exp(real(z))
      if (r.eq.0.) go to 10
      y = aimag(z)
      rcosy = r*cos(y)
      call erroff
      cexp = cmplx (rcosy, r*sin(y))
      return
c
 10   cexp = (0., 0.)
c
      return
      end
