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



Bits error versus x
Results
if x < -12471.666509296416 or 20005.70299342879 < x Initial program 59.2
Taylor expanded around inf 0.3
Simplified0.0
if -12471.666509296416 < x < 20005.70299342879Initial program 0.1
rmApplied flip3--0.1
Simplified0.1
rmApplied add-cbrt-cube0.1
Applied add-cbrt-cube0.1
Applied cbrt-undiv0.1
Applied rem-cube-cbrt0.1
Final simplification0.1
herbie shell --seed 2020057
(FPCore (x)
:name "Asymptote C"
:precision binary64
(- (/ x (+ x 1)) (/ (+ x 1) (- x 1))))