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








Bits error versus x
Results
| Original | 29.9 |
|---|---|
| Target | 0.0 |
| Herbie | 0.6 |
| Alternative 1 | |
|---|---|
| Error | 0.8 |
| Cost | 6912 |
| Alternative 2 | |
|---|---|
| Error | 1.1 |
| Cost | 192 |
| Alternative 3 | |
|---|---|
| Error | 31.5 |
| Cost | 64 |
| Alternative 4 | |
|---|---|
| Error | 61.2 |
| Cost | 64 |

Initial program 29.9
Taylor expanded around 0 0.6
Simplified0.6
Simplified0.6
Final simplification0.6
herbie shell --seed 2021044
(FPCore (x)
:name "exp2 (problem 3.3.7)"
:precision binary64
:herbie-expected 1.5
:herbie-target
(* 4.0 (pow (sinh (/ x 2.0)) 2.0))
(+ (- (exp x) 2.0) (exp (- x))))