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



Bits error versus x



Bits error versus y
Results
Initial program 0.1
rmApplied flip--5.5
Applied associate-*r/8.3
rmApplied difference-of-squares8.3
Applied associate-*r*7.5
Applied associate-/l*0.1
Final simplification0.1
herbie shell --seed 2020078
(FPCore (x y)
:name "Numeric.SpecFunctions:log1p from math-functions-0.1.5.2, A"
:precision binary64
(* x (- 1 (* x y))))