[PATCH 20/25] math: Use tgamma from CORE-MATH
Paul Zimmermann
Paul.Zimmermann@inria.fr
Tue Sep 16 07:32:32 GMT 2025
Hi DJ,
yes this is a classical technique to split a double into a "double-double".
In https://members.loria.fr/PZimmermann/papers/split.pdf we discuss several
such algorithms.
Paul
> From: DJ Delorie <dj@redhat.com>
> Cc: adhemerval.zanella@linaro.org, libc-alpha@sourceware.org,
> josmyers@redhat.com, saban.houssein1@gmail.com, sibid@uvic.ca
> Date: Mon, 15 Sep 2025 12:50:04 -0400
>
> Paul Zimmermann <Paul.Zimmermann@inria.fr> writes:
> > you are right. One could add:
> >
> > /* split x into a high part xh (return value) and a low part xl,
> > where ulp(xh) = 2^-25. If |x| <= 2^26, the splitting is exact:
> > x = xh + xl */
>
> You know, it took me a long time to grok what this high/low part meant,
> as it's not being used the same as a register pair hi-lo. Both values
> are doubles, but their exponents differ by (about) 53, so the mantissas
> cover a wider range of significant bits, yes? This allows the math to
> keep more precision by storing it in the "low" double, but there's no
> shift-merge like there would be with a register pair.
>
>
More information about the Libc-alpha
mailing list