Silverfrost Forums

Welcome to our forums

inverse hyperbolic cosh sinh and tanh

1 Aug 2017 12:22 #19922

In working my way through the intrinsic Fortran functions it appears Plato does not support ACOSH, ASINH, or ATANH. Checking the list of Plato math functions I could not find these functions listed. Are there any iteration subroutines available?

1 Aug 2017 7:01 #19923

These functions are included in the Fortran 2008 standard but have not yet been added to FTN95 (the compiler called by Plato). It would be a simple matter to provide your own function from the basic identities found here (https://en.wikipedia.org/wiki/Inverse_hyperbolic_functions).

DOUBLE PRECISION FUNCTION acosh(x)
DOUBLE PRECISION x
acosh = log(x + sqrt(x*x-1.0d0))
END FUNCTION acosh

PROGRAM test
DOUBLE PRECISION acosh
print*, acosh(2.0d0)
END
1 Aug 2017 2:23 #19926

thanks

1 Aug 2017 5:32 #19927

This might be of some use:-

http://www.davidgsimpson.com/software/invhyp_f90.txt

Ken

2 Aug 2017 6:43 #19928

Thanks for the link. It's very useful. The single precision functions should probably be avoided even when the surrounding arithmetic is single precision.

Please login to reply.