e^{x} - 1\mathsf{fma}\left(\frac{1}{2}, {x}^{2}, \mathsf{fma}\left(\frac{1}{6}, {x}^{3}, x\right)\right)double f(double x) {
double r78121 = x;
double r78122 = exp(r78121);
double r78123 = 1.0;
double r78124 = r78122 - r78123;
return r78124;
}
double f(double x) {
double r78125 = 0.5;
double r78126 = x;
double r78127 = 2.0;
double r78128 = pow(r78126, r78127);
double r78129 = 0.16666666666666666;
double r78130 = 3.0;
double r78131 = pow(r78126, r78130);
double r78132 = fma(r78129, r78131, r78126);
double r78133 = fma(r78125, r78128, r78132);
return r78133;
}




Bits error versus x
| Original | 58.8 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 58.8
Taylor expanded around 0 0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2020018 +o rules:numerics
(FPCore (x)
:name "expm1 (example 3.7)"
:precision binary64
:pre (< -0.00017 x)
:herbie-target
(* x (+ (+ 1 (/ x 2)) (/ (* x x) 6)))
(- (exp x) 1))