\frac{x}{x + 1} - \frac{x + 1}{x - 1}
\begin{array}{l}
t_0 := \frac{-1}{{x}^{2}} - 3 \cdot \frac{1}{x}\\
t_1 := \frac{x}{x + 1} - \frac{x + 1}{x - 1}\\
\mathbf{if}\;x \leq -422691.3719611488:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 339755.70170894644:\\
\;\;\;\;\frac{{\left(\sqrt[3]{\log \left(e^{t_1}\right)}\right)}^{2}}{\frac{1}{\sqrt[3]{t_1}}}\\
\mathbf{else}:\\
\;\;\;\;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 (pow x 2.0)) (* 3.0 (/ 1.0 x))))
(t_1 (- (/ x (+ x 1.0)) (/ (+ x 1.0) (- x 1.0)))))
(if (<= x -422691.3719611488)
t_0
(if (<= x 339755.70170894644)
(/ (pow (cbrt (log (exp t_1))) 2.0) (/ 1.0 (cbrt t_1)))
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 / pow(x, 2.0)) - (3.0 * (1.0 / x));
double t_1 = (x / (x + 1.0)) - ((x + 1.0) / (x - 1.0));
double tmp;
if (x <= -422691.3719611488) {
tmp = t_0;
} else if (x <= 339755.70170894644) {
tmp = pow(cbrt(log(exp(t_1))), 2.0) / (1.0 / cbrt(t_1));
} else {
tmp = t_0;
}
return tmp;
}



Bits error versus x
Results
if x < -422691.3719611488 or 339755.701708946435 < x Initial program 59.4
Taylor expanded in x around inf 0.4
if -422691.3719611488 < x < 339755.701708946435Initial program 0.1
Applied egg-rr0.2
Applied egg-rr0.2
Applied egg-rr0.2
Applied egg-rr0.2
Final simplification0.3
herbie shell --seed 2022129
(FPCore (x)
:name "Asymptote C"
:precision binary64
(- (/ x (+ x 1.0)) (/ (+ x 1.0) (- x 1.0))))