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 r79126 = x;
double r79127 = exp(r79126);
double r79128 = 1.0;
double r79129 = r79127 - r79128;
return r79129;
}
double f(double x) {
double r79130 = 0.5;
double r79131 = x;
double r79132 = 2.0;
double r79133 = pow(r79131, r79132);
double r79134 = 0.16666666666666666;
double r79135 = 3.0;
double r79136 = pow(r79131, r79135);
double r79137 = fma(r79134, r79136, r79131);
double r79138 = fma(r79130, r79133, r79137);
return r79138;
}




Bits error versus x
| Original | 58.9 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 58.9
Taylor expanded around 0 0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2020046 +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))