https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87247
Bug ID: 87247 Summary: intrinsic acosh violates 2008 Standard rule 13.7.5 line 5 Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libfortran Assignee: unassigned at gcc dot gnu.org Reporter: zeccav at gmail dot com Target Milestone: --- ! Intrinsic acosh violates 2008 Standard rule 13.7.5 line 5 ! "If the result is complex the imaginary part is expressed in radians and lies ! in the range 0<= AIMAG(ACOSH(X)) <= pi" pi is approx 3.14 ! Imaginary part must be >=0 and <= pi so it may not be negative complex :: cc=(-1.0,-1.0) print *,acosh(cc) ! Imaginary part negative print *,log(cc+sqrt(cc**2-1)) ! this is correct acosh(cc) end (1.06127512,-2.23703575) (-1.06127524,2.23703575) Fortran acosh provides negative of correct answer.