\frac{2}{1 + e^{-2 \cdot x}} - 1\begin{array}{l}
\mathbf{if}\;-2 \cdot x \leq -1948.3925254814726:\\
\;\;\;\;\log \left(e^{\frac{2}{1 + e^{-2 \cdot x}}}\right) - 1\\
\mathbf{elif}\;-2 \cdot x \leq 0.001126977468769467:\\
\;\;\;\;\left(x - 0.3333333333333333 \cdot {x}^{3}\right) + 0.13333333333333333 \cdot {x}^{5}\\
\mathbf{else}:\\
\;\;\;\;\frac{\log \left(\sqrt{e^{\frac{2}{1 + e^{-2 \cdot x}}}}\right) \cdot \log \left(\sqrt{e^{\frac{2}{1 + e^{-2 \cdot x}}}}\right) - \left(-1 + \frac{2}{1 + e^{-2 \cdot x}} \cdot 0.5\right) \cdot \left(-1 + \frac{2}{1 + e^{-2 \cdot x}} \cdot 0.5\right)}{\log \left(\sqrt{e^{\frac{2}{1 + e^{-2 \cdot x}}}}\right) - \left(-1 + \frac{2}{1 + e^{-2 \cdot x}} \cdot 0.5\right)}\\
\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) -1948.3925254814726)
(- (log (exp (/ 2.0 (+ 1.0 (exp (* -2.0 x)))))) 1.0)
(if (<= (* -2.0 x) 0.001126977468769467)
(+
(- x (* 0.3333333333333333 (pow x 3.0)))
(* 0.13333333333333333 (pow x 5.0)))
(/
(-
(*
(log (sqrt (exp (/ 2.0 (+ 1.0 (exp (* -2.0 x)))))))
(log (sqrt (exp (/ 2.0 (+ 1.0 (exp (* -2.0 x))))))))
(*
(+ -1.0 (* (/ 2.0 (+ 1.0 (exp (* -2.0 x)))) 0.5))
(+ -1.0 (* (/ 2.0 (+ 1.0 (exp (* -2.0 x)))) 0.5))))
(-
(log (sqrt (exp (/ 2.0 (+ 1.0 (exp (* -2.0 x)))))))
(+ -1.0 (* (/ 2.0 (+ 1.0 (exp (* -2.0 x)))) 0.5)))))))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) <= -1948.3925254814726) {
tmp = log(exp(2.0 / (1.0 + exp(-2.0 * x)))) - 1.0;
} else if ((-2.0 * x) <= 0.001126977468769467) {
tmp = (x - (0.3333333333333333 * pow(x, 3.0))) + (0.13333333333333333 * pow(x, 5.0));
} else {
tmp = ((log(sqrt(exp(2.0 / (1.0 + exp(-2.0 * x))))) * log(sqrt(exp(2.0 / (1.0 + exp(-2.0 * x)))))) - ((-1.0 + ((2.0 / (1.0 + exp(-2.0 * x))) * 0.5)) * (-1.0 + ((2.0 / (1.0 + exp(-2.0 * x))) * 0.5)))) / (log(sqrt(exp(2.0 / (1.0 + exp(-2.0 * x))))) - (-1.0 + ((2.0 / (1.0 + exp(-2.0 * x))) * 0.5)));
}
return tmp;
}



Bits error versus x



Bits error versus y
Results
if (*.f64 -2 x) < -1948.3925254814726Initial program 0
rmApplied add-log-exp_binary64_7990
Simplified0
if -1948.3925254814726 < (*.f64 -2 x) < 0.00112697746876946696Initial program 58.7
Taylor expanded around 0 0.3
Simplified0.3
if 0.00112697746876946696 < (*.f64 -2 x) Initial program 0.1
rmApplied add-log-exp_binary64_7990.1
Simplified0.1
rmApplied add-sqr-sqrt_binary64_7820.1
Applied log-prod_binary64_8460.1
Applied associate--l+_binary64_6970.1
Simplified0.1
rmApplied flip-+_binary64_7340.1
Final simplification0.1
herbie shell --seed 2021098
(FPCore (x y)
:name "Logistic function from Lakshay Garg"
:precision binary64
(- (/ 2.0 (+ 1.0 (exp (* -2.0 x)))) 1.0))