On Mon, Mar 24, 2025 at 8:25 PM Steve Kargl
<s...@troutmask.apl.washington.edu> wrote:
>
> I've already written a prototype of the half-cycle trig
> functions.
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113152
>
> There are two issues that need to be address.  First, some
> operating systems provide half-cycle trig functions in their
> libm.  The initial patch tries to use libm functions if
> found, but in hindsight I think gfortran should simply
> provide its own implementations. ith C,”

Hello Steve, long time no see. AFAIU the motivation for these
half-cycle functions is to avoid the non-trivial gymnastics associated
with argument reduction of a multiple of pi. Both in terms of cpu
time, and in the possibility of getting it wrong and not producing a
correctly rounded result. It seems to me that if libm provides said
functions it would be preferably to call those directly rather than
always using some fallback implementation that ends up calling the
"normal" trig functions. Not sure how that should be implemented,
maybe some kind of weak symbol trickery to use the libgfortran
fallback implementations in case libm doesn't provide it?

-- 
Janne Blomqvist

Reply via email to