\frac{x}{x + 1} - \frac{x + 1}{x - 1}\begin{array}{l}
\mathbf{if}\;x \le -10429.8349440664733 \lor \neg \left(x \le 11484.316894500327\right):\\
\;\;\;\;\left(-\left(\frac{1}{{x}^{2}} + \frac{3}{x}\right)\right) - 3 \cdot \frac{1}{{x}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{x + 1}\right)\right) - \frac{x + 1}{x - 1}\\
\end{array}double f(double x) {
double r128209 = x;
double r128210 = 1.0;
double r128211 = r128209 + r128210;
double r128212 = r128209 / r128211;
double r128213 = r128209 - r128210;
double r128214 = r128211 / r128213;
double r128215 = r128212 - r128214;
return r128215;
}
double f(double x) {
double r128216 = x;
double r128217 = -10429.834944066473;
bool r128218 = r128216 <= r128217;
double r128219 = 11484.316894500327;
bool r128220 = r128216 <= r128219;
double r128221 = !r128220;
bool r128222 = r128218 || r128221;
double r128223 = 1.0;
double r128224 = 2.0;
double r128225 = pow(r128216, r128224);
double r128226 = r128223 / r128225;
double r128227 = 3.0;
double r128228 = r128227 / r128216;
double r128229 = r128226 + r128228;
double r128230 = -r128229;
double r128231 = 1.0;
double r128232 = 3.0;
double r128233 = pow(r128216, r128232);
double r128234 = r128231 / r128233;
double r128235 = r128227 * r128234;
double r128236 = r128230 - r128235;
double r128237 = r128216 + r128223;
double r128238 = r128216 / r128237;
double r128239 = log1p(r128238);
double r128240 = expm1(r128239);
double r128241 = r128216 - r128223;
double r128242 = r128237 / r128241;
double r128243 = r128240 - r128242;
double r128244 = r128222 ? r128236 : r128243;
return r128244;
}



Bits error versus x
Results
if x < -10429.834944066473 or 11484.316894500327 < x Initial program 59.2
Taylor expanded around inf 0.3
Simplified0.3
rmApplied fma-udef0.3
Applied associate--r+0.3
Simplified0.0
if -10429.834944066473 < x < 11484.316894500327Initial program 0.1
rmApplied expm1-log1p-u0.2
Final simplification0.1
herbie shell --seed 2020024 +o rules:numerics
(FPCore (x)
:name "Asymptote C"
:precision binary64
(- (/ x (+ x 1)) (/ (+ x 1) (- x 1))))