\frac{2}{1 + e^{-2 \cdot x}} - 1\begin{array}{l}
\mathbf{if}\;-2 \cdot x \le -0.00188039921904495084:\\
\;\;\;\;\log \left(e^{\frac{\frac{\frac{2}{\sqrt{1 + e^{-2 \cdot x}}}}{\sqrt[3]{\sqrt{1 + e^{-2 \cdot x}}} \cdot \sqrt[3]{\sqrt{1 + e^{-2 \cdot x}}}}}{\sqrt[3]{\sqrt{1 + e^{-2 \cdot x}}}} - 1}\right)\\
\mathbf{elif}\;-2 \cdot x \le 0.00100794665255993514:\\
\;\;\;\;1 \cdot x - \left(5.55112 \cdot 10^{-17} \cdot {x}^{4} + 0.33333333333333337 \cdot {x}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{2}{\sqrt{1 + e^{-2 \cdot x}}}}{\sqrt[3]{\sqrt{1 + e^{-2 \cdot x}}} \cdot \sqrt[3]{\sqrt{1 + e^{-2 \cdot x}}}}}{\sqrt[3]{\sqrt{1 + e^{-2 \cdot x}}}} - 1\\
\end{array}double f(double x, double __attribute__((unused)) y) {
double r46804 = 2.0;
double r46805 = 1.0;
double r46806 = -2.0;
double r46807 = x;
double r46808 = r46806 * r46807;
double r46809 = exp(r46808);
double r46810 = r46805 + r46809;
double r46811 = r46804 / r46810;
double r46812 = r46811 - r46805;
return r46812;
}
double f(double x, double __attribute__((unused)) y) {
double r46813 = -2.0;
double r46814 = x;
double r46815 = r46813 * r46814;
double r46816 = -0.0018803992190449508;
bool r46817 = r46815 <= r46816;
double r46818 = 2.0;
double r46819 = 1.0;
double r46820 = exp(r46815);
double r46821 = r46819 + r46820;
double r46822 = sqrt(r46821);
double r46823 = r46818 / r46822;
double r46824 = cbrt(r46822);
double r46825 = r46824 * r46824;
double r46826 = r46823 / r46825;
double r46827 = r46826 / r46824;
double r46828 = r46827 - r46819;
double r46829 = exp(r46828);
double r46830 = log(r46829);
double r46831 = 0.0010079466525599351;
bool r46832 = r46815 <= r46831;
double r46833 = r46819 * r46814;
double r46834 = 5.551115123125783e-17;
double r46835 = 4.0;
double r46836 = pow(r46814, r46835);
double r46837 = r46834 * r46836;
double r46838 = 0.33333333333333337;
double r46839 = 3.0;
double r46840 = pow(r46814, r46839);
double r46841 = r46838 * r46840;
double r46842 = r46837 + r46841;
double r46843 = r46833 - r46842;
double r46844 = r46832 ? r46843 : r46828;
double r46845 = r46817 ? r46830 : r46844;
return r46845;
}



Bits error versus x



Bits error versus y
Results
if (* -2.0 x) < -0.0018803992190449508Initial program 0.0
rmApplied add-sqr-sqrt0.0
Applied associate-/r*0.0
rmApplied add-cube-cbrt0.1
Applied associate-/r*0.1
rmApplied add-log-exp0.1
Applied add-log-exp0.1
Applied diff-log0.1
Simplified0.1
if -0.0018803992190449508 < (* -2.0 x) < 0.0010079466525599351Initial program 59.0
Taylor expanded around 0 0.0
if 0.0010079466525599351 < (* -2.0 x) Initial program 0.1
rmApplied add-sqr-sqrt0.1
Applied associate-/r*0.1
rmApplied add-cube-cbrt0.1
Applied associate-/r*0.1
Final simplification0.0
herbie shell --seed 2020027
(FPCore (x y)
:name "Logistic function from Lakshay Garg"
:precision binary64
(- (/ 2 (+ 1 (exp (* -2 x)))) 1))