\frac{2}{1 + e^{-2 \cdot x}} - 1\begin{array}{l}
\mathbf{if}\;-2 \cdot x \leq -1.0337968322908504:\\
\;\;\;\;\frac{{\left(\frac{2}{1 + e^{-2 \cdot x}}\right)}^{2} - 1 \cdot 1}{1 + \frac{2}{1 + e^{-2 \cdot x}}}\\
\mathbf{elif}\;-2 \cdot x \leq 3.6353306986864113 \cdot 10^{-06}:\\
\;\;\;\;x \cdot 1 - {x}^{3} \cdot \left(x \cdot 4.440892098500626 \cdot 10^{-16} + 0.3333333333333335\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{\left(\frac{2}{1 + e^{-2 \cdot x}}\right)}^{3}} - 1\\
\end{array}(FPCore (x y) :precision binary64 (- (/ 2.0 (+ 1.0 (exp (* -2.0 x)))) 1.0))
(FPCore (x y)
:precision binary64
(if (<= (* -2.0 x) -1.0337968322908504)
(/
(- (pow (/ 2.0 (+ 1.0 (exp (* -2.0 x)))) 2.0) (* 1.0 1.0))
(+ 1.0 (/ 2.0 (+ 1.0 (exp (* -2.0 x))))))
(if (<= (* -2.0 x) 3.6353306986864113e-06)
(-
(* x 1.0)
(* (pow x 3.0) (+ (* x 4.440892098500626e-16) 0.3333333333333335)))
(- (cbrt (pow (/ 2.0 (+ 1.0 (exp (* -2.0 x)))) 3.0)) 1.0))))double code(double x, double y) {
return ((double) ((2.0 / ((double) (1.0 + ((double) exp(((double) (-2.0 * x))))))) - 1.0));
}
double code(double x, double y) {
double tmp;
if ((((double) (-2.0 * x)) <= -1.0337968322908504)) {
tmp = (((double) (((double) pow((2.0 / ((double) (1.0 + ((double) exp(((double) (-2.0 * x))))))), 2.0)) - ((double) (1.0 * 1.0)))) / ((double) (1.0 + (2.0 / ((double) (1.0 + ((double) exp(((double) (-2.0 * x))))))))));
} else {
double tmp_1;
if ((((double) (-2.0 * x)) <= 3.6353306986864113e-06)) {
tmp_1 = ((double) (((double) (x * 1.0)) - ((double) (((double) pow(x, 3.0)) * ((double) (((double) (x * 4.440892098500626e-16)) + 0.3333333333333335))))));
} else {
tmp_1 = ((double) (((double) cbrt(((double) pow((2.0 / ((double) (1.0 + ((double) exp(((double) (-2.0 * x))))))), 3.0)))) - 1.0));
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus x



Bits error versus y
Results
if (*.f64 -2.0 x) < -1.0337968322908504Initial program 0.0
rmApplied add-cbrt-cube_binary640.0
Applied add-cbrt-cube_binary640.0
Applied cbrt-undiv_binary640.0
Simplified0.0
rmApplied flip--_binary640.0
Simplified0.0
Simplified0.0
if -1.0337968322908504 < (*.f64 -2.0 x) < 3.63533069868641128e-6Initial program 59.1
Taylor expanded around 0 0.1
Simplified0.1
if 3.63533069868641128e-6 < (*.f64 -2.0 x) Initial program 0.1
rmApplied add-cbrt-cube_binary640.1
Applied add-cbrt-cube_binary640.1
Applied cbrt-undiv_binary640.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020204
(FPCore (x y)
:name "Logistic function from Lakshay Garg"
:precision binary64
(- (/ 2.0 (+ 1.0 (exp (* -2.0 x)))) 1.0))