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 r103020 = x;
double r103021 = exp(r103020);
double r103022 = 1.0;
double r103023 = r103021 - r103022;
return r103023;
}
double f(double x) {
double r103024 = 0.5;
double r103025 = x;
double r103026 = 2.0;
double r103027 = pow(r103025, r103026);
double r103028 = 0.16666666666666666;
double r103029 = 3.0;
double r103030 = pow(r103025, r103029);
double r103031 = fma(r103028, r103030, r103025);
double r103032 = fma(r103024, r103027, r103031);
return r103032;
}




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