This function extends FORTRAN's generic function TANH to evaluate the complex hyperbolic tangent.
TANH — Complex function value. (Output)
Z — Complex number representing the angle in radians for which the hyperbolic tangent is desired. (Input)
Specific: The specific interface names are CTANH and ZTANH.
Double complex: The double complex function name is ZTANH.
Let z = x + iy. If |cosh z|2 is very small, that is, if y mod π is very close to π /2 or 3 π /2 and if x is small, then tanh z is nearly singular; a fatal error condition is reported. If |cosh z|2 is somewhat larger but still small, then the result will be less accurate than half precision. When 2y (z = x + iy) is so large that sin 2y cannot be evaluated accurately to even zero precision, the following situation results. If |x| < 3/2, then TANH cannot be evaluated accurately to better than one significant figure. If 3/2 ≤|y| < –1/2 ln (ε /2), then TANH can be evaluated by ignoring the imaginary part of the argument; however, the answer will be less accurate than half precision. Here, ε = AMACH(4) is the machine precision.
In this example, tanh(1 + i) is computed and printed.
99999 FORMAT (' TANH((', F6.3, ',', F6.3, ')) = (',&
TANH(( 1.000, 1.000)) = ( 1.084, 0.272)
|
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |