\frac{2}{1 + e^{-2 \cdot x}} - 1\begin{array}{l}
\mathbf{if}\;x \le -0.004730793410321861:\\
\;\;\;\;\frac{\log \left(e^{\frac{2}{e^{-2 \cdot x} + 1} \cdot \frac{2}{e^{-2 \cdot x} + 1} - 1}\right)}{1 + \frac{2}{e^{-2 \cdot x} + 1}}\\
\mathbf{elif}\;x \le 0.00661692382552498:\\
\;\;\;\;\left(x + {x}^{5} \cdot \frac{2}{15}\right) + \left(\left(x \cdot x\right) \cdot x\right) \cdot \frac{-1}{3}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1 + \frac{2}{e^{-2 \cdot x} + 1}}{\frac{2}{e^{-2 \cdot x} + 1} \cdot \frac{2}{e^{-2 \cdot x} + 1} - 1}}\\
\end{array}double f(double x, double __attribute__((unused)) y) {
double r2382075 = 2.0;
double r2382076 = 1.0;
double r2382077 = -2.0;
double r2382078 = x;
double r2382079 = r2382077 * r2382078;
double r2382080 = exp(r2382079);
double r2382081 = r2382076 + r2382080;
double r2382082 = r2382075 / r2382081;
double r2382083 = r2382082 - r2382076;
return r2382083;
}
double f(double x, double __attribute__((unused)) y) {
double r2382084 = x;
double r2382085 = -0.004730793410321861;
bool r2382086 = r2382084 <= r2382085;
double r2382087 = 2.0;
double r2382088 = -2.0;
double r2382089 = r2382088 * r2382084;
double r2382090 = exp(r2382089);
double r2382091 = 1.0;
double r2382092 = r2382090 + r2382091;
double r2382093 = r2382087 / r2382092;
double r2382094 = r2382093 * r2382093;
double r2382095 = r2382094 - r2382091;
double r2382096 = exp(r2382095);
double r2382097 = log(r2382096);
double r2382098 = r2382091 + r2382093;
double r2382099 = r2382097 / r2382098;
double r2382100 = 0.00661692382552498;
bool r2382101 = r2382084 <= r2382100;
double r2382102 = 5.0;
double r2382103 = pow(r2382084, r2382102);
double r2382104 = 0.13333333333333333;
double r2382105 = r2382103 * r2382104;
double r2382106 = r2382084 + r2382105;
double r2382107 = r2382084 * r2382084;
double r2382108 = r2382107 * r2382084;
double r2382109 = -0.3333333333333333;
double r2382110 = r2382108 * r2382109;
double r2382111 = r2382106 + r2382110;
double r2382112 = r2382098 / r2382095;
double r2382113 = r2382091 / r2382112;
double r2382114 = r2382101 ? r2382111 : r2382113;
double r2382115 = r2382086 ? r2382099 : r2382114;
return r2382115;
}



Bits error versus x



Bits error versus y
Results
if x < -0.004730793410321861Initial program 0.0
Taylor expanded around -inf 0.0
Simplified0.0
rmApplied flip--0.0
Simplified0.0
rmApplied add-log-exp0.0
if -0.004730793410321861 < x < 0.00661692382552498Initial program 59.0
Taylor expanded around -inf 59.0
Simplified59.0
rmApplied flip--59.0
Simplified59.0
rmApplied add-log-exp59.0
Taylor expanded around 0 0.0
Simplified0.0
if 0.00661692382552498 < x Initial program 0.0
Taylor expanded around -inf 0.0
Simplified0.0
rmApplied flip--0.0
Simplified0.0
rmApplied clear-num0.0
Final simplification0.0
herbie shell --seed 2019138
(FPCore (x y)
:name "Logistic function from Lakshay Garg"
(- (/ 2 (+ 1 (exp (* -2 x)))) 1))