\frac{x}{x + 1} - \frac{x + 1}{x - 1}
\begin{array}{l}
\mathbf{if}\;x \leq -1951.0124275398869 \lor \neg \left(x \leq 2044.9951033093892\right):\\
\;\;\;\;\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 + 1}{x + -1}\\
t_1 := \sqrt[3]{t_0}\\
t_2 := t_1 \cdot t_1\\
\sqrt[3]{{\left(\frac{x}{x + 1} - t_0\right)}^{3}} + \mathsf{fma}\left(-t_1, t_2, t_1 \cdot t_2\right)
\end{array}\\
\end{array}
(FPCore (x) :precision binary64 (- (/ x (+ x 1.0)) (/ (+ x 1.0) (- x 1.0))))
(FPCore (x)
:precision binary64
(if (or (<= x -1951.0124275398869) (not (<= x 2044.9951033093892)))
(-
(- (/ -3.0 x) (+ (/ 1.0 (* x x)) (/ 3.0 (pow x 3.0))))
(/ 1.0 (pow x 4.0)))
(let* ((t_0 (/ (+ x 1.0) (+ x -1.0))) (t_1 (cbrt t_0)) (t_2 (* t_1 t_1)))
(+
(cbrt (pow (- (/ x (+ x 1.0)) t_0) 3.0))
(fma (- t_1) t_2 (* t_1 t_2))))))double code(double x) {
return (x / (x + 1.0)) - ((x + 1.0) / (x - 1.0));
}
double code(double x) {
double tmp;
if ((x <= -1951.0124275398869) || !(x <= 2044.9951033093892)) {
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 + 1.0) / (x + -1.0);
double t_1 = cbrt(t_0);
double t_2 = t_1 * t_1;
tmp = cbrt(pow(((x / (x + 1.0)) - t_0), 3.0)) + fma(-t_1, t_2, (t_1 * t_2));
}
return tmp;
}



Bits error versus x
if x < -1951.01242753988686 or 2044.99510330938915 < x Initial program 58.8
Taylor expanded in x around inf 0.3
Simplified0.0
if -1951.01242753988686 < x < 2044.99510330938915Initial program 0.0
Applied add-cube-cbrt_binary640.1
Applied *-un-lft-identity_binary640.1
Applied prod-diff_binary640.1
Applied add-cbrt-cube_binary640.1
Simplified0.1
Final simplification0.0
herbie shell --seed 2021329
(FPCore (x)
:name "Asymptote C"
:precision binary64
(- (/ x (+ x 1.0)) (/ (+ x 1.0) (- x 1.0))))