e^{x} - 1\mathsf{fma}\left({x}^{2}, \mathsf{fma}\left(x, \frac{1}{6}, \frac{1}{2}\right), x\right)double f(double x) {
double r80952 = x;
double r80953 = exp(r80952);
double r80954 = 1.0;
double r80955 = r80953 - r80954;
return r80955;
}
double f(double x) {
double r80956 = x;
double r80957 = 2.0;
double r80958 = pow(r80956, r80957);
double r80959 = 0.16666666666666666;
double r80960 = 0.5;
double r80961 = fma(r80956, r80959, r80960);
double r80962 = fma(r80958, r80961, r80956);
return r80962;
}




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