\frac{x}{x + 1} - \frac{x + 1}{x - 1}\begin{array}{l}
\mathbf{if}\;x \le -12354.188123908416:\\
\;\;\;\;\left(\frac{-3}{x} - \frac{1}{x \cdot x}\right) + \frac{\frac{-3}{x}}{x \cdot x}\\
\mathbf{elif}\;x \le 11913.338256318099:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{1}{1 + x}, \frac{-\left(1 + x\right)}{x - 1}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{-3}{x} - \frac{1}{x \cdot x}\right) + \frac{\frac{-3}{x}}{x \cdot x}\\
\end{array}double f(double x) {
double r5531424 = x;
double r5531425 = 1.0;
double r5531426 = r5531424 + r5531425;
double r5531427 = r5531424 / r5531426;
double r5531428 = r5531424 - r5531425;
double r5531429 = r5531426 / r5531428;
double r5531430 = r5531427 - r5531429;
return r5531430;
}
double f(double x) {
double r5531431 = x;
double r5531432 = -12354.188123908416;
bool r5531433 = r5531431 <= r5531432;
double r5531434 = -3.0;
double r5531435 = r5531434 / r5531431;
double r5531436 = 1.0;
double r5531437 = r5531431 * r5531431;
double r5531438 = r5531436 / r5531437;
double r5531439 = r5531435 - r5531438;
double r5531440 = r5531435 / r5531437;
double r5531441 = r5531439 + r5531440;
double r5531442 = 11913.338256318099;
bool r5531443 = r5531431 <= r5531442;
double r5531444 = r5531436 + r5531431;
double r5531445 = r5531436 / r5531444;
double r5531446 = -r5531444;
double r5531447 = r5531431 - r5531436;
double r5531448 = r5531446 / r5531447;
double r5531449 = fma(r5531431, r5531445, r5531448);
double r5531450 = r5531443 ? r5531449 : r5531441;
double r5531451 = r5531433 ? r5531441 : r5531450;
return r5531451;
}



Bits error versus x
if x < -12354.188123908416 or 11913.338256318099 < x Initial program 59.2
rmApplied add-log-exp59.2
Applied add-log-exp59.2
Applied diff-log59.2
Simplified59.2
rmApplied div-inv59.4
Applied fma-neg59.4
Taylor expanded around inf 0.3
Simplified0.0
if -12354.188123908416 < x < 11913.338256318099Initial program 0.1
rmApplied div-inv0.1
Applied fma-neg0.1
Final simplification0.1
herbie shell --seed 2019163 +o rules:numerics
(FPCore (x)
:name "Asymptote C"
(- (/ x (+ x 1)) (/ (+ x 1) (- x 1))))