\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;b2 \cdot b1 \le -5.027198331468452971083277390987079564256 \cdot 10^{271}:\\
\;\;\;\;\frac{a2}{b2} \cdot \frac{a1}{b1}\\
\mathbf{elif}\;b2 \cdot b1 \le -1.708279358278811067826228393370497973053 \cdot 10^{-240}:\\
\;\;\;\;\frac{a1}{b2 \cdot b1} \cdot a2\\
\mathbf{elif}\;b2 \cdot b1 \le 2.491183802213925616452581733594161045108 \cdot 10^{-239}:\\
\;\;\;\;\frac{1}{b1} \cdot \frac{a1}{\frac{b2}{a2}}\\
\mathbf{elif}\;b2 \cdot b1 \le 3.274003468956291087635927220582233224264 \cdot 10^{201}:\\
\;\;\;\;\frac{a1}{b2 \cdot b1} \cdot a2\\
\mathbf{else}:\\
\;\;\;\;\frac{a2}{b2} \cdot \frac{a1}{b1}\\
\end{array}double f(double a1, double a2, double b1, double b2) {
double r4521112 = a1;
double r4521113 = a2;
double r4521114 = r4521112 * r4521113;
double r4521115 = b1;
double r4521116 = b2;
double r4521117 = r4521115 * r4521116;
double r4521118 = r4521114 / r4521117;
return r4521118;
}
double f(double a1, double a2, double b1, double b2) {
double r4521119 = b2;
double r4521120 = b1;
double r4521121 = r4521119 * r4521120;
double r4521122 = -5.027198331468453e+271;
bool r4521123 = r4521121 <= r4521122;
double r4521124 = a2;
double r4521125 = r4521124 / r4521119;
double r4521126 = a1;
double r4521127 = r4521126 / r4521120;
double r4521128 = r4521125 * r4521127;
double r4521129 = -1.708279358278811e-240;
bool r4521130 = r4521121 <= r4521129;
double r4521131 = r4521126 / r4521121;
double r4521132 = r4521131 * r4521124;
double r4521133 = 2.4911838022139256e-239;
bool r4521134 = r4521121 <= r4521133;
double r4521135 = 1.0;
double r4521136 = r4521135 / r4521120;
double r4521137 = r4521119 / r4521124;
double r4521138 = r4521126 / r4521137;
double r4521139 = r4521136 * r4521138;
double r4521140 = 3.274003468956291e+201;
bool r4521141 = r4521121 <= r4521140;
double r4521142 = r4521141 ? r4521132 : r4521128;
double r4521143 = r4521134 ? r4521139 : r4521142;
double r4521144 = r4521130 ? r4521132 : r4521143;
double r4521145 = r4521123 ? r4521128 : r4521144;
return r4521145;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.5 |
|---|---|
| Target | 11.2 |
| Herbie | 5.0 |
if (* b1 b2) < -5.027198331468453e+271 or 3.274003468956291e+201 < (* b1 b2) Initial program 17.4
rmApplied times-frac3.7
if -5.027198331468453e+271 < (* b1 b2) < -1.708279358278811e-240 or 2.4911838022139256e-239 < (* b1 b2) < 3.274003468956291e+201Initial program 4.9
rmApplied associate-/l*4.6
rmApplied associate-/r/4.9
if -1.708279358278811e-240 < (* b1 b2) < 2.4911838022139256e-239Initial program 40.3
rmApplied associate-/l*39.4
rmApplied *-un-lft-identity39.4
Applied times-frac17.8
Applied *-un-lft-identity17.8
Applied times-frac8.9
Simplified8.9
Final simplification5.0
herbie shell --seed 2019200 +o rules:numerics
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))