\frac{x}{x + 1} - \frac{x + 1}{x - 1}\begin{array}{l}
\mathbf{if}\;x \le -24317693746.994724:\\
\;\;\;\;\frac{\frac{2}{x} - \left(\frac{\frac{2}{x}}{x} + 3\right)}{x - 1}\\
\mathbf{elif}\;x \le 470629.2046973975:\\
\;\;\;\;\frac{\left(x - 1\right) \cdot \frac{x \cdot -3 + -1}{x \cdot x - 1}}{x - 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{x} - \left(\frac{\frac{2}{x}}{x} + 3\right)}{x - 1}\\
\end{array}double f(double x) {
double r18556270 = x;
double r18556271 = 1.0;
double r18556272 = r18556270 + r18556271;
double r18556273 = r18556270 / r18556272;
double r18556274 = r18556270 - r18556271;
double r18556275 = r18556272 / r18556274;
double r18556276 = r18556273 - r18556275;
return r18556276;
}
double f(double x) {
double r18556277 = x;
double r18556278 = -24317693746.994724;
bool r18556279 = r18556277 <= r18556278;
double r18556280 = 2.0;
double r18556281 = r18556280 / r18556277;
double r18556282 = r18556281 / r18556277;
double r18556283 = 3.0;
double r18556284 = r18556282 + r18556283;
double r18556285 = r18556281 - r18556284;
double r18556286 = 1.0;
double r18556287 = r18556277 - r18556286;
double r18556288 = r18556285 / r18556287;
double r18556289 = 470629.2046973975;
bool r18556290 = r18556277 <= r18556289;
double r18556291 = -3.0;
double r18556292 = r18556277 * r18556291;
double r18556293 = -1.0;
double r18556294 = r18556292 + r18556293;
double r18556295 = r18556277 * r18556277;
double r18556296 = r18556295 - r18556286;
double r18556297 = r18556294 / r18556296;
double r18556298 = r18556287 * r18556297;
double r18556299 = r18556298 / r18556287;
double r18556300 = r18556290 ? r18556299 : r18556288;
double r18556301 = r18556279 ? r18556288 : r18556300;
return r18556301;
}



Bits error versus x
Results
if x < -24317693746.994724 or 470629.2046973975 < x Initial program 59.8
rmApplied frac-sub61.6
Taylor expanded around -inf 30.9
Simplified30.9
rmApplied associate-/r*0.4
Taylor expanded around inf 0.0
Simplified0.0
if -24317693746.994724 < x < 470629.2046973975Initial program 0.3
rmApplied frac-sub0.3
Taylor expanded around -inf 0.0
Simplified0.0
rmApplied associate-/r*0.0
rmApplied flip-+0.0
Applied associate-/r/0.0
Final simplification0.0
herbie shell --seed 2019104
(FPCore (x)
:name "Asymptote C"
(- (/ x (+ x 1)) (/ (+ x 1) (- x 1))))