\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} = -\infty:\\
\;\;\;\;\frac{\frac{a1}{b2}}{\frac{b1}{a2}}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le -1.3207011670277236 \cdot 10^{-263}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le 1.35378439927382 \cdot 10^{-267}:\\
\;\;\;\;\frac{\frac{a1}{b1} \cdot a2}{b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le 1.6301067955831595 \cdot 10^{+297}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a1}{b2}}{\frac{b1}{a2}}\\
\end{array}double f(double a1, double a2, double b1, double b2) {
double r5899006 = a1;
double r5899007 = a2;
double r5899008 = r5899006 * r5899007;
double r5899009 = b1;
double r5899010 = b2;
double r5899011 = r5899009 * r5899010;
double r5899012 = r5899008 / r5899011;
return r5899012;
}
double f(double a1, double a2, double b1, double b2) {
double r5899013 = a1;
double r5899014 = a2;
double r5899015 = r5899013 * r5899014;
double r5899016 = b1;
double r5899017 = b2;
double r5899018 = r5899016 * r5899017;
double r5899019 = r5899015 / r5899018;
double r5899020 = -inf.0;
bool r5899021 = r5899019 <= r5899020;
double r5899022 = r5899013 / r5899017;
double r5899023 = r5899016 / r5899014;
double r5899024 = r5899022 / r5899023;
double r5899025 = -1.3207011670277236e-263;
bool r5899026 = r5899019 <= r5899025;
double r5899027 = 1.35378439927382e-267;
bool r5899028 = r5899019 <= r5899027;
double r5899029 = r5899013 / r5899016;
double r5899030 = r5899029 * r5899014;
double r5899031 = r5899030 / r5899017;
double r5899032 = 1.6301067955831595e+297;
bool r5899033 = r5899019 <= r5899032;
double r5899034 = r5899033 ? r5899019 : r5899024;
double r5899035 = r5899028 ? r5899031 : r5899034;
double r5899036 = r5899026 ? r5899019 : r5899035;
double r5899037 = r5899021 ? r5899024 : r5899036;
return r5899037;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.0 |
|---|---|
| Target | 10.8 |
| Herbie | 2.9 |
if (/ (* a1 a2) (* b1 b2)) < -inf.0 or 1.6301067955831595e+297 < (/ (* a1 a2) (* b1 b2)) Initial program 59.7
rmApplied *-commutative59.7
Applied *-un-lft-identity59.7
Applied times-frac42.2
rmApplied associate-/l*14.1
Applied associate-*r/7.0
Simplified6.9
if -inf.0 < (/ (* a1 a2) (* b1 b2)) < -1.3207011670277236e-263 or 1.35378439927382e-267 < (/ (* a1 a2) (* b1 b2)) < 1.6301067955831595e+297Initial program 0.7
if -1.3207011670277236e-263 < (/ (* a1 a2) (* b1 b2)) < 1.35378439927382e-267Initial program 13.1
rmApplied *-un-lft-identity13.1
Applied associate-*r*13.1
Applied associate-/r*7.6
Simplified5.2
Final simplification2.9
herbie shell --seed 2019158 +o rules:numerics
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))