\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 244.84131261463813:\\
\;\;\;\;\frac{\frac{\sqrt[3]{{x}^{9} \cdot 0.2962962962962963 + {\left(2 - x \cdot x\right)}^{3}} \cdot \sqrt[3]{{x}^{9} \cdot 0.2962962962962963 + {\left(2 - x \cdot x\right)}^{3}}}{\sqrt{{x}^{6} \cdot 0.4444444444444444 + \left(2 - x \cdot x\right) \cdot \left(\left(2 - x \cdot x\right) - {x}^{3} \cdot 0.6666666666666666\right)}} \cdot \frac{\sqrt[3]{{x}^{9} \cdot 0.2962962962962963 + {\left(2 - x \cdot x\right)}^{3}}}{\sqrt{{x}^{6} \cdot 0.4444444444444444 + \left(2 - x \cdot x\right) \cdot \left(\left(2 - x \cdot x\right) - {x}^{3} \cdot 0.6666666666666666\right)}}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\sqrt[3]{1 + \frac{1}{\varepsilon}} \cdot \sqrt[3]{1 + \frac{1}{\varepsilon}}\right) \cdot \frac{\sqrt[3]{1 + \frac{1}{\varepsilon}}}{e^{x \cdot \left(1 - \varepsilon\right)}} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{x \cdot \left(-1 - \varepsilon\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 244.84131261463813)
(/
(*
(/
(*
(cbrt (+ (* (pow x 9.0) 0.2962962962962963) (pow (- 2.0 (* x x)) 3.0)))
(cbrt (+ (* (pow x 9.0) 0.2962962962962963) (pow (- 2.0 (* x x)) 3.0))))
(sqrt
(+
(* (pow x 6.0) 0.4444444444444444)
(*
(- 2.0 (* x x))
(- (- 2.0 (* x x)) (* (pow x 3.0) 0.6666666666666666))))))
(/
(cbrt (+ (* (pow x 9.0) 0.2962962962962963) (pow (- 2.0 (* x x)) 3.0)))
(sqrt
(+
(* (pow x 6.0) 0.4444444444444444)
(*
(- 2.0 (* x x))
(- (- 2.0 (* x x)) (* (pow x 3.0) 0.6666666666666666)))))))
2.0)
(/
(-
(*
(* (cbrt (+ 1.0 (/ 1.0 eps))) (cbrt (+ 1.0 (/ 1.0 eps))))
(/ (cbrt (+ 1.0 (/ 1.0 eps))) (exp (* x (- 1.0 eps)))))
(* (- (/ 1.0 eps) 1.0) (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 <= 244.84131261463813) {
tmp = (((cbrt((pow(x, 9.0) * 0.2962962962962963) + pow((2.0 - (x * x)), 3.0)) * cbrt((pow(x, 9.0) * 0.2962962962962963) + pow((2.0 - (x * x)), 3.0))) / sqrt((pow(x, 6.0) * 0.4444444444444444) + ((2.0 - (x * x)) * ((2.0 - (x * x)) - (pow(x, 3.0) * 0.6666666666666666))))) * (cbrt((pow(x, 9.0) * 0.2962962962962963) + pow((2.0 - (x * x)), 3.0)) / sqrt((pow(x, 6.0) * 0.4444444444444444) + ((2.0 - (x * x)) * ((2.0 - (x * x)) - (pow(x, 3.0) * 0.6666666666666666)))))) / 2.0;
} else {
tmp = (((cbrt(1.0 + (1.0 / eps)) * cbrt(1.0 + (1.0 / eps))) * (cbrt(1.0 + (1.0 / eps)) / exp(x * (1.0 - eps)))) - (((1.0 / eps) - 1.0) * exp(x * (-1.0 - eps)))) / 2.0;
}
return tmp;
}



Bits error versus x



Bits error versus eps
Results
if x < 244.84131261463813Initial program 39.3
Taylor expanded around 0 1.3
Simplified1.3
rmApplied associate--l+_binary64_151.3
rmApplied flip3-+_binary64_811.3
Simplified1.3
Simplified1.3
rmApplied add-sqr-sqrt_binary64_1001.3
Applied add-cube-cbrt_binary64_1131.3
Applied times-frac_binary64_841.3
if 244.84131261463813 < x Initial program 0.1
rmApplied add-cube-cbrt_binary64_1130.1
Applied associate-*l*_binary64_190.1
Simplified0.1
Final simplification1.0
herbie shell --seed 2020354
(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))