\frac{2}{1 + e^{-2 \cdot x}} - 1\begin{array}{l}
\mathbf{if}\;-2 \cdot x \le -2.989922347722678175330202066106721758842:\\
\;\;\;\;\log \left(e^{\frac{2}{1 + e^{-2 \cdot x}} - 1}\right)\\
\mathbf{elif}\;-2 \cdot x \le 8.994147945975712989466477331745863921242 \cdot 10^{-4}:\\
\;\;\;\;1 \cdot x - \left(5.5511151231257827021181583404541015625 \cdot 10^{-17} \cdot {x}^{4} + 0.3333333333333333703407674875052180141211 \cdot {x}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(\sqrt{e^{\frac{2}{1 + e^{-2 \cdot x}} - 1}}\right) + \log \left(\sqrt{e^{\frac{2}{1 + e^{-2 \cdot x}} - 1}}\right)\\
\end{array}double f(double x, double __attribute__((unused)) y) {
double r66348 = 2.0;
double r66349 = 1.0;
double r66350 = -2.0;
double r66351 = x;
double r66352 = r66350 * r66351;
double r66353 = exp(r66352);
double r66354 = r66349 + r66353;
double r66355 = r66348 / r66354;
double r66356 = r66355 - r66349;
return r66356;
}
double f(double x, double __attribute__((unused)) y) {
double r66357 = -2.0;
double r66358 = x;
double r66359 = r66357 * r66358;
double r66360 = -2.989922347722678;
bool r66361 = r66359 <= r66360;
double r66362 = 2.0;
double r66363 = 1.0;
double r66364 = exp(r66359);
double r66365 = r66363 + r66364;
double r66366 = r66362 / r66365;
double r66367 = r66366 - r66363;
double r66368 = exp(r66367);
double r66369 = log(r66368);
double r66370 = 0.0008994147945975713;
bool r66371 = r66359 <= r66370;
double r66372 = r66363 * r66358;
double r66373 = 5.551115123125783e-17;
double r66374 = 4.0;
double r66375 = pow(r66358, r66374);
double r66376 = r66373 * r66375;
double r66377 = 0.33333333333333337;
double r66378 = 3.0;
double r66379 = pow(r66358, r66378);
double r66380 = r66377 * r66379;
double r66381 = r66376 + r66380;
double r66382 = r66372 - r66381;
double r66383 = sqrt(r66368);
double r66384 = log(r66383);
double r66385 = r66384 + r66384;
double r66386 = r66371 ? r66382 : r66385;
double r66387 = r66361 ? r66369 : r66386;
return r66387;
}



Bits error versus x



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