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 r93475 = x;
double r93476 = exp(r93475);
double r93477 = 1.0;
double r93478 = r93476 - r93477;
return r93478;
}
double f(double x) {
double r93479 = 0.5;
double r93480 = x;
double r93481 = 2.0;
double r93482 = pow(r93480, r93481);
double r93483 = 0.16666666666666666;
double r93484 = 3.0;
double r93485 = pow(r93480, r93484);
double r93486 = fma(r93483, r93485, r93480);
double r93487 = fma(r93479, r93482, r93486);
return r93487;
}




Bits error versus x
| Original | 58.7 |
|---|---|
| Target | 0.5 |
| Herbie | 0.5 |
Initial program 58.7
Taylor expanded around 0 0.5
Simplified0.5
Final simplification0.5
herbie shell --seed 2020001 +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))