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



Bits error versus x
if x < -13732.497392152165Initial program 59.2
Taylor expanded in x around inf 0.3
Simplified0.0
if -13732.497392152165 < x < 22131881926.8285561Initial program 0.2
Applied frac-sub_binary640.2
Simplified0.2
Simplified0.2
Taylor expanded in x around 0 0.0
Simplified0.0
Applied fma-udef_binary640.0
if 22131881926.8285561 < x Initial program 60.3
Taylor expanded in x around inf 0.3
Simplified0.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))))