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



Bits error versus x
Results
Initial program 29.0
rmApplied frac-sub30.1
Simplified30.1
Taylor expanded around 0 14.9
rmApplied distribute-frac-neg14.9
Simplified0.2
Final simplification0.2
herbie shell --seed 2020100 +o rules:numerics
(FPCore (x)
:name "Asymptote C"
:precision binary64
(- (/ x (+ x 1)) (/ (+ x 1) (- x 1))))