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 r120855 = x;
double r120856 = exp(r120855);
double r120857 = 1.0;
double r120858 = r120856 - r120857;
return r120858;
}
double f(double x) {
double r120859 = 0.5;
double r120860 = x;
double r120861 = 2.0;
double r120862 = pow(r120860, r120861);
double r120863 = 0.16666666666666666;
double r120864 = 3.0;
double r120865 = pow(r120860, r120864);
double r120866 = fma(r120863, r120865, r120860);
double r120867 = fma(r120859, r120862, r120866);
return r120867;
}




Bits error versus x
| Original | 58.5 |
|---|---|
| Target | 0.6 |
| Herbie | 0.6 |
Initial program 58.5
Taylor expanded around 0 0.6
Simplified0.6
Final simplification0.6
herbie shell --seed 2019353 +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))