replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Fortran 2023 trig functions
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 

Fortran 2023 trig functions

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



Joined: 18 May 2012
Posts: 809
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Fri May 16, 2025 8:58 am    Post subject: Fortran 2023 trig functions Reply with quote

The fortran 2023 standard includes new trig related functions, namely cosd, sind, tand, acosd, asind, atand, atan2d, acospi, asinpi, atanpi, atan2pi, cospi, sinpi, and tanpi.

**D functions which use degrees rather than radians were implemented in gFortran and Ifort as extensions long before the 2023 standard, so they do appear fairly regularly in code I see written by others.

**PI functions operate on multiples of half revolutions. For example:: COSPI(x) = COS(PI*X), so COSPI(1.0) = -1.0 These functions have obvious applications in signal processing etc.

Perhaps these new intrinsics should be added to the FTN95 wish list, and added to the library when time permits? This would keep the core mathematical intrinsics in FTN95 in synch with the latest fortran standard.

The functions should be easy to implement - no gotchas like asin(Z) Very Happy

Further details can be found here:

https://wg5-fortran.org/N2201-N2250/N2212.pdf
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sat May 17, 2025 6:46 am    Post subject: Reply with quote

Many thanks for the feedback. I have added this to the wish list.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Thu Jun 05, 2025 8:24 am    Post subject: Reply with quote

These functions have now been implemented for the next release of FTN95 and the associated DLLs.
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1257
Location: Morrison, CO, USA

PostPosted: Thu Jun 05, 2025 1:54 pm    Post subject: Reply with quote

Paul, this will be a nice addition. I have some complex equations that will be simplified (to the eye, at least) using these new features.

Thanks for all you do!
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Thu Jun 05, 2025 5:04 pm    Post subject: Reply with quote

Bill

If "complex" means passing and returning complex numbers then this addition will not help.

As I understand it, the Standard does not include complex numbers in this context. Please let me know if I am wrong.
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1257
Location: Morrison, CO, USA

PostPosted: Thu Jun 05, 2025 11:17 pm    Post subject: Reply with quote

Oh, sorry! I "misspoke". I meant that there are a number of calculations that would be better done using *D or *PI functions, making the reading of them simpler, versus complex. Mostly involving spherical trig and datum conversions...

I can certainly see using that term would cause some concern!
Back to top
View user's profile Send private message Visit poster's website
Kenneth_Smith



Joined: 18 May 2012
Posts: 809
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Fri Jun 06, 2025 8:23 am    Post subject: Reply with quote

Good work Paul, I appreciate this addition to the library.

Just to clarify, the aforementioned functions are indeed intended to operate on real and not complex variables.
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 -> Suggestions 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