[PATCH 11/15] math: Use atanpif from CORE-MATH

DJ Delorie dj@redhat.com
Tue Feb 11 20:01:58 GMT 2025


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 ;-)



More information about the Libc-alpha mailing list