\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;b1 \cdot b2 \le -3.58664145041220608751762177013649404527 \cdot 10^{295}:\\
\;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\
\mathbf{elif}\;b1 \cdot b2 \le -1.977094403295562009633117616926065832914 \cdot 10^{-180}:\\
\;\;\;\;\frac{a1}{b1 \cdot b2} \cdot a2\\
\mathbf{elif}\;b1 \cdot b2 \le 1.695237226331841275115612229868088975953 \cdot 10^{-314}:\\
\;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\
\mathbf{elif}\;b1 \cdot b2 \le 1.479757665365577781832274190873386765909 \cdot 10^{235}:\\
\;\;\;\;\frac{a1}{b1 \cdot b2} \cdot a2\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a1}{b1}}{\frac{b2}{a2}}\\
\end{array}double f(double a1, double a2, double b1, double b2) {
double r6860054 = a1;
double r6860055 = a2;
double r6860056 = r6860054 * r6860055;
double r6860057 = b1;
double r6860058 = b2;
double r6860059 = r6860057 * r6860058;
double r6860060 = r6860056 / r6860059;
return r6860060;
}
double f(double a1, double a2, double b1, double b2) {
double r6860061 = b1;
double r6860062 = b2;
double r6860063 = r6860061 * r6860062;
double r6860064 = -3.586641450412206e+295;
bool r6860065 = r6860063 <= r6860064;
double r6860066 = a1;
double r6860067 = r6860066 / r6860061;
double r6860068 = a2;
double r6860069 = r6860068 / r6860062;
double r6860070 = r6860067 * r6860069;
double r6860071 = -1.977094403295562e-180;
bool r6860072 = r6860063 <= r6860071;
double r6860073 = r6860066 / r6860063;
double r6860074 = r6860073 * r6860068;
double r6860075 = 1.6952372263318e-314;
bool r6860076 = r6860063 <= r6860075;
double r6860077 = 1.4797576653655778e+235;
bool r6860078 = r6860063 <= r6860077;
double r6860079 = r6860062 / r6860068;
double r6860080 = r6860067 / r6860079;
double r6860081 = r6860078 ? r6860074 : r6860080;
double r6860082 = r6860076 ? r6860070 : r6860081;
double r6860083 = r6860072 ? r6860074 : r6860082;
double r6860084 = r6860065 ? r6860070 : r6860083;
return r6860084;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.3 |
|---|---|
| Target | 11.4 |
| Herbie | 5.0 |
if (* b1 b2) < -3.586641450412206e+295 or -1.977094403295562e-180 < (* b1 b2) < 1.6952372263318e-314Initial program 30.3
rmApplied times-frac6.8
if -3.586641450412206e+295 < (* b1 b2) < -1.977094403295562e-180 or 1.6952372263318e-314 < (* b1 b2) < 1.4797576653655778e+235Initial program 5.4
rmApplied associate-/l*4.9
rmApplied associate-/r/4.8
if 1.4797576653655778e+235 < (* b1 b2) Initial program 16.1
rmApplied associate-/l*16.2
rmApplied *-un-lft-identity16.2
Applied times-frac6.9
Applied associate-/r*3.4
Simplified3.4
Final simplification5.0
herbie shell --seed 2019171
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))