\frac{2}{1 + e^{-2 \cdot x}} - 1\begin{array}{l}
\mathbf{if}\;-2 \cdot x \le -0.0107417321816840241:\\
\;\;\;\;e^{\log \left(\frac{2}{1 + e^{-2 \cdot x}} - 1\right)}\\
\mathbf{elif}\;-2 \cdot x \le 1.14760911155323326 \cdot 10^{-17}:\\
\;\;\;\;1 \cdot x - \left(5.55112 \cdot 10^{-17} \cdot {x}^{4} + 0.33333333333333337 \cdot {x}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{2} \cdot \sqrt{\frac{1}{e^{-2 \cdot x} + 1}} + \sqrt{1}\right) \cdot \left(\sqrt[3]{\sqrt{{\left(\frac{2}{1 + e^{-2 \cdot x}}\right)}^{3}}} - \sqrt{1}\right)\\
\end{array}double code(double x, double y) {
return ((2.0 / (1.0 + exp((-2.0 * x)))) - 1.0);
}
double code(double x, double y) {
double VAR;
if (((-2.0 * x) <= -0.010741732181684024)) {
VAR = exp(log(((2.0 / (1.0 + exp((-2.0 * x)))) - 1.0)));
} else {
double VAR_1;
if (((-2.0 * x) <= 1.1476091115532333e-17)) {
VAR_1 = ((1.0 * x) - ((5.551115123125783e-17 * pow(x, 4.0)) + (0.33333333333333337 * pow(x, 3.0))));
} else {
VAR_1 = (((sqrt(2.0) * sqrt((1.0 / (exp((-2.0 * x)) + 1.0)))) + sqrt(1.0)) * (cbrt(sqrt(pow((2.0 / (1.0 + exp((-2.0 * x)))), 3.0))) - sqrt(1.0)));
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus x



Bits error versus y
Results
if (* -2.0 x) < -0.010741732181684024Initial program 0.0
rmApplied add-exp-log0.0
if -0.010741732181684024 < (* -2.0 x) < 1.1476091115532333e-17Initial program 59.7
Taylor expanded around 0 0.0
if 1.1476091115532333e-17 < (* -2.0 x) Initial program 1.2
rmApplied add-cbrt-cube1.3
Applied add-cbrt-cube1.3
Applied cbrt-undiv1.3
Simplified1.3
rmApplied add-sqr-sqrt1.3
Applied add-sqr-sqrt1.3
Applied cbrt-prod1.3
Applied difference-of-squares1.3
Taylor expanded around inf 1.3
Final simplification0.4
herbie shell --seed 2020106
(FPCore (x y)
:name "Logistic function from Lakshay Garg"
:precision binary64
(- (/ 2 (+ 1 (exp (* -2 x)))) 1))