\left(x \cdot y + \left(x \cdot y\right) \cdot a\right) + \left(x \cdot y + \left(x \cdot y\right) \cdot a\right) \cdot b
\begin{array}{l}
\mathbf{if}\;y \le 4.799146880334546 \cdot 10^{-107}:\\
\;\;\;\;\left(b + 1\right) \cdot \left(x \cdot \left(y \cdot a + y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + \left(x \cdot y\right) \cdot a\right) + \left(x \cdot y + \left(x \cdot y\right) \cdot a\right) \cdot b\\
\end{array}double code(double x, double y, double a, double b) {
return ((double) (((double) (((double) (x * y)) + ((double) (((double) (x * y)) * a)))) + ((double) (((double) (((double) (x * y)) + ((double) (((double) (x * y)) * a)))) * b))));
}
double code(double x, double y, double a, double b) {
double VAR;
if ((y <= 4.7991468803345464e-107)) {
VAR = ((double) (((double) (b + 1.0)) * ((double) (x * ((double) (((double) (y * a)) + y))))));
} else {
VAR = ((double) (((double) (((double) (x * y)) + ((double) (((double) (x * y)) * a)))) + ((double) (((double) (((double) (x * y)) + ((double) (((double) (x * y)) * a)))) * b))));
}
return VAR;
}



Bits error versus x



Bits error versus y



Bits error versus a



Bits error versus b
Results
if y < 4.799146880334546e-107Initial program 7.5
Simplified5.0
if 4.799146880334546e-107 < y Initial program 1.2
Final simplification3.9
herbie shell --seed 2020153
(FPCore (x y a b)
:name "(+ (+ (* x y) (* (* x y) a)) (* (+ (* x y) (* (* x y) a)) b))"
:precision binary64
(+ (+ (* x y) (* (* x y) a)) (* (+ (* x y) (* (* x y) a)) b)))