\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2}\frac{2 \cdot \frac{1 + x}{e^{x}}}{2}(FPCore (x eps) :precision binary64 (/ (- (* (+ 1.0 (/ 1.0 eps)) (exp (- (* (- 1.0 eps) x)))) (* (- (/ 1.0 eps) 1.0) (exp (- (* (+ 1.0 eps) x))))) 2.0))
(FPCore (x eps) :precision binary64 (/ (* 2.0 (/ (+ 1.0 x) (exp x))) 2.0))
double code(double x, double eps) {
return (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0;
}
double code(double x, double eps) {
return (2.0 * ((1.0 + x) / exp(x))) / 2.0;
}






Bits error versus x






Bits error versus eps
Results
| Alternative 1 | |
|---|---|
| Error | 0.9 |
| Cost | 1281 |
| Alternative 2 | |
|---|---|
| Error | 1.1 |
| Cost | 385 |
| Alternative 3 | |
|---|---|
| Error | 16.7 |
| Cost | 64 |

Initial program 28.6
Taylor expanded around 0 0.6
Simplified0.6
rmApplied exp-neg_binary64_4660.6
Applied un-div-inv_binary64_4170.6
Simplified0.6
Final simplification0.6
herbie shell --seed 2021044
(FPCore (x eps)
:name "NMSE Section 6.1 mentioned, A"
:precision binary64
(/ (- (* (+ 1.0 (/ 1.0 eps)) (exp (- (* (- 1.0 eps) x)))) (* (- (/ 1.0 eps) 1.0) (exp (- (* (+ 1.0 eps) x))))) 2.0))