\frac{2}{1 + e^{-2 \cdot x}} - 1\begin{array}{l}
\mathbf{if}\;-2 \cdot x \leq -17.726881421434474:\\
\;\;\;\;\frac{\frac{\frac{4}{{\left(1 + e^{-2 \cdot x}\right)}^{2}} - 1}{\sqrt[3]{1 + \frac{2}{1 + e^{-2 \cdot x}}} \cdot \sqrt[3]{1 + \frac{2}{1 + e^{-2 \cdot x}}}}}{\sqrt[3]{1 + \frac{2}{1 + e^{-2 \cdot x}}}}\\
\mathbf{elif}\;-2 \cdot x \leq 1.916498673169216 \cdot 10^{-13}:\\
\;\;\;\;x - {x}^{3} \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{4}{{\left(1 + e^{-2 \cdot x}\right)}^{1.5} \cdot \sqrt{1 + e^{-2 \cdot x}}} + -1}{1 + \frac{2}{1 + e^{-2 \cdot x}}}\\
\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) -17.726881421434474)
(/
(/
(- (/ 4.0 (pow (+ 1.0 (exp (* -2.0 x))) 2.0)) 1.0)
(*
(cbrt (+ 1.0 (/ 2.0 (+ 1.0 (exp (* -2.0 x))))))
(cbrt (+ 1.0 (/ 2.0 (+ 1.0 (exp (* -2.0 x))))))))
(cbrt (+ 1.0 (/ 2.0 (+ 1.0 (exp (* -2.0 x)))))))
(if (<= (* -2.0 x) 1.916498673169216e-13)
(- x (* (pow x 3.0) 0.3333333333333333))
(/
(+
(/
4.0
(* (pow (+ 1.0 (exp (* -2.0 x))) 1.5) (sqrt (+ 1.0 (exp (* -2.0 x))))))
-1.0)
(+ 1.0 (/ 2.0 (+ 1.0 (exp (* -2.0 x)))))))))double code(double x, double y) {
return (2.0 / (1.0 + exp(-2.0 * x))) - 1.0;
}
double code(double x, double y) {
double tmp;
if ((-2.0 * x) <= -17.726881421434474) {
tmp = (((4.0 / pow((1.0 + exp(-2.0 * x)), 2.0)) - 1.0) / (cbrt(1.0 + (2.0 / (1.0 + exp(-2.0 * x)))) * cbrt(1.0 + (2.0 / (1.0 + exp(-2.0 * x)))))) / cbrt(1.0 + (2.0 / (1.0 + exp(-2.0 * x))));
} else if ((-2.0 * x) <= 1.916498673169216e-13) {
tmp = x - (pow(x, 3.0) * 0.3333333333333333);
} else {
tmp = ((4.0 / (pow((1.0 + exp(-2.0 * x)), 1.5) * sqrt(1.0 + exp(-2.0 * x)))) + -1.0) / (1.0 + (2.0 / (1.0 + exp(-2.0 * x))));
}
return tmp;
}



Bits error versus x



Bits error versus y
Results
if (*.f64 -2 x) < -17.7268814214344737Initial program 0.0
rmApplied flip--_binary640.0
Simplified0.0
Simplified0.0
rmApplied add-cube-cbrt_binary640.0
Applied associate-/r*_binary640.0
Simplified0.0
if -17.7268814214344737 < (*.f64 -2 x) < 1.91649867316921601e-13Initial program 59.1
rmApplied flip--_binary6459.1
Simplified59.1
Simplified59.1
Taylor expanded around 0 0.3
Simplified0.3
if 1.91649867316921601e-13 < (*.f64 -2 x) Initial program 0.7
rmApplied flip--_binary640.7
Simplified0.7
Simplified0.7
rmApplied add-sqr-sqrt_binary640.7
Applied associate-*r*_binary640.7
Simplified0.7
Final simplification0.3
herbie shell --seed 2021128
(FPCore (x y)
:name "Logistic function from Lakshay Garg"
:precision binary64
(- (/ 2.0 (+ 1.0 (exp (* -2.0 x)))) 1.0))