e^{x} - 1\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{6}, x, \frac{1}{2}\right), {x}^{2}, x\right)double f(double x) {
double r91855 = x;
double r91856 = exp(r91855);
double r91857 = 1.0;
double r91858 = r91856 - r91857;
return r91858;
}
double f(double x) {
double r91859 = 0.16666666666666666;
double r91860 = x;
double r91861 = 0.5;
double r91862 = fma(r91859, r91860, r91861);
double r91863 = 2.0;
double r91864 = pow(r91860, r91863);
double r91865 = fma(r91862, r91864, r91860);
return r91865;
}




Bits error versus x
| Original | 58.7 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 58.7
rmApplied add-cube-cbrt58.9
Applied fma-neg58.9
Taylor expanded around 0 0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2019362 +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))