\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq -\infty:\\
\;\;\;\;\frac{a1}{\sqrt[3]{b1} \cdot \sqrt[3]{b1}} \cdot \frac{\frac{a2}{\sqrt[3]{b1}}}{b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq -8.815954239534769 \cdot 10^{-308}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq 0:\\
\;\;\;\;\left(\frac{a1}{b1} \cdot \frac{\sqrt[3]{a2} \cdot \sqrt[3]{a2}}{\sqrt[3]{b2} \cdot \sqrt[3]{b2}}\right) \cdot \frac{\sqrt[3]{a2}}{\sqrt[3]{b2}}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq 1.0665962442414052 \cdot 10^{+308}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{else}:\\
\;\;\;\;\frac{a1}{\sqrt[3]{b1} \cdot \sqrt[3]{b1}} \cdot \frac{\frac{a2}{\sqrt[3]{b1}}}{b2}\\
\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)) (- INFINITY))
(* (/ a1 (* (cbrt b1) (cbrt b1))) (/ (/ a2 (cbrt b1)) b2))
(if (<= (/ (* a1 a2) (* b1 b2)) -8.815954239534769e-308)
(/ (* a1 a2) (* b1 b2))
(if (<= (/ (* a1 a2) (* b1 b2)) 0.0)
(*
(* (/ a1 b1) (/ (* (cbrt a2) (cbrt a2)) (* (cbrt b2) (cbrt b2))))
(/ (cbrt a2) (cbrt b2)))
(if (<= (/ (* a1 a2) (* b1 b2)) 1.0665962442414052e+308)
(/ (* a1 a2) (* b1 b2))
(* (/ a1 (* (cbrt b1) (cbrt b1))) (/ (/ a2 (cbrt b1)) 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)) <= -((double) INFINITY)) {
tmp = (a1 / (cbrt(b1) * cbrt(b1))) * ((a2 / cbrt(b1)) / b2);
} else if (((a1 * a2) / (b1 * b2)) <= -8.815954239534769e-308) {
tmp = (a1 * a2) / (b1 * b2);
} else if (((a1 * a2) / (b1 * b2)) <= 0.0) {
tmp = ((a1 / b1) * ((cbrt(a2) * cbrt(a2)) / (cbrt(b2) * cbrt(b2)))) * (cbrt(a2) / cbrt(b2));
} else if (((a1 * a2) / (b1 * b2)) <= 1.0665962442414052e+308) {
tmp = (a1 * a2) / (b1 * b2);
} else {
tmp = (a1 / (cbrt(b1) * cbrt(b1))) * ((a2 / cbrt(b1)) / b2);
}
return tmp;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.3 |
|---|---|
| Target | 11.0 |
| Herbie | 1.8 |
if (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -inf.0 or 1.06659624424140518e308 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) Initial program 63.9
rmApplied times-frac_binary64_38357.6
rmApplied div-inv_binary64_38267.7
Applied associate-*l*_binary64_377016.1
Simplified41.8
rmApplied associate-/r*_binary64_377315.1
rmApplied *-un-lft-identity_binary64_382915.1
Applied add-cube-cbrt_binary64_386415.8
Applied *-un-lft-identity_binary64_382915.8
Applied times-frac_binary64_383515.8
Applied times-frac_binary64_383515.5
Applied associate-*r*_binary64_37697.4
Simplified7.3
if -inf.0 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -8.8159542395347687e-308 or 0.0 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < 1.06659624424140518e308Initial program 0.9
if -8.8159542395347687e-308 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < 0.0Initial program 12.6
rmApplied times-frac_binary64_38352.0
rmApplied add-cube-cbrt_binary64_38642.2
Applied add-cube-cbrt_binary64_38642.2
Applied times-frac_binary64_38352.2
Applied associate-*r*_binary64_37691.4
Final simplification1.8
herbie shell --seed 2020344
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))