[PATCH 4/8] math: Sync exp10 with Arm Optimized Routines

Adhemerval Zanella adhemerval.zanella@linaro.org
Thu Feb 26 20:01:50 GMT 2026


Sync with commit 712aa21 for exp10.c.  No functional change.

Checked on x86_64-linux-gnu, i686-linux-gnu, and aarch64-linux-gnu.
---
 sysdeps/ieee754/dbl-64/e_exp_data.c  | 10 ++++++++++
 sysdeps/ieee754/dbl-64/math_config.h |  3 +++
 2 files changed, 13 insertions(+)

diff --git a/sysdeps/ieee754/dbl-64/e_exp_data.c b/sysdeps/ieee754/dbl-64/e_exp_data.c
index 0b7ea83d60..858cf7eed0 100644
--- a/sysdeps/ieee754/dbl-64/e_exp_data.c
+++ b/sysdeps/ieee754/dbl-64/e_exp_data.c
@@ -162,12 +162,22 @@ const struct exp_data __exp_data = {
 #endif
 },
 .exp10_poly = {
+#if EXP10_POLY_WIDE
+/* Range is wider if using shift-based reduction: coeffs generated
+   using Remez in [-log10(2)/128, log10(2)/128 ].  */
+0x1.26bb1bbb55515p1,
+0x1.53524c73cd32bp1,
+0x1.0470591e1a108p1,
+0x1.2bd77b12fe9a8p0,
+0x1.14289fef24b78p-1
+#else
 /* Coeffs generated using Remez in [-log10(2)/256, log10(2)/256 ].  */
 0x1.26bb1bbb55516p1,
 0x1.53524c73ce9fep1,
 0x1.0470591ce4b26p1,
 0x1.2bd76577fe684p0,
 0x1.1446eeccd0efbp-1
+#endif
 },
 // 2^(k/N) ~= H[k]*(1 + T[k]) for int k in [0,N)
 // tab[2*k] = asuint64(T[k])
diff --git a/sysdeps/ieee754/dbl-64/math_config.h b/sysdeps/ieee754/dbl-64/math_config.h
index 39a35c2066..a74460b422 100644
--- a/sysdeps/ieee754/dbl-64/math_config.h
+++ b/sysdeps/ieee754/dbl-64/math_config.h
@@ -242,6 +242,9 @@ check_uflow (double x)
 #define EXP_USE_TOINT_NARROW 0
 #define EXP2_POLY_ORDER 5
 #define EXP2_POLY_WIDE 0
+/* Wider exp10 polynomial necessary for good precision in non-nearest rounding
+   and !TOINT_INTRINSICS.  */
+#define EXP10_POLY_WIDE 0
 extern const struct exp_data
 {
   double invln2N;
-- 
2.43.0



More information about the Libc-alpha mailing list