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 r69011 = x;
double r69012 = exp(r69011);
double r69013 = 1.0;
double r69014 = r69012 - r69013;
return r69014;
}
double f(double x) {
double r69015 = x;
double r69016 = 2.0;
double r69017 = pow(r69015, r69016);
double r69018 = 0.16666666666666666;
double r69019 = 0.5;
double r69020 = fma(r69015, r69018, r69019);
double r69021 = fma(r69017, r69020, r69015);
return r69021;
}




Bits error versus x
| Original | 58.6 |
|---|---|
| Target | 0.5 |
| Herbie | 0.5 |
Initial program 58.6
Taylor expanded around 0 0.5
Simplified0.5
Final simplification0.5
herbie shell --seed 2019326 +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))