forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

inverse hyperbolic cosh sinh and tanh

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
Michael_Connelly



Joined: 13 Jul 2017
Posts: 5
Location: Sandusky, OH

PostPosted: Tue Aug 01, 2017 1:22 am    Post subject: inverse hyperbolic cosh sinh and tanh Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5046
Location: Salford, UK

PostPosted: Tue Aug 01, 2017 8:01 am    Post subject: Reply with quote

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
View user's profile Send private message
Michael_Connelly



Joined: 13 Jul 2017
Posts: 5
Location: Sandusky, OH

PostPosted: Tue Aug 01, 2017 3:23 pm    Post subject: Reply with quote

thanks
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 160
Location: Glasgow, Scotland.

PostPosted: Tue Aug 01, 2017 6:32 pm    Post subject: Reply with quote

This might be of some use:-

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

Ken
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5046
Location: Salford, UK

PostPosted: Wed Aug 02, 2017 7:43 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group