\frac{x}{x + 1} - \frac{x + 1}{x - 1}
\begin{array}{l}
\mathbf{if}\;x \leq -452149.06294381135 \lor \neg \left(x \leq 387887.6914731773\right):\\
\;\;\;\;\frac{-3 + \frac{-1}{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{-1}{-1 - x}, \frac{-1 - 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 -452149.06294381135) (not (<= x 387887.6914731773))) (/ (+ -3.0 (/ -1.0 x)) x) (fma x (/ -1.0 (- -1.0 x)) (/ (- -1.0 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 <= -452149.06294381135) || !(x <= 387887.6914731773)) {
tmp = (-3.0 + (-1.0 / x)) / x;
} else {
tmp = fma(x, (-1.0 / (-1.0 - x)), ((-1.0 - x) / (x + -1.0)));
}
return tmp;
}



Bits error versus x
if x < -452149.062943811354 or 387887.69147317728 < x Initial program 59.5
Taylor expanded in x around inf 0.4
Simplified0.1
Taylor expanded in x around 0 0.4
Simplified0.1
if -452149.062943811354 < x < 387887.69147317728Initial program 0.1
Applied div-inv_binary640.1
Applied fma-neg_binary640.1
Simplified0.1
Applied frac-2neg_binary640.1
Simplified0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2021280
(FPCore (x)
:name "Asymptote C"
:precision binary64
(- (/ x (+ x 1.0)) (/ (+ x 1.0) (- x 1.0))))