\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}\begin{array}{l}
\mathbf{if}\;x \leq 670.6727462917139:\\
\;\;\;\;\frac{\sqrt[3]{8 + \left(x \cdot x\right) \cdot \left(x \cdot 8 - 12\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{\log \left(\left(1 + \frac{1}{\varepsilon}\right) \cdot {\left(e^{\varepsilon + -1}\right)}^{x} + \frac{1 - \frac{1}{\varepsilon}}{e^{x \cdot \left(1 + \varepsilon\right)}}\right)}}{2}\\
\end{array}(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
(if (<= x 670.6727462917139)
(/ (cbrt (+ 8.0 (* (* x x) (- (* x 8.0) 12.0)))) 2.0)
(/
(exp
(log
(+
(* (+ 1.0 (/ 1.0 eps)) (pow (exp (+ eps -1.0)) x))
(/ (- 1.0 (/ 1.0 eps)) (exp (* x (+ 1.0 eps)))))))
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) {
double tmp;
if (x <= 670.6727462917139) {
tmp = cbrt(8.0 + ((x * x) * ((x * 8.0) - 12.0))) / 2.0;
} else {
tmp = exp(log(((1.0 + (1.0 / eps)) * pow(exp(eps + -1.0), x)) + ((1.0 - (1.0 / eps)) / exp(x * (1.0 + eps))))) / 2.0;
}
return tmp;
}



Bits error versus x



Bits error versus eps
Results
if x < 670.672746291713906Initial program 39.4
Taylor expanded around 0 1.3
Simplified1.3
rmApplied add-cbrt-cube_binary64_4551.3
Simplified1.3
Taylor expanded around 0 1.3
Simplified1.3
if 670.672746291713906 < x Initial program 0
rmApplied add-exp-log_binary64_4570
Simplified0
Final simplification1.0
herbie shell --seed 2020342
(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))