------- Comment #22 from burnus at gcc dot gnu dot org 2009-07-10 11:46 ------- For z a complex number: Patch for tan(z), sinh(z), cosh(z), tanh(z) - see at http://gcc.gnu.org/ml/fortran/2009-07/msg00071.html
Remark: atan(z), asin(z) and acos(z) are also missing besides a{sin,cos,tan}h. Additionally, I think the description for ATAN2 in the gfortran manual is wrong: "ATAN2(Y, X) computes the arctangent of the complex number X + i Y" while the standard has: "The result has a value equal ... to the principal value of the argument of the complex number (X, Y), expressed in radians." That is: atan2(y, x) = Pr arg(x+iy) = Arg(x+iy) =/= ATAN(X+i Y). * * * Fallback implementations via complex logarithm: I have no idea about NaN, Inf etc. nor about the precision (I do not know how precise the fall back needs to be), but Abramowitz & Stegun has the following: a{tan,sin,cos}: http://www.iopb.res.in/~somen/abramowitz_and_stegun/page_80.htm and http://en.wikipedia.org/wiki/Arctangent#Logarithmic_forms a{sin,tan,cos}h: http://www.iopb.res.in/~somen/abramowitz_and_stegun/page_87.htm However, the equations might need to be slightly for complex arguments as written at http://en.wikipedia.org/wiki/Inverse_hyperbolic_function#Logarithmic_representation -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197