\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 \le 282.804764533081823:\\
\;\;\;\;1 + \left({\left(\sqrt[3]{\sqrt[3]{{x}^{2}}}\right)}^{5} \cdot \sqrt[3]{\sqrt[3]{{x}^{2}}}\right) \cdot \left(\sqrt[3]{{x}^{2}} \cdot \left(x \cdot 0.33333333333333337 - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left(\frac{\frac{1 + \frac{1}{\varepsilon}}{e^{\left(1 - \varepsilon\right) \cdot x}}}{2} - \frac{\frac{\frac{1}{\varepsilon} - 1}{e^{\left(1 + \varepsilon\right) \cdot x}}}{2}\right)}\\
\end{array}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 temp;
if ((x <= 282.8047645330818)) {
temp = (1.0 + ((pow(cbrt(cbrt(pow(x, 2.0))), 5.0) * cbrt(cbrt(pow(x, 2.0)))) * (cbrt(pow(x, 2.0)) * ((x * 0.33333333333333337) - 0.5))));
} else {
temp = exp(log(((((1.0 + (1.0 / eps)) / exp(((1.0 - eps) * x))) / 2.0) - ((((1.0 / eps) - 1.0) / exp(((1.0 + eps) * x))) / 2.0))));
}
return temp;
}



Bits error versus x



Bits error versus eps
Results
if x < 282.8047645330818Initial program 39.6
Simplified39.6
Taylor expanded around 0 1.4
Simplified1.4
rmApplied add-cube-cbrt1.4
Applied associate-*l*1.4
rmApplied add-cube-cbrt1.4
Applied associate-*r*1.4
Simplified1.4
if 282.8047645330818 < x Initial program 0.1
Simplified0.1
rmApplied add-exp-log0.1
Final simplification1.1
herbie shell --seed 2020066
(FPCore (x eps)
:name "NMSE Section 6.1 mentioned, A"
:precision binary64
(/ (- (* (+ 1 (/ 1 eps)) (exp (- (* (- 1 eps) x)))) (* (- (/ 1 eps) 1) (exp (- (* (+ 1 eps) x))))) 2))