\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} = -\infty:\\
\;\;\;\;\frac{1}{\frac{\frac{b1 \cdot b2}{a2}}{a1}}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le -9.782499787656681574696062098790783172828 \cdot 10^{-322}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le 1.421277284710987870204738960879832034274 \cdot 10^{-315}:\\
\;\;\;\;\frac{\frac{a1}{b2}}{b1} \cdot a2\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le 2.286175403506427577716209346328092058444 \cdot 10^{301}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{else}:\\
\;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\
\end{array}double f(double a1, double a2, double b1, double b2) {
double r56416 = a1;
double r56417 = a2;
double r56418 = r56416 * r56417;
double r56419 = b1;
double r56420 = b2;
double r56421 = r56419 * r56420;
double r56422 = r56418 / r56421;
return r56422;
}
double f(double a1, double a2, double b1, double b2) {
double r56423 = a1;
double r56424 = a2;
double r56425 = r56423 * r56424;
double r56426 = b1;
double r56427 = b2;
double r56428 = r56426 * r56427;
double r56429 = r56425 / r56428;
double r56430 = -inf.0;
bool r56431 = r56429 <= r56430;
double r56432 = 1.0;
double r56433 = r56428 / r56424;
double r56434 = r56433 / r56423;
double r56435 = r56432 / r56434;
double r56436 = -9.7824997876567e-322;
bool r56437 = r56429 <= r56436;
double r56438 = 1.421277284711e-315;
bool r56439 = r56429 <= r56438;
double r56440 = r56423 / r56427;
double r56441 = r56440 / r56426;
double r56442 = r56441 * r56424;
double r56443 = 2.2861754035064276e+301;
bool r56444 = r56429 <= r56443;
double r56445 = r56423 / r56426;
double r56446 = r56424 / r56427;
double r56447 = r56445 * r56446;
double r56448 = r56444 ? r56429 : r56447;
double r56449 = r56439 ? r56442 : r56448;
double r56450 = r56437 ? r56429 : r56449;
double r56451 = r56431 ? r56435 : r56450;
return r56451;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.6 |
|---|---|
| Target | 11.4 |
| Herbie | 3.5 |
if (/ (* a1 a2) (* b1 b2)) < -inf.0Initial program 64.0
rmApplied associate-/l*30.8
rmApplied clear-num30.9
if -inf.0 < (/ (* a1 a2) (* b1 b2)) < -9.7824997876567e-322 or 1.421277284711e-315 < (/ (* a1 a2) (* b1 b2)) < 2.2861754035064276e+301Initial program 0.9
rmApplied associate-/l*8.3
rmApplied *-un-lft-identity8.3
Applied times-frac14.7
Applied *-un-lft-identity14.7
Applied times-frac14.5
Simplified14.5
Simplified14.5
rmApplied *-un-lft-identity14.5
Applied *-un-lft-identity14.5
Applied times-frac14.5
Applied associate-*l*14.5
Simplified0.9
if -9.7824997876567e-322 < (/ (* a1 a2) (* b1 b2)) < 1.421277284711e-315Initial program 13.6
rmApplied associate-/l*7.3
rmApplied *-un-lft-identity7.3
Applied times-frac3.9
Applied *-un-lft-identity3.9
Applied times-frac3.4
Simplified3.4
Simplified3.5
rmApplied associate-*r*3.8
Simplified3.8
if 2.2861754035064276e+301 < (/ (* a1 a2) (* b1 b2)) Initial program 62.0
rmApplied times-frac8.0
Final simplification3.5
herbie shell --seed 2019323 +o rules:numerics
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))