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



Bits error versus x
if x < -13109.304414431299Initial program 58.8
Taylor expanded in x around inf 0.3
Simplified0.1
if -13109.304414431299 < x < 2044.99510330938915Initial program 0.1
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
if 2044.99510330938915 < x Initial program 59.1
Taylor expanded in x around inf 0.3
Simplified0.0
Applied pow-flip_binary640.0
Simplified0.0
Final simplification0.1
herbie shell --seed 2021329
(FPCore (x)
:name "Asymptote C"
:precision binary64
(- (/ x (+ x 1.0)) (/ (+ x 1.0) (- x 1.0))))