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 r89225 = x;
double r89226 = exp(r89225);
double r89227 = 1.0;
double r89228 = r89226 - r89227;
return r89228;
}
double f(double x) {
double r89229 = 0.5;
double r89230 = x;
double r89231 = 2.0;
double r89232 = pow(r89230, r89231);
double r89233 = 0.16666666666666666;
double r89234 = 3.0;
double r89235 = pow(r89230, r89234);
double r89236 = fma(r89233, r89235, r89230);
double r89237 = fma(r89229, r89232, r89236);
return r89237;
}




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