Reputation: 33
As shown on the official document: COSH
Intel Fortran does not allow users to input complex argument into hyperbolic cosine function. So what is the alternative way to do this?
Upvotes: 1
Views: 430
Reputation: 60058
Fortran 2008 allows complex argument. Some compilers already allow this. If your does not (as, e.g., ifort 15.0), compute it using exp()
.
cosh(x) = ( exp(x) + exp(-x) ) / 2
or use the identity
cosh(x+iy) = cosh(x) * cos(y) + i * sinh(x) * sin(y)
Upvotes: 4