\frac{x}{x + 1} - \frac{x + 1}{x - 1}
\begin{array}{l}
\mathbf{if}\;x \leq -13732.497392152165 \lor \neg \left(x \leq 10353.987916472028\right):\\
\;\;\;\;\left(\frac{-3}{x} - \left(\frac{1}{x \cdot x} + \frac{3}{{x}^{3}}\right)\right) - \frac{1}{{x}^{4}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, -3, -1\right)}{\mathsf{fma}\left(x, x, -1\right)}\\
\end{array}
(FPCore (x) :precision binary64 (- (/ x (+ x 1.0)) (/ (+ x 1.0) (- x 1.0))))
(FPCore (x)
:precision binary64
(if (or (<= x -13732.497392152165) (not (<= x 10353.987916472028)))
(-
(- (/ -3.0 x) (+ (/ 1.0 (* x x)) (/ 3.0 (pow x 3.0))))
(/ 1.0 (pow x 4.0)))
(/ (fma x -3.0 -1.0) (fma x x -1.0))))double code(double x) {
return (x / (x + 1.0)) - ((x + 1.0) / (x - 1.0));
}
double code(double x) {
double tmp;
if ((x <= -13732.497392152165) || !(x <= 10353.987916472028)) {
tmp = ((-3.0 / x) - ((1.0 / (x * x)) + (3.0 / pow(x, 3.0)))) - (1.0 / pow(x, 4.0));
} else {
tmp = fma(x, -3.0, -1.0) / fma(x, x, -1.0);
}
return tmp;
}



Bits error versus x
if x < -13732.497392152165 or 10353.9879164720278 < x Initial program 59.4
Taylor expanded in x around inf 0.3
Simplified0.0
if -13732.497392152165 < x < 10353.9879164720278Initial program 0.1
Applied frac-sub_binary640.1
Simplified0.1
Simplified0.1
Taylor expanded in x around 0 0.0
Simplified0.0
Applied pow1_binary640.0
Final simplification0.0
herbie shell --seed 2021275
(FPCore (x)
:name "Asymptote C"
:precision binary64
(- (/ x (+ x 1.0)) (/ (+ x 1.0) (- x 1.0))))