[PATCH 11/15] math: Use atanpif from CORE-MATH
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Tue Feb 11 20:10:35 GMT 2025
On 11/02/25 17:01, DJ Delorie wrote:
> Paul Zimmermann <Paul.Zimmermann@inria.fr> writes:
>>>>
>>>>> + else
>>>>> + return f - 0x1.45f306p-2f / x;
>>>>> + }
>>
>> it is to avoid a spurious underflow in 0x1.45f306p-2f / x.
>>
>> In fact we can replace by any expression f - t where |t| < 1/2 ulp(0.5),
>> and t has the same sign than x, thus f - __builtin_copysignf(0x1p-26f,x)
>> should work (not tested).
>
> Doing it that way (copysign) would make it much more obvious what the
> intent was, but as long as it works it's ok ;-)
>
Paul has done this on recent CORE-MATH change [1], I will add it on my
branch.
[1] https://gitlab.inria.fr/core-math/core-math/-/commit/0223c8fd7bcf2f78eaffa025eae3dcbaab873cf2
More information about the Libc-alpha
mailing list