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



Bits error versus x
Results
Initial program 29.4
rmApplied clear-num29.4
Applied frac-sub29.1
Simplified29.1
Taylor expanded around 0 0.0
Simplified0.0
rmApplied clear-num0.0
Final simplification0.0
herbie shell --seed 2020078
(FPCore (x)
:name "Asymptote C"
:precision binary64
(- (/ x (+ x 1)) (/ (+ x 1) (- x 1))))