\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq 0:\\
\;\;\;\;\frac{\frac{\sqrt[3]{a2} \cdot \sqrt[3]{a2}}{\sqrt[3]{b2} \cdot \sqrt[3]{b2}}}{\sqrt[3]{b1} \cdot \sqrt[3]{b1}} \cdot \frac{a1}{\frac{\sqrt[3]{b1}}{\frac{\sqrt[3]{a2}}{\sqrt[3]{b2}}}}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq 2.9311289529255777 \cdot 10^{+295}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{a1} \cdot \sqrt[3]{a1}}{b1} \cdot \left(\sqrt[3]{a1} \cdot \frac{a2}{b2}\right)\\
\end{array}(FPCore (a1 a2 b1 b2) :precision binary64 (/ (* a1 a2) (* b1 b2)))
(FPCore (a1 a2 b1 b2)
:precision binary64
(if (<= (/ (* a1 a2) (* b1 b2)) 0.0)
(*
(/
(/ (* (cbrt a2) (cbrt a2)) (* (cbrt b2) (cbrt b2)))
(* (cbrt b1) (cbrt b1)))
(/ a1 (/ (cbrt b1) (/ (cbrt a2) (cbrt b2)))))
(if (<= (/ (* a1 a2) (* b1 b2)) 2.9311289529255777e+295)
(/ (* a1 a2) (* b1 b2))
(* (/ (* (cbrt a1) (cbrt a1)) b1) (* (cbrt a1) (/ a2 b2))))))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 tmp;
if (((a1 * a2) / (b1 * b2)) <= 0.0) {
tmp = (((cbrt(a2) * cbrt(a2)) / (cbrt(b2) * cbrt(b2))) / (cbrt(b1) * cbrt(b1))) * (a1 / (cbrt(b1) / (cbrt(a2) / cbrt(b2))));
} else if (((a1 * a2) / (b1 * b2)) <= 2.9311289529255777e+295) {
tmp = (a1 * a2) / (b1 * b2);
} else {
tmp = ((cbrt(a1) * cbrt(a1)) / b1) * (cbrt(a1) * (a2 / b2));
}
return tmp;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.2 |
|---|---|
| Target | 11.2 |
| Herbie | 2.5 |
if (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < 0.0Initial program 10.2
rmApplied associate-/l*_binary648.8
Simplified9.7
rmApplied add-cube-cbrt_binary6410.1
Applied add-cube-cbrt_binary6410.2
Applied times-frac_binary6410.2
Applied add-cube-cbrt_binary6410.3
Applied times-frac_binary647.2
Applied *-un-lft-identity_binary647.2
Applied times-frac_binary642.8
Simplified2.7
if 0.0 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < 2.93112895292557773e295Initial program 0.8
if 2.93112895292557773e295 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) Initial program 61.4
rmApplied associate-/l*_binary6445.4
Simplified12.7
rmApplied div-inv_binary6412.7
Applied add-cube-cbrt_binary6413.4
Applied times-frac_binary647.6
Simplified7.6
Final simplification2.5
herbie shell --seed 2021175
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))