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 r112834 = x;
double r112835 = exp(r112834);
double r112836 = 1.0;
double r112837 = r112835 - r112836;
return r112837;
}
double f(double x) {
double r112838 = 0.5;
double r112839 = x;
double r112840 = 2.0;
double r112841 = pow(r112839, r112840);
double r112842 = 0.16666666666666666;
double r112843 = 3.0;
double r112844 = pow(r112839, r112843);
double r112845 = fma(r112842, r112844, r112839);
double r112846 = fma(r112838, r112841, r112845);
return r112846;
}




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 2020025 +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))