\frac{2}{1 + e^{-2 \cdot x}} - 1\begin{array}{l}
\mathbf{if}\;-2 \cdot x \le -0.168673542136596771:\\
\;\;\;\;1 \cdot \left(\frac{2}{e^{-2 \cdot x} + 1} - 1\right)\\
\mathbf{elif}\;-2 \cdot x \le 9.00792072330781855 \cdot 10^{-11}:\\
\;\;\;\;1 \cdot \mathsf{fma}\left(1, x, -\mathsf{fma}\left(5.55112 \cdot 10^{-17}, {x}^{4}, 0.33333333333333337 \cdot {x}^{3}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \left(\left(\sqrt{\frac{2}{e^{-2 \cdot x} + 1}} + \sqrt{1}\right) \cdot \left(\sqrt{\frac{2}{e^{-2 \cdot x} + 1}} - \sqrt{1}\right)\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 temp;
if (((-2.0 * x) <= -0.16867354213659677)) {
temp = (1.0 * ((2.0 / (exp((-2.0 * x)) + 1.0)) - 1.0));
} else {
double temp_1;
if (((-2.0 * x) <= 9.007920723307819e-11)) {
temp_1 = (1.0 * fma(1.0, x, -fma(5.551115123125783e-17, pow(x, 4.0), (0.33333333333333337 * pow(x, 3.0)))));
} else {
temp_1 = (1.0 * ((sqrt((2.0 / (exp((-2.0 * x)) + 1.0))) + sqrt(1.0)) * (sqrt((2.0 / (exp((-2.0 * x)) + 1.0))) - sqrt(1.0))));
}
temp = temp_1;
}
return temp;
}



Bits error versus x



Bits error versus y
Results
if (* -2.0 x) < -0.16867354213659677Initial program 0.0
rmApplied *-un-lft-identity0.0
Applied *-un-lft-identity0.0
Applied distribute-lft-out--0.0
Simplified0.0
if -0.16867354213659677 < (* -2.0 x) < 9.007920723307819e-11Initial program 59.2
rmApplied *-un-lft-identity59.2
Applied *-un-lft-identity59.2
Applied distribute-lft-out--59.2
Simplified59.2
Taylor expanded around 0 0.1
Simplified0.1
if 9.007920723307819e-11 < (* -2.0 x) Initial program 0.5
rmApplied *-un-lft-identity0.5
Applied *-un-lft-identity0.5
Applied distribute-lft-out--0.5
Simplified0.5
rmApplied add-sqr-sqrt0.5
Applied add-sqr-sqrt0.5
Applied difference-of-squares0.5
Final simplification0.2
herbie shell --seed 2020066 +o rules:numerics
(FPCore (x y)
:name "Logistic function from Lakshay Garg"
:precision binary64
(- (/ 2 (+ 1 (exp (* -2 x)))) 1))