\frac{x}{x + 1} - \frac{x + 1}{x - 1}\frac{-\left(-\left(3 + 1 \cdot \frac{1}{x}\right)\right)}{1 \cdot \frac{1}{x} - x}double code(double x) {
return ((x / (x + 1.0)) - ((x + 1.0) / (x - 1.0)));
}
double code(double x) {
return (--(3.0 + (1.0 * (1.0 / x))) / ((1.0 * (1.0 / x)) - x));
}



Bits error versus x
Results
Initial program 28.8
rmApplied frac-2neg28.8
Applied clear-num28.8
Applied frac-sub28.6
Simplified28.6
Taylor expanded around inf 0.1
Taylor expanded around 0 0.0
Final simplification0.0
herbie shell --seed 2020066 +o rules:numerics
(FPCore (x)
:name "Asymptote C"
:precision binary64
(- (/ x (+ x 1)) (/ (+ x 1) (- x 1))))