View previous topic :: View next topic |
Author |
Message |
Michael_Connelly
Joined: 13 Jul 2017 Posts: 10 Location: Sandusky, OH
|
Posted: Tue Aug 01, 2017 1:22 am Post subject: inverse hyperbolic cosh sinh and tanh |
|
|
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? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Tue Aug 01, 2017 8:01 am Post subject: |
|
|
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).
Code: | 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 |
|
|
Back to top |
|
|
Michael_Connelly
Joined: 13 Jul 2017 Posts: 10 Location: Sandusky, OH
|
Posted: Tue Aug 01, 2017 3:23 pm Post subject: |
|
|
thanks |
|
Back to top |
|
|
Kenneth_Smith
Joined: 18 May 2012 Posts: 697 Location: Hamilton, Lanarkshire, Scotland.
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Wed Aug 02, 2017 7:43 am Post subject: |
|
|
Thanks for the link. It's very useful.
The single precision functions should probably be avoided even when the surrounding arithmetic is single precision. |
|
Back to top |
|
|
|