\left(e^{x} - 2\right) + e^{-x}x \cdot x + 0.08333333333333333 \cdot {x}^{4}(FPCore (x) :precision binary64 (+ (- (exp x) 2.0) (exp (- x))))
(FPCore (x) :precision binary64 (+ (* x x) (* 0.08333333333333333 (pow x 4.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));
}























Bits error versus x
Results
| Original | 29.9 |
|---|---|
| Target | 0.0 |
| Herbie | 0.7 |
| Alternative 1 | |
|---|---|
| Error | 30.0 |
| Cost | 58944 |
| Alternative 2 | |
|---|---|
| Error | 30.0 |
| Cost | 46080 |
| Alternative 3 | |
|---|---|
| Error | 29.9 |
| Cost | 39488 |
| Alternative 4 | |
|---|---|
| Error | 29.9 |
| Cost | 39232 |
| Alternative 5 | |
|---|---|
| Error | 30.0 |
| Cost | 32896 |
| Alternative 6 | |
|---|---|
| Error | 52.8 |
| Cost | 27072 |
| Alternative 7 | |
|---|---|
| Error | 52.7 |
| Cost | 26944 |
| Alternative 8 | |
|---|---|
| Error | 52.8 |
| Cost | 26560 |
| Alternative 9 | |
|---|---|
| Error | 30.0 |
| Cost | 26048 |
| Alternative 10 | |
|---|---|
| Error | 29.9 |
| Cost | 25984 |
| Alternative 11 | |
|---|---|
| Error | 30.3 |
| Cost | 25984 |
| Alternative 12 | |
|---|---|
| Error | 20.8 |
| Cost | 19776 |
| Alternative 13 | |
|---|---|
| Error | 29.9 |
| Cost | 13184 |
| Alternative 14 | |
|---|---|
| Error | 29.9 |
| Cost | 13184 |
| Alternative 15 | |
|---|---|
| Error | 31.1 |
| Cost | 6656 |
| Alternative 16 | |
|---|---|
| Error | 1.1 |
| Cost | 192 |
| Alternative 17 | |
|---|---|
| Error | 61.2 |
| Cost | 64 |
| Alternative 18 | |
|---|---|
| Error | 31.4 |
| Cost | 64 |
| Alternative 19 | |
|---|---|
| Error | 62.3 |
| Cost | 64 |

Initial program 29.9
Taylor expanded around 0 0.7
Simplified0.7
Simplified0.7
Final simplification0.7
herbie shell --seed 2021042
(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))))