\left(e^{x} - 2\right) + e^{-x}
0.08333333333333333 \cdot {x}^{4} + \left(\mathsf{fma}\left(0.002777777777777778, {x}^{6}, 4.96031746031746 \cdot 10^{-5} \cdot {x}^{8}\right) + {x}^{2}\right)
(FPCore (x) :precision binary64 (+ (- (exp x) 2.0) (exp (- x))))
(FPCore (x) :precision binary64 (+ (* 0.08333333333333333 (pow x 4.0)) (+ (fma 0.002777777777777778 (pow x 6.0) (* 4.96031746031746e-5 (pow x 8.0))) (pow x 2.0))))
double code(double x) {
return (exp(x) - 2.0) + exp(-x);
}
double code(double x) {
return (0.08333333333333333 * pow(x, 4.0)) + (fma(0.002777777777777778, pow(x, 6.0), (4.96031746031746e-5 * pow(x, 8.0))) + pow(x, 2.0));
}




Bits error versus x
| Original | 29.4 |
|---|---|
| Target | 0.0 |
| Herbie | 0.6 |
Initial program 29.4
Taylor expanded in x around 0 0.6
Applied associate-+r+_binary640.6
Simplified0.6
Final simplification0.6
herbie shell --seed 2021215
(FPCore (x)
:name "exp2 (problem 3.3.7)"
:precision binary64
:herbie-target
(* 4.0 (pow (sinh (/ x 2.0)) 2.0))
(+ (- (exp x) 2.0) (exp (- x))))