\frac{x}{x + 1} - \frac{x + 1}{x - 1}\begin{array}{l}
\mathbf{if}\;x \le -12739.391686969833 \lor \neg \left(x \le 9138.442026599892\right):\\
\;\;\;\;\frac{-1}{{x}^{2}} - \mathsf{fma}\left(3, \frac{1}{x}, 3 \cdot \frac{1}{{x}^{3}}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{x \cdot x - 1 \cdot 1}, x - 1, -\left(x + 1\right) \cdot \frac{x + 1}{x \cdot x - 1 \cdot 1}\right) + \frac{x + 1}{x \cdot x - 1 \cdot 1} \cdot \left(\left(-\left(x + 1\right)\right) + \left(x + 1\right)\right)\\
\end{array}double code(double x) {
return ((x / (x + 1.0)) - ((x + 1.0) / (x - 1.0)));
}
double code(double x) {
double VAR;
if (((x <= -12739.391686969833) || !(x <= 9138.442026599892))) {
VAR = ((-1.0 / pow(x, 2.0)) - fma(3.0, (1.0 / x), (3.0 * (1.0 / pow(x, 3.0)))));
} else {
VAR = (fma((x / ((x * x) - (1.0 * 1.0))), (x - 1.0), -((x + 1.0) * ((x + 1.0) / ((x * x) - (1.0 * 1.0))))) + (((x + 1.0) / ((x * x) - (1.0 * 1.0))) * (-(x + 1.0) + (x + 1.0))));
}
return VAR;
}



Bits error versus x
Results
if x < -12739.391686969833 or 9138.442026599892 < x Initial program 59.1
Taylor expanded around inf 0.3
Simplified0.3
if -12739.391686969833 < x < 9138.442026599892Initial program 0.1
rmApplied flip--0.1
Applied associate-/r/0.1
Applied flip-+0.1
Applied associate-/r/0.1
Applied prod-diff0.1
Simplified0.1
Final simplification0.2
herbie shell --seed 2020078 +o rules:numerics
(FPCore (x)
:name "Asymptote C"
:precision binary64
(- (/ x (+ x 1)) (/ (+ x 1) (- x 1))))