\frac{x}{x + 1} - \frac{x + 1}{x - 1}\begin{array}{l}
\mathbf{if}\;x \le -22594.13715790783:\\
\;\;\;\;\frac{-1}{{x}^{2}} - \mathsf{fma}\left(3, \frac{1}{x}, 3 \cdot \frac{1}{{x}^{3}}\right)\\
\mathbf{elif}\;x \le 49404672.017620057:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{1}, \frac{\sqrt[3]{x}}{x + 1}, -\frac{x + 1}{x - 1}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-3}{x} - \frac{\frac{2}{x}}{x}\\
\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 <= -22594.137157907826)) {
VAR = ((-1.0 / pow(x, 2.0)) - fma(3.0, (1.0 / x), (3.0 * (1.0 / pow(x, 3.0)))));
} else {
double VAR_1;
if ((x <= 49404672.01762006)) {
VAR_1 = fma(((cbrt(x) * cbrt(x)) / 1.0), (cbrt(x) / (x + 1.0)), -((x + 1.0) / (x - 1.0)));
} else {
VAR_1 = ((-3.0 / x) - ((2.0 / x) / x));
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus x
Results
if x < -22594.137157907826Initial program 59.3
Taylor expanded around inf 0.3
Simplified0.3
if -22594.137157907826 < x < 49404672.01762006Initial program 0.2
rmApplied *-un-lft-identity0.2
Applied add-cube-cbrt0.2
Applied times-frac0.2
Applied fma-neg0.2
if 49404672.01762006 < x Initial program 59.8
rmApplied *-un-lft-identity59.8
Applied add-cube-cbrt60.9
Applied times-frac60.8
Applied fma-neg61.0
Taylor expanded around inf 0.6
Simplified0.3
Final simplification0.3
herbie shell --seed 2020105 +o rules:numerics
(FPCore (x)
:name "Asymptote C"
:precision binary64
(- (/ x (+ x 1)) (/ (+ x 1) (- x 1))))