\frac{x}{x + 1} - \frac{x + 1}{x - 1}\begin{array}{l}
\mathbf{if}\;\frac{x}{x + 1} - \frac{x + 1}{x - 1} \le 4.962696920074449735693633556365966796875 \cdot 10^{-13}:\\
\;\;\;\;-\left(\left(\frac{1}{x \cdot x} + \frac{3}{x}\right) + \frac{3}{{x}^{3}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1} - \frac{x + 1}{x - 1}\\
\end{array}double f(double x) {
double r94763 = x;
double r94764 = 1.0;
double r94765 = r94763 + r94764;
double r94766 = r94763 / r94765;
double r94767 = r94763 - r94764;
double r94768 = r94765 / r94767;
double r94769 = r94766 - r94768;
return r94769;
}
double f(double x) {
double r94770 = x;
double r94771 = 1.0;
double r94772 = r94770 + r94771;
double r94773 = r94770 / r94772;
double r94774 = r94770 - r94771;
double r94775 = r94772 / r94774;
double r94776 = r94773 - r94775;
double r94777 = 4.96269692007445e-13;
bool r94778 = r94776 <= r94777;
double r94779 = r94770 * r94770;
double r94780 = r94771 / r94779;
double r94781 = 3.0;
double r94782 = r94781 / r94770;
double r94783 = r94780 + r94782;
double r94784 = 3.0;
double r94785 = pow(r94770, r94784);
double r94786 = r94781 / r94785;
double r94787 = r94783 + r94786;
double r94788 = -r94787;
double r94789 = r94778 ? r94788 : r94776;
return r94789;
}



Bits error versus x
Results
if (- (/ x (+ x 1.0)) (/ (+ x 1.0) (- x 1.0))) < 4.96269692007445e-13Initial program 59.4
Taylor expanded around inf 0.6
Simplified0.3
if 4.96269692007445e-13 < (- (/ x (+ x 1.0)) (/ (+ x 1.0) (- x 1.0))) Initial program 0.3
rmApplied add-log-exp0.3
Applied add-log-exp0.3
Applied diff-log0.3
Simplified0.3
rmApplied exp-diff0.3
Applied log-div0.3
Simplified0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2019323 +o rules:numerics
(FPCore (x)
:name "Asymptote C"
:precision binary64
(- (/ x (+ x 1)) (/ (+ x 1) (- x 1))))