\frac{x}{x + 1} - \frac{x + 1}{x - 1}\begin{array}{l}
\mathbf{if}\;x \le -10426.9285871911725 \lor \neg \left(x \le 9614.2427998710336\right):\\
\;\;\;\;-\left(1 \cdot \frac{1}{{x}^{2}} + \left(3 \cdot \frac{1}{x} + 3 \cdot \frac{1}{{x}^{3}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{x + 1}\right)\right) - \log \left(e^{\frac{x + 1}{x - 1}}\right)\\
\end{array}double f(double x) {
double r136358 = x;
double r136359 = 1.0;
double r136360 = r136358 + r136359;
double r136361 = r136358 / r136360;
double r136362 = r136358 - r136359;
double r136363 = r136360 / r136362;
double r136364 = r136361 - r136363;
return r136364;
}
double f(double x) {
double r136365 = x;
double r136366 = -10426.928587191172;
bool r136367 = r136365 <= r136366;
double r136368 = 9614.242799871034;
bool r136369 = r136365 <= r136368;
double r136370 = !r136369;
bool r136371 = r136367 || r136370;
double r136372 = 1.0;
double r136373 = 1.0;
double r136374 = 2.0;
double r136375 = pow(r136365, r136374);
double r136376 = r136373 / r136375;
double r136377 = r136372 * r136376;
double r136378 = 3.0;
double r136379 = r136373 / r136365;
double r136380 = r136378 * r136379;
double r136381 = 3.0;
double r136382 = pow(r136365, r136381);
double r136383 = r136373 / r136382;
double r136384 = r136378 * r136383;
double r136385 = r136380 + r136384;
double r136386 = r136377 + r136385;
double r136387 = -r136386;
double r136388 = r136365 + r136372;
double r136389 = r136365 / r136388;
double r136390 = log1p(r136389);
double r136391 = expm1(r136390);
double r136392 = r136365 - r136372;
double r136393 = r136388 / r136392;
double r136394 = exp(r136393);
double r136395 = log(r136394);
double r136396 = r136391 - r136395;
double r136397 = r136371 ? r136387 : r136396;
return r136397;
}



Bits error versus x
Results
if x < -10426.928587191172 or 9614.242799871034 < x Initial program 59.3
rmApplied flip--59.3
Taylor expanded around inf 0.3
if -10426.928587191172 < x < 9614.242799871034Initial program 0.1
rmApplied add-log-exp0.1
rmApplied expm1-log1p-u0.1
Final simplification0.2
herbie shell --seed 2020065 +o rules:numerics
(FPCore (x)
:name "Asymptote C"
:precision binary64
(- (/ x (+ x 1)) (/ (+ x 1) (- x 1))))