\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;b1 \cdot b2 \le -1.1847928602155 \cdot 10^{222} \lor \neg \left(b1 \cdot b2 \le -2.65012901835582308 \cdot 10^{-171} \lor \neg \left(b1 \cdot b2 \le 1.9618991491095908 \cdot 10^{-204} \lor \neg \left(b1 \cdot b2 \le 4.8487651961466998 \cdot 10^{178}\right)\right)\right):\\
\;\;\;\;\left(\frac{a1}{b1} \cdot a2\right) \cdot \frac{1}{b2}\\
\mathbf{else}:\\
\;\;\;\;\frac{a1}{\frac{b1 \cdot b2}{a2}}\\
\end{array}double code(double a1, double a2, double b1, double b2) {
return ((double) (((double) (a1 * a2)) / ((double) (b1 * b2))));
}
double code(double a1, double a2, double b1, double b2) {
double VAR;
if (((((double) (b1 * b2)) <= -1.1847928602155e+222) || !((((double) (b1 * b2)) <= -2.650129018355823e-171) || !((((double) (b1 * b2)) <= 1.9618991491095908e-204) || !(((double) (b1 * b2)) <= 4.8487651961467e+178))))) {
VAR = ((double) (((double) (((double) (a1 / b1)) * a2)) * ((double) (1.0 / b2))));
} else {
VAR = ((double) (a1 / ((double) (((double) (b1 * b2)) / a2))));
}
return VAR;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.7 |
|---|---|
| Target | 11.0 |
| Herbie | 5.3 |
if (* b1 b2) < -1.1847928602155e222 or -2.65012901835582308e-171 < (* b1 b2) < 1.9618991491095908e-204 or 4.8487651961466998e178 < (* b1 b2) Initial program 21.3
rmApplied times-frac6.3
rmApplied div-inv6.3
Applied associate-*r*6.3
if -1.1847928602155e222 < (* b1 b2) < -2.65012901835582308e-171 or 1.9618991491095908e-204 < (* b1 b2) < 4.8487651961466998e178Initial program 4.4
rmApplied associate-/l*4.4
Final simplification5.3
herbie shell --seed 2020162
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))