\frac{x}{x + 1} - \frac{x + 1}{x - 1}\begin{array}{l}
\mathbf{if}\;x \le -12435.32938867169286822900176048278808594 \lor \neg \left(x \le 11573.99856257406463555525988340377807617\right):\\
\;\;\;\;\frac{-1}{x} \cdot \left(3 + \frac{1}{x}\right) - \frac{3}{{x}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\log \left(e^{\frac{x}{x + 1} - \frac{x + 1}{x - 1}}\right)\\
\end{array}double f(double x) {
double r122536 = x;
double r122537 = 1.0;
double r122538 = r122536 + r122537;
double r122539 = r122536 / r122538;
double r122540 = r122536 - r122537;
double r122541 = r122538 / r122540;
double r122542 = r122539 - r122541;
return r122542;
}
double f(double x) {
double r122543 = x;
double r122544 = -12435.329388671693;
bool r122545 = r122543 <= r122544;
double r122546 = 11573.998562574065;
bool r122547 = r122543 <= r122546;
double r122548 = !r122547;
bool r122549 = r122545 || r122548;
double r122550 = -1.0;
double r122551 = r122550 / r122543;
double r122552 = 3.0;
double r122553 = 1.0;
double r122554 = r122553 / r122543;
double r122555 = r122552 + r122554;
double r122556 = r122551 * r122555;
double r122557 = 3.0;
double r122558 = pow(r122543, r122557);
double r122559 = r122552 / r122558;
double r122560 = r122556 - r122559;
double r122561 = r122543 + r122553;
double r122562 = r122543 / r122561;
double r122563 = r122543 - r122553;
double r122564 = r122561 / r122563;
double r122565 = r122562 - r122564;
double r122566 = exp(r122565);
double r122567 = log(r122566);
double r122568 = r122549 ? r122560 : r122567;
return r122568;
}



Bits error versus x
Results
if x < -12435.329388671693 or 11573.998562574065 < x Initial program 59.3
rmApplied add-log-exp59.3
Applied add-log-exp59.3
Applied diff-log59.3
Simplified59.3
Taylor expanded around inf 0.3
Simplified0.3
if -12435.329388671693 < x < 11573.998562574065Initial program 0.1
rmApplied add-log-exp0.1
Applied add-log-exp0.1
Applied diff-log0.1
Simplified0.1
Final simplification0.2
herbie shell --seed 2019304
(FPCore (x)
:name "Asymptote C"
:precision binary64
(- (/ x (+ x 1)) (/ (+ x 1) (- x 1))))