@@ -83,7 +83,8 @@ LIBC_INLINE static double exp10_poly_approx_d(double dx) {
8383// > P = fpminimax((10^x - 1)/x, 5, [|DD...|], [-2^-14, 2^-14]);
8484// Error bounds:
8585// | output - 10^(dx) | < 2^-101
86- static constexpr DoubleDouble exp10_poly_approx_dd (const DoubleDouble &dx) {
86+ LIBC_INLINE static constexpr DoubleDouble
87+ exp10_poly_approx_dd (const DoubleDouble &dx) {
8788 // Taylor polynomial.
8889 constexpr DoubleDouble COEFFS[] = {
8990 {0 , 0x1p0},
@@ -105,7 +106,8 @@ static constexpr DoubleDouble exp10_poly_approx_dd(const DoubleDouble &dx) {
105106// Return exp(dx) ~ 1 + a0 * dx + a1 * dx^2 + ... + a6 * dx^7
106107// For |dx| < 2^-14:
107108// | output - 10^dx | < 1.5 * 2^-124.
108- static constexpr Float128 exp10_poly_approx_f128 (const Float128 &dx) {
109+ LIBC_INLINE static constexpr Float128
110+ exp10_poly_approx_f128 (const Float128 &dx) {
109111 constexpr Float128 COEFFS_128[]{
110112 {Sign::POS, -127 , 0x80000000'00000000'00000000' 00000000_u128}, // 1.0
111113 {Sign::POS, -126 , 0x935d8ddd'aaa8ac16'ea56d62b' 82d30a2d_u128},
@@ -126,7 +128,8 @@ static constexpr Float128 exp10_poly_approx_f128(const Float128 &dx) {
126128// Compute 10^(x) using 128-bit precision.
127129// TODO(lntue): investigate triple-double precision implementation for this
128130// step.
129- static Float128 exp10_f128 (double x, double kd, int idx1, int idx2) {
131+ LIBC_INLINE static Float128 exp10_f128 (double x, double kd, int idx1,
132+ int idx2) {
130133 double t1 = fputil::multiply_add (kd, MLOG10_2_EXP2_M12_HI, x); // exact
131134 double t2 = kd * MLOG10_2_EXP2_M12_MID_32; // exact
132135 double t3 = kd * MLOG10_2_EXP2_M12_LO; // Error < 2^-144
@@ -157,8 +160,8 @@ static Float128 exp10_f128(double x, double kd, int idx1, int idx2) {
157160}
158161
159162// Compute 10^x with double-double precision.
160- static DoubleDouble exp10_double_double ( double x, double kd,
161- const DoubleDouble &exp_mid) {
163+ LIBC_INLINE static DoubleDouble
164+ exp10_double_double ( double x, double kd, const DoubleDouble &exp_mid) {
162165 // Recalculate dx:
163166 // dx = x - k * 2^-12 * log10(2)
164167 double t1 = fputil::multiply_add (kd, MLOG10_2_EXP2_M12_HI, x); // exact
@@ -180,7 +183,7 @@ static DoubleDouble exp10_double_double(double x, double kd,
180183#endif // LIBC_MATH_HAS_SKIP_ACCURATE_PASS
181184
182185// When output is denormal.
183- static double exp10_denorm (double x) {
186+ LIBC_INLINE static double exp10_denorm (double x) {
184187 // Range reduction.
185188 double tmp = fputil::multiply_add (x, LOG2_10, 0x1.8000'0000' 4p21);
186189 int k = static_cast <int >(cpp::bit_cast<uint64_t >(tmp) >> 19 );
@@ -234,7 +237,7 @@ static double exp10_denorm(double x) {
234237// * x >= log10(2^1024)
235238// * x <= log10(2^-1022)
236239// * x is inf or nan
237- static constexpr double exp10_set_exceptional (double x) {
240+ LIBC_INLINE static constexpr double exp10_set_exceptional (double x) {
238241 using FPBits = typename fputil::FPBits<double >;
239242 FPBits xbits (x);
240243
@@ -285,7 +288,7 @@ static constexpr double exp10_set_exceptional(double x) {
285288
286289namespace math {
287290
288- static constexpr double exp10 (double x) {
291+ LIBC_INLINE static constexpr double exp10 (double x) {
289292 using FPBits = typename fputil::FPBits<double >;
290293 FPBits xbits (x);
291294
0 commit comments