\frac{2}{1 + e^{-2 \cdot x}} - 1\begin{array}{l}
\mathbf{if}\;-2 \cdot x \le -0.04639353646233555783506830039186752401292:\\
\;\;\;\;\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt[3]{\mathsf{fma}\left(\frac{\sqrt{2}}{1}, \frac{\sqrt{2}}{1 + e^{-2 \cdot x}}, -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\frac{\sqrt{2}}{1}, \frac{\sqrt{2}}{1 + e^{-2 \cdot x}}, -1\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(\frac{\sqrt{2}}{1}, \frac{\sqrt{2}}{1 + e^{-2 \cdot x}}, -1\right)}\right)\right)\\
\mathbf{elif}\;-2 \cdot x \le 7.357856183748689123394269679412382258177 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(2 \cdot 0.5, x, 2 \cdot 0.5 - \mathsf{fma}\left(0.1666666666666666851703837437526090070605 \cdot 2, {x}^{3}, 1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2}{1 + e^{-2 \cdot x}} - 1\right)\right)\\
\end{array}double f(double x, double __attribute__((unused)) y) {
double r77939 = 2.0;
double r77940 = 1.0;
double r77941 = -2.0;
double r77942 = x;
double r77943 = r77941 * r77942;
double r77944 = exp(r77943);
double r77945 = r77940 + r77944;
double r77946 = r77939 / r77945;
double r77947 = r77946 - r77940;
return r77947;
}
double f(double x, double __attribute__((unused)) y) {
double r77948 = -2.0;
double r77949 = x;
double r77950 = r77948 * r77949;
double r77951 = -0.04639353646233556;
bool r77952 = r77950 <= r77951;
double r77953 = 2.0;
double r77954 = sqrt(r77953);
double r77955 = 1.0;
double r77956 = r77954 / r77955;
double r77957 = 1.0;
double r77958 = exp(r77950);
double r77959 = r77957 + r77958;
double r77960 = r77954 / r77959;
double r77961 = -r77957;
double r77962 = fma(r77956, r77960, r77961);
double r77963 = cbrt(r77962);
double r77964 = r77963 * r77963;
double r77965 = r77964 * r77963;
double r77966 = log1p(r77965);
double r77967 = expm1(r77966);
double r77968 = 7.357856183748689e-11;
bool r77969 = r77950 <= r77968;
double r77970 = 0.5;
double r77971 = r77953 * r77970;
double r77972 = 0.16666666666666669;
double r77973 = r77972 * r77953;
double r77974 = 3.0;
double r77975 = pow(r77949, r77974);
double r77976 = fma(r77973, r77975, r77957);
double r77977 = r77971 - r77976;
double r77978 = fma(r77971, r77949, r77977);
double r77979 = log1p(r77978);
double r77980 = expm1(r77979);
double r77981 = r77953 / r77959;
double r77982 = r77981 - r77957;
double r77983 = log1p(r77982);
double r77984 = expm1(r77983);
double r77985 = r77969 ? r77980 : r77984;
double r77986 = r77952 ? r77967 : r77985;
return r77986;
}



Bits error versus x



Bits error versus y
if (* -2.0 x) < -0.04639353646233556Initial program 0.0
rmApplied expm1-log1p-u0.0
rmApplied *-un-lft-identity0.0
Applied add-sqr-sqrt1.6
Applied times-frac1.6
Applied fma-neg1.0
rmApplied add-cube-cbrt0.0
if -0.04639353646233556 < (* -2.0 x) < 7.357856183748689e-11Initial program 59.5
rmApplied expm1-log1p-u59.5
rmApplied *-un-lft-identity59.5
Applied add-sqr-sqrt60.6
Applied times-frac60.6
Applied fma-neg60.6
Taylor expanded around 0 60.6
Simplified0.1
if 7.357856183748689e-11 < (* -2.0 x) Initial program 0.4
rmApplied expm1-log1p-u0.4
Final simplification0.2
herbie shell --seed 2019353 +o rules:numerics
(FPCore (x y)
:name "Logistic function from Lakshay Garg"
:precision binary64
(- (/ 2 (+ 1 (exp (* -2 x)))) 1))