@@ -36,15 +36,15 @@ using Float128 = typename fputil::DyadicFloat<128>;
36
36
using LIBC_NAMESPACE::operator " " _u128;
37
37
38
38
// log2(e)
39
- static constexpr double LOG2_E = 0x1 .71547652b82fep+0 ;
39
+ static double LOG2_E = 0x1 .71547652b82fep+0 ;
40
40
41
41
// Error bounds:
42
42
// Errors when using double precision.
43
- static constexpr double ERR_D = 0x1 .8p-63 ;
43
+ static double ERR_D = 0x1 .8p-63 ;
44
44
45
45
#ifndef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
46
46
// Errors when using double-double precision.
47
- static constexpr double ERR_DD = 0x1 .0p-99 ;
47
+ static double ERR_DD = 0x1 .0p-99 ;
48
48
#endif // LIBC_MATH_HAS_SKIP_ACCURATE_PASS
49
49
50
50
// -2^-12 * log(2)
@@ -53,12 +53,12 @@ static constexpr double ERR_DD = 0x1.0p-99;
53
53
// > c = round(a - b, 30, RN);
54
54
// > d = round(a - b - c, D, RN);
55
55
// Errors < 1.5 * 2^-133
56
- static constexpr double MLOG_2_EXP2_M12_HI = -0x1 .62e42ffp-13 ;
57
- static constexpr double MLOG_2_EXP2_M12_MID = 0x1 .718432a1b0e26p-47 ;
56
+ static double MLOG_2_EXP2_M12_HI = -0x1 .62e42ffp-13 ;
57
+ static double MLOG_2_EXP2_M12_MID = 0x1 .718432a1b0e26p-47 ;
58
58
59
59
#ifndef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
60
- static constexpr double MLOG_2_EXP2_M12_MID_30 = 0x1 .718432ap-47 ;
61
- static constexpr double MLOG_2_EXP2_M12_LO = 0x1 .b0e2633fe0685p-79 ;
60
+ static double MLOG_2_EXP2_M12_MID_30 = 0x1 .718432ap-47 ;
61
+ static double MLOG_2_EXP2_M12_LO = 0x1 .b0e2633fe0685p-79 ;
62
62
#endif // LIBC_MATH_HAS_SKIP_ACCURATE_PASS
63
63
64
64
namespace {
@@ -67,7 +67,7 @@ namespace {
67
67
// Return expm1(dx) / x ~ 1 + dx / 2 + dx^2 / 6 + dx^3 / 24.
68
68
// For |dx| < 2^-13 + 2^-30:
69
69
// | output - expm1(dx) / dx | < 2^-51.
70
- static constexpr double poly_approx_d (double dx) {
70
+ static double poly_approx_d (double dx) {
71
71
// dx^2
72
72
double dx2 = dx * dx;
73
73
// c0 = 1 + dx / 2
@@ -85,7 +85,7 @@ static constexpr double poly_approx_d(double dx) {
85
85
// Return exp(dx) ~ 1 + dx + dx^2 / 2 + ... + dx^6 / 720
86
86
// For |dx| < 2^-13 + 2^-30:
87
87
// | output - exp(dx) | < 2^-101
88
- static constexpr DoubleDouble poly_approx_dd (const DoubleDouble &dx) {
88
+ static DoubleDouble poly_approx_dd (const DoubleDouble &dx) {
89
89
// Taylor polynomial.
90
90
constexpr DoubleDouble COEFFS[] = {
91
91
{0 , 0x1p0}, // 1
@@ -106,7 +106,7 @@ static constexpr DoubleDouble poly_approx_dd(const DoubleDouble &dx) {
106
106
// Return exp(dx) ~ 1 + dx + dx^2 / 2 + ... + dx^7 / 5040
107
107
// For |dx| < 2^-13 + 2^-30:
108
108
// | output - exp(dx) | < 2^-126.
109
- static constexpr Float128 poly_approx_f128 (const Float128 &dx) {
109
+ static Float128 poly_approx_f128 (const Float128 &dx) {
110
110
constexpr Float128 COEFFS_128[]{
111
111
{Sign::POS, -127 , 0x80000000'00000000'00000000' 00000000_u128}, // 1.0
112
112
{Sign::POS, -127 , 0x80000000'00000000'00000000' 00000000_u128}, // 1.0
@@ -127,7 +127,7 @@ static constexpr Float128 poly_approx_f128(const Float128 &dx) {
127
127
// Compute exp(x) using 128-bit precision.
128
128
// TODO(lntue): investigate triple-double precision implementation for this
129
129
// step.
130
- static constexpr Float128 exp_f128 (double x, double kd, int idx1, int idx2) {
130
+ static Float128 exp_f128 (double x, double kd, int idx1, int idx2) {
131
131
// Recalculate dx:
132
132
133
133
double t1 = fputil::multiply_add (kd, MLOG_2_EXP2_M12_HI, x); // exact
@@ -160,7 +160,7 @@ static constexpr Float128 exp_f128(double x, double kd, int idx1, int idx2) {
160
160
}
161
161
162
162
// Compute exp(x) with double-double precision.
163
- static constexpr DoubleDouble exp_double_double (double x, double kd,
163
+ static DoubleDouble exp_double_double (double x, double kd,
164
164
const DoubleDouble &exp_mid) {
165
165
// Recalculate dx:
166
166
// dx = x - k * 2^-12 * log(2)
@@ -184,7 +184,7 @@ static constexpr DoubleDouble exp_double_double(double x, double kd,
184
184
185
185
// Check for exceptional cases when
186
186
// |x| <= 2^-53 or x < log(2^-1075) or x >= 0x1.6232bdd7abcd3p+9
187
- static constexpr double set_exceptional (double x) {
187
+ static double set_exceptional (double x) {
188
188
using FPBits = typename fputil::FPBits<double >;
189
189
FPBits xbits (x);
190
190
@@ -234,7 +234,7 @@ static constexpr double set_exceptional(double x) {
234
234
235
235
namespace math {
236
236
237
- static constexpr double exp (double x) {
237
+ static double exp (double x) {
238
238
using FPBits = typename fputil::FPBits<double >;
239
239
FPBits xbits (x);
240
240
0 commit comments