\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} = -\infty:\\
\;\;\;\;\frac{\frac{a1}{b1}}{\sqrt[3]{b2} \cdot \sqrt[3]{b2}} \cdot \frac{a2}{\sqrt[3]{b2}}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le -1.0214919528087893 \cdot 10^{-301}:\\
\;\;\;\;\frac{1}{\frac{b1 \cdot b2}{a1 \cdot a2}}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le 0.0:\\
\;\;\;\;\frac{\frac{\sqrt[3]{a1} \cdot \sqrt[3]{a1}}{1}}{\sqrt[3]{b2}} \cdot \left(\frac{\frac{\sqrt[3]{a1}}{b1}}{\sqrt[3]{b2}} \cdot \frac{a2}{\sqrt[3]{b2}}\right)\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le 2.2762806338293389 \cdot 10^{303}:\\
\;\;\;\;\frac{1}{\frac{b1 \cdot b2}{a1 \cdot a2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\sqrt[3]{a1} \cdot \sqrt[3]{a1}}{1}}{\sqrt[3]{b2}} \cdot \left(\frac{\frac{\sqrt[3]{a1}}{b1}}{\sqrt[3]{b2}} \cdot \frac{a2}{\sqrt[3]{b2}}\right)\\
\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 ((((a1 * a2) / (b1 * b2)) <= -inf.0)) {
temp = (((a1 / b1) / (cbrt(b2) * cbrt(b2))) * (a2 / cbrt(b2)));
} else {
double temp_1;
if ((((a1 * a2) / (b1 * b2)) <= -1.0214919528087893e-301)) {
temp_1 = (1.0 / ((b1 * b2) / (a1 * a2)));
} else {
double temp_2;
if ((((a1 * a2) / (b1 * b2)) <= 0.0)) {
temp_2 = ((((cbrt(a1) * cbrt(a1)) / 1.0) / cbrt(b2)) * (((cbrt(a1) / b1) / cbrt(b2)) * (a2 / cbrt(b2))));
} else {
double temp_3;
if ((((a1 * a2) / (b1 * b2)) <= 2.276280633829339e+303)) {
temp_3 = (1.0 / ((b1 * b2) / (a1 * a2)));
} else {
temp_3 = ((((cbrt(a1) * cbrt(a1)) / 1.0) / cbrt(b2)) * (((cbrt(a1) / b1) / cbrt(b2)) * (a2 / cbrt(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.4 |
|---|---|
| Target | 11.2 |
| Herbie | 2.5 |
if (/ (* a1 a2) (* b1 b2)) < -inf.0Initial program 64.0
rmApplied times-frac13.4
rmApplied add-cube-cbrt14.4
Applied *-un-lft-identity14.4
Applied times-frac14.3
Applied associate-*r*12.8
Simplified12.8
if -inf.0 < (/ (* a1 a2) (* b1 b2)) < -1.0214919528087893e-301 or 0.0 < (/ (* a1 a2) (* b1 b2)) < 2.276280633829339e+303Initial program 0.8
rmApplied clear-num1.1
if -1.0214919528087893e-301 < (/ (* a1 a2) (* b1 b2)) < 0.0 or 2.276280633829339e+303 < (/ (* a1 a2) (* b1 b2)) Initial program 22.1
rmApplied times-frac3.3
rmApplied add-cube-cbrt3.6
Applied *-un-lft-identity3.6
Applied times-frac3.6
Applied associate-*r*4.1
Simplified4.1
rmApplied *-un-lft-identity4.1
Applied add-cube-cbrt4.2
Applied times-frac4.2
Applied times-frac3.6
Applied associate-*l*3.6
Final simplification2.5
herbie shell --seed 2020053 +o rules:numerics
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))