\frac{2}{1 + e^{-2 \cdot x}} - 1\begin{array}{l}
\mathbf{if}\;-2 \cdot x \le -12.329649134843827:\\
\;\;\;\;\frac{\frac{2}{1 + e^{-2 \cdot x}} \cdot \frac{2}{1 + e^{-2 \cdot x}} - 1 \cdot 1}{\frac{2}{1 + e^{-2 \cdot x}} + 1}\\
\mathbf{elif}\;-2 \cdot x \le 5.30640056390034621 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(1, x, -\mathsf{fma}\left(5.55112 \cdot 10^{-17}, {x}^{4}, 0.33333333333333337 \cdot {x}^{3}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\frac{2}{1 + e^{-2 \cdot x}} \cdot \frac{2}{1 + e^{-2 \cdot x}}\right) \cdot \left(\frac{2}{1 + e^{-2 \cdot x}} \cdot \frac{2}{1 + e^{-2 \cdot x}}\right) - \left(1 \cdot 1\right) \cdot \left(1 \cdot 1\right)}{\mathsf{fma}\left(\frac{2}{1 + e^{-2 \cdot x}}, \frac{2}{1 + e^{-2 \cdot x}}, 1 \cdot 1\right) \cdot \left(\frac{2}{1 + e^{-2 \cdot x}} + 1\right)}\\
\end{array}double f(double x, double __attribute__((unused)) y) {
double r57108 = 2.0;
double r57109 = 1.0;
double r57110 = -2.0;
double r57111 = x;
double r57112 = r57110 * r57111;
double r57113 = exp(r57112);
double r57114 = r57109 + r57113;
double r57115 = r57108 / r57114;
double r57116 = r57115 - r57109;
return r57116;
}
double f(double x, double __attribute__((unused)) y) {
double r57117 = -2.0;
double r57118 = x;
double r57119 = r57117 * r57118;
double r57120 = -12.329649134843827;
bool r57121 = r57119 <= r57120;
double r57122 = 2.0;
double r57123 = 1.0;
double r57124 = exp(r57119);
double r57125 = r57123 + r57124;
double r57126 = r57122 / r57125;
double r57127 = r57126 * r57126;
double r57128 = r57123 * r57123;
double r57129 = r57127 - r57128;
double r57130 = r57126 + r57123;
double r57131 = r57129 / r57130;
double r57132 = 5.306400563900346e-06;
bool r57133 = r57119 <= r57132;
double r57134 = 5.551115123125783e-17;
double r57135 = 4.0;
double r57136 = pow(r57118, r57135);
double r57137 = 0.33333333333333337;
double r57138 = 3.0;
double r57139 = pow(r57118, r57138);
double r57140 = r57137 * r57139;
double r57141 = fma(r57134, r57136, r57140);
double r57142 = -r57141;
double r57143 = fma(r57123, r57118, r57142);
double r57144 = r57127 * r57127;
double r57145 = r57128 * r57128;
double r57146 = r57144 - r57145;
double r57147 = fma(r57126, r57126, r57128);
double r57148 = r57147 * r57130;
double r57149 = r57146 / r57148;
double r57150 = r57133 ? r57143 : r57149;
double r57151 = r57121 ? r57131 : r57150;
return r57151;
}



Bits error versus x



Bits error versus y
if (* -2.0 x) < -12.329649134843827Initial program 0.0
rmApplied flip--0.0
if -12.329649134843827 < (* -2.0 x) < 5.306400563900346e-06Initial program 59.0
Taylor expanded around 0 0.2
Simplified0.2
if 5.306400563900346e-06 < (* -2.0 x) Initial program 0.1
rmApplied flip--0.1
rmApplied flip--0.1
Applied associate-/l/0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020056 +o rules:numerics
(FPCore (x y)
:name "Logistic function from Lakshay Garg"
:precision binary64
(- (/ 2 (+ 1 (exp (* -2 x)))) 1))