Files
serenity/AK
Lucas Chollet 933c0066ca AK/Math: Make lgamma a lot more precise on the (0, 8) range
Max ULP                Mean ULP
Before:              inf    998274894113382.2500
After:        7352987.00                 18.7027

While this is already a lot better, the error is still significant. This
is mainly due to the areas around the roots of lgamma(x) (x=1 and x=2)
where the results are close to zero and thus requires tiny absolute
errors. On (0, 0.7] ∪ [2.3, 8) the maximum error is 20 ULP.

This introduces a lot of polynomials, but I don't think we have another
choice here (CORE-MATH uses even more on the same interval). To find the
subdivisions, I simply searched for x so that a degree 12 polynomial
would have a small error (~1e-18) on [x, 8] and then repeated the
process until the full [0, 8] interval was filled.
2026-10-12 18:39:50 +02:00
..
2025-09-23 10:34:28 -04:00
2023-03-09 21:43:54 +01:00
2023-03-09 21:43:54 +01:00
2025-10-10 00:02:50 +02:00
2026-02-22 01:33:56 +01:00
2024-06-13 17:40:24 +02:00
2025-10-10 00:02:50 +02:00
2025-10-10 00:02:50 +02:00
2024-01-21 16:16:15 -07:00
2024-06-19 15:45:02 +02:00
2026-04-06 15:44:56 +02:00
2025-10-10 00:02:50 +02:00
2024-04-26 23:46:23 -06:00
2026-04-06 15:44:56 +02:00
2025-08-31 14:04:15 -04:00
2024-02-11 18:53:00 +01:00