\frac{x}{x + 1} - \frac{x + 1}{x - 1}
\begin{array}{l}
\mathbf{if}\;x \leq -15104.003133029944:\\
\;\;\;\;\left(\frac{-3}{x} - \left(\frac{1}{x \cdot x} + \frac{3}{{x}^{3}}\right)\right) - \frac{1}{{x}^{4}}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_0 := \frac{x}{x + 1} + \frac{x + 1}{x + -1}\\
\mathbf{if}\;x \leq 3580589034911187:\\
\;\;\;\;\frac{\frac{-1 - \left(5 \cdot {x}^{2} + \left(x \cdot 4 + {x}^{3} \cdot 6\right)\right)}{\mathsf{fma}\left(x, x, -1\right) \cdot \mathsf{fma}\left(x, x, -1\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-6}{x}}{t_0}\\
\end{array}\\
\end{array}
(FPCore (x) :precision binary64 (- (/ x (+ x 1.0)) (/ (+ x 1.0) (- x 1.0))))
(FPCore (x)
:precision binary64
(if (<= x -15104.003133029944)
(-
(- (/ -3.0 x) (+ (/ 1.0 (* x x)) (/ 3.0 (pow x 3.0))))
(/ 1.0 (pow x 4.0)))
(let* ((t_0 (+ (/ x (+ x 1.0)) (/ (+ x 1.0) (+ x -1.0)))))
(if (<= x 3580589034911187.0)
(/
(/
(- -1.0 (+ (* 5.0 (pow x 2.0)) (+ (* x 4.0) (* (pow x 3.0) 6.0))))
(* (fma x x -1.0) (fma x x -1.0)))
t_0)
(/ (/ -6.0 x) t_0)))))double code(double x) {
return (x / (x + 1.0)) - ((x + 1.0) / (x - 1.0));
}
double code(double x) {
double tmp;
if (x <= -15104.003133029944) {
tmp = ((-3.0 / x) - ((1.0 / (x * x)) + (3.0 / pow(x, 3.0)))) - (1.0 / pow(x, 4.0));
} else {
double t_0 = (x / (x + 1.0)) + ((x + 1.0) / (x + -1.0));
double tmp_1;
if (x <= 3580589034911187.0) {
tmp_1 = ((-1.0 - ((5.0 * pow(x, 2.0)) + ((x * 4.0) + (pow(x, 3.0) * 6.0)))) / (fma(x, x, -1.0) * fma(x, x, -1.0))) / t_0;
} else {
tmp_1 = (-6.0 / x) / t_0;
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus x
if x < -15104.0031330299444Initial program 59.4
Taylor expanded in x around inf 0.3
Simplified0.0
if -15104.0031330299444 < x < 3580589034911187Initial program 0.6
Applied flip--_binary640.6
Applied frac-times_binary640.6
Applied frac-times_binary640.6
Applied frac-sub_binary640.6
Simplified0.6
Simplified0.6
Taylor expanded in x around 0 0.1
if 3580589034911187 < x Initial program 60.5
Applied flip--_binary6460.5
Taylor expanded in x around inf 0
Final simplification0.0
herbie shell --seed 2021225
(FPCore (x)
:name "Asymptote C"
:precision binary64
(- (/ x (+ x 1.0)) (/ (+ x 1.0) (- x 1.0))))