\frac{x}{x + 1} - \frac{x + 1}{x - 1}\begin{array}{l}
\mathbf{if}\;x \le -13498.121057699798:\\
\;\;\;\;\mathsf{fma}\left(\frac{-3}{x}, \frac{1}{x \cdot x}, \frac{-3}{x} - \frac{1}{x \cdot x}\right)\\
\mathbf{elif}\;x \le 11033.995023478727:\\
\;\;\;\;\log \left(e^{\mathsf{fma}\left(x, \frac{1}{1 + x}, -\frac{1 + x}{x - 1}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-3}{x}, \frac{1}{x \cdot x}, \frac{-3}{x} - \frac{1}{x \cdot x}\right)\\
\end{array}double f(double x) {
double r5710158 = x;
double r5710159 = 1.0;
double r5710160 = r5710158 + r5710159;
double r5710161 = r5710158 / r5710160;
double r5710162 = r5710158 - r5710159;
double r5710163 = r5710160 / r5710162;
double r5710164 = r5710161 - r5710163;
return r5710164;
}
double f(double x) {
double r5710165 = x;
double r5710166 = -13498.121057699798;
bool r5710167 = r5710165 <= r5710166;
double r5710168 = -3.0;
double r5710169 = r5710168 / r5710165;
double r5710170 = 1.0;
double r5710171 = r5710165 * r5710165;
double r5710172 = r5710170 / r5710171;
double r5710173 = r5710169 - r5710172;
double r5710174 = fma(r5710169, r5710172, r5710173);
double r5710175 = 11033.995023478727;
bool r5710176 = r5710165 <= r5710175;
double r5710177 = r5710170 + r5710165;
double r5710178 = r5710170 / r5710177;
double r5710179 = r5710165 - r5710170;
double r5710180 = r5710177 / r5710179;
double r5710181 = -r5710180;
double r5710182 = fma(r5710165, r5710178, r5710181);
double r5710183 = exp(r5710182);
double r5710184 = log(r5710183);
double r5710185 = r5710176 ? r5710184 : r5710174;
double r5710186 = r5710167 ? r5710174 : r5710185;
return r5710186;
}



Bits error versus x
if x < -13498.121057699798 or 11033.995023478727 < x Initial program 59.2
rmApplied add-log-exp59.2
Applied add-log-exp59.2
Applied diff-log59.2
Simplified59.2
rmApplied div-inv59.4
Applied fma-neg59.4
Taylor expanded around inf 0.3
Simplified0.0
if -13498.121057699798 < x < 11033.995023478727Initial program 0.1
rmApplied add-log-exp0.1
Applied add-log-exp0.1
Applied diff-log0.1
Simplified0.1
rmApplied div-inv0.1
Applied fma-neg0.1
Final simplification0.1
herbie shell --seed 2019163 +o rules:numerics
(FPCore (x)
:name "Asymptote C"
(- (/ x (+ x 1)) (/ (+ x 1) (- x 1))))