\frac{a \cdot b - c \cdot d}{a \cdot b}\frac{b - \frac{c \cdot d}{a}}{b}double code(double a, double b, double c, double d) {
return ((double) (((double) (((double) (a * b)) - ((double) (c * d)))) / ((double) (a * b))));
}
double code(double a, double b, double c, double d) {
return ((double) (((double) (b - ((double) (((double) (c * d)) / a)))) / b));
}



Bits error versus a



Bits error versus b



Bits error versus c



Bits error versus d
Results
Initial program 15.3
Simplified6.5
Final simplification6.5
herbie shell --seed 2020153
(FPCore (a b c d)
:name "(/ (- (* a b) (* c d)) (* a b))"
:precision binary64
(/ (- (* a b) (* c d)) (* a b)))