\frac{x}{x + 1} - \frac{x + 1}{x - 1}
\begin{array}{l}
\mathbf{if}\;x \leq -2.005334843764889 \cdot 10^{+24} \lor \neg \left(x \leq 13365099.257334935\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{x \cdot x}, -1 - \frac{3}{x}, \frac{-3}{x}\right) + \frac{-1}{{x}^{4}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 - x \cdot 3}{\left(x + 1\right) \cdot \left(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 -2.005334843764889e+24) (not (<= x 13365099.257334935))) (+ (fma (/ 1.0 (* x x)) (- -1.0 (/ 3.0 x)) (/ -3.0 x)) (/ -1.0 (pow x 4.0))) (/ (- -1.0 (* x 3.0)) (* (+ x 1.0) (+ 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 <= -2.005334843764889e+24) || !(x <= 13365099.257334935)) {
tmp = fma((1.0 / (x * x)), (-1.0 - (3.0 / x)), (-3.0 / x)) + (-1.0 / pow(x, 4.0));
} else {
tmp = (-1.0 - (x * 3.0)) / ((x + 1.0) * (x + -1.0));
}
return tmp;
}



Bits error versus x
if x < -2.00533484376488896e24 or 13365099.2573349345 < x Initial program 60.1
Applied add-sqr-sqrt_binary6460.5
Taylor expanded in x around inf 0.3
Simplified0.0
if -2.00533484376488896e24 < x < 13365099.2573349345Initial program 1.2
Applied add-sqr-sqrt_binary641.8
Applied frac-sub_binary641.7
Applied sqrt-div_binary6463.2
Applied frac-sub_binary6463.2
Applied sqrt-div_binary6463.2
Applied frac-times_binary6463.2
Simplified62.1
Simplified0.6
Taylor expanded in x around 0 0.0
Final simplification0.0
herbie shell --seed 2022068
(FPCore (x)
:name "Asymptote C"
:precision binary64
(- (/ x (+ x 1.0)) (/ (+ x 1.0) (- x 1.0))))