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



Bits error versus x
Results
if x < -10352.276504892699 or 11950.400014151677 < x Initial program 59.4
Taylor expanded around inf 0.3
Simplified0.0
if -10352.276504892699 < x < 11950.400014151677Initial program 0.1
rmApplied flip3--_binary64_14460.1
Applied associate-/r/_binary64_13880.1
Applied cancel-sign-sub-inv_binary64_14080.1
Simplified0.1
rmApplied distribute-rgt-in_binary64_13920.1
Applied associate-+r+_binary64_13740.1
Simplified0.1
rmApplied associate-*r/_binary64_13840.1
Applied flip-+_binary64_14160.1
Applied associate-*r/_binary64_13840.1
Applied frac-add_binary64_14500.1
Applied frac-add_binary64_14500.1
Simplified0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020355
(FPCore (x)
:name "Asymptote C"
:precision binary64
(- (/ x (+ x 1.0)) (/ (+ x 1.0) (- x 1.0))))