\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;b1 \cdot b2 \le -9.2690769035523702 \cdot 10^{292}:\\
\;\;\;\;\left(a1 \cdot \frac{\sqrt[3]{a2} \cdot \sqrt[3]{a2}}{b1}\right) \cdot \frac{\sqrt[3]{a2}}{b2}\\
\mathbf{elif}\;b1 \cdot b2 \le -8.2523225915956471 \cdot 10^{-278}:\\
\;\;\;\;a1 \cdot \frac{a2}{b1 \cdot b2}\\
\mathbf{elif}\;b1 \cdot b2 \le 8.28170983261853465 \cdot 10^{-276}:\\
\;\;\;\;\frac{\frac{a1}{b1}}{\frac{b2}{a2}}\\
\mathbf{elif}\;b1 \cdot b2 \le 2.7030945419074493 \cdot 10^{228}:\\
\;\;\;\;a1 \cdot \frac{a2}{b1 \cdot b2}\\
\mathbf{else}:\\
\;\;\;\;\left(a1 \cdot \frac{\sqrt[3]{a2} \cdot \sqrt[3]{a2}}{b1}\right) \cdot \frac{\sqrt[3]{a2}}{b2}\\
\end{array}double code(double a1, double a2, double b1, double b2) {
return ((a1 * a2) / (b1 * b2));
}
double code(double a1, double a2, double b1, double b2) {
double temp;
if (((b1 * b2) <= -9.26907690355237e+292)) {
temp = ((a1 * ((cbrt(a2) * cbrt(a2)) / b1)) * (cbrt(a2) / b2));
} else {
double temp_1;
if (((b1 * b2) <= -8.252322591595647e-278)) {
temp_1 = (a1 * (a2 / (b1 * b2)));
} else {
double temp_2;
if (((b1 * b2) <= 8.281709832618535e-276)) {
temp_2 = ((a1 / b1) / (b2 / a2));
} else {
double temp_3;
if (((b1 * b2) <= 2.7030945419074493e+228)) {
temp_3 = (a1 * (a2 / (b1 * b2)));
} else {
temp_3 = ((a1 * ((cbrt(a2) * cbrt(a2)) / b1)) * (cbrt(a2) / b2));
}
temp_2 = temp_3;
}
temp_1 = temp_2;
}
temp = temp_1;
}
return temp;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.1 |
|---|---|
| Target | 11.5 |
| Herbie | 5.1 |
if (* b1 b2) < -9.26907690355237e+292 or 2.7030945419074493e+228 < (* b1 b2) Initial program 19.3
rmApplied associate-/l*18.9
rmApplied div-inv18.9
Simplified18.8
rmApplied add-cube-cbrt18.9
Applied times-frac7.5
Applied associate-*r*3.4
if -9.26907690355237e+292 < (* b1 b2) < -8.252322591595647e-278 or 8.281709832618535e-276 < (* b1 b2) < 2.7030945419074493e+228Initial program 5.2
rmApplied associate-/l*5.2
rmApplied div-inv5.5
Simplified5.2
if -8.252322591595647e-278 < (* b1 b2) < 8.281709832618535e-276Initial program 47.3
rmApplied associate-/l*48.3
rmApplied *-un-lft-identity48.3
Applied times-frac20.7
Applied associate-/r*8.5
Simplified8.5
Final simplification5.1
herbie shell --seed 2020058 +o rules:numerics
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))