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




Bits error versus x
Results
| Original | 29.7 |
|---|---|
| Target | 0.0 |
| Herbie | 0.5 |
Initial program 29.7
Taylor expanded around 0 0.5
Simplified0.5
rmApplied associate-+r+_binary640.5
rmApplied add-sqr-sqrt_binary640.5
Final simplification0.5
herbie shell --seed 2020233
(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))))