\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq -\infty:\\
\;\;\;\;\frac{\frac{a1}{\frac{1}{\frac{1}{\sqrt[3]{b2} \cdot \sqrt[3]{b2}}}}}{\frac{b1}{\frac{a2}{\sqrt[3]{b2}}}}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq -2.370004147293795 \cdot 10^{-297}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq 0:\\
\;\;\;\;\frac{\sqrt[3]{a1} \cdot \sqrt[3]{a1}}{b1} \cdot \frac{\sqrt[3]{a1}}{\frac{1}{\frac{a2}{b2}}}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq 1.5878121550775986 \cdot 10^{+305}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\sqrt[3]{a1} \cdot \sqrt[3]{a1}\right) \cdot \frac{\sqrt{a2}}{\sqrt[3]{b2} \cdot \sqrt[3]{b2}}\right) \cdot \frac{\sqrt[3]{a1}}{\frac{b1}{\frac{\sqrt{a2}}{\sqrt[3]{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 (/ 1.0 (/ 1.0 (* (cbrt b2) (cbrt b2))))) (/ b1 (/ a2 (cbrt b2))))
(if (<= (/ (* a1 a2) (* b1 b2)) -2.370004147293795e-297)
(/ (* a1 a2) (* b1 b2))
(if (<= (/ (* a1 a2) (* b1 b2)) 0.0)
(* (/ (* (cbrt a1) (cbrt a1)) b1) (/ (cbrt a1) (/ 1.0 (/ a2 b2))))
(if (<= (/ (* a1 a2) (* b1 b2)) 1.5878121550775986e+305)
(/ (* a1 a2) (* b1 b2))
(*
(* (* (cbrt a1) (cbrt a1)) (/ (sqrt a2) (* (cbrt b2) (cbrt b2))))
(/ (cbrt a1) (/ b1 (/ (sqrt a2) (cbrt 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 / (1.0 / (1.0 / (cbrt(b2) * cbrt(b2))))) / (b1 / (a2 / cbrt(b2)));
} else if (((a1 * a2) / (b1 * b2)) <= -2.370004147293795e-297) {
tmp = (a1 * a2) / (b1 * b2);
} else if (((a1 * a2) / (b1 * b2)) <= 0.0) {
tmp = ((cbrt(a1) * cbrt(a1)) / b1) * (cbrt(a1) / (1.0 / (a2 / b2)));
} else if (((a1 * a2) / (b1 * b2)) <= 1.5878121550775986e+305) {
tmp = (a1 * a2) / (b1 * b2);
} else {
tmp = ((cbrt(a1) * cbrt(a1)) * (sqrt(a2) / (cbrt(b2) * cbrt(b2)))) * (cbrt(a1) / (b1 / (sqrt(a2) / cbrt(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.2 |
| Herbie | 3.1 |
if (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -inf.0Initial program 64.0
rmApplied associate-/l*_binary6429.7
Simplified18.4
rmApplied add-cube-cbrt_binary6419.2
Applied *-un-lft-identity_binary6419.2
Applied times-frac_binary6419.2
Applied *-un-lft-identity_binary6419.2
Applied times-frac_binary6417.3
Applied associate-/r*_binary6410.2
if -inf.0 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -2.370004147293795e-297 or 0.0 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < 1.5878121550775986e305Initial program 0.8
if -2.370004147293795e-297 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < 0.0Initial program 13.1
rmApplied associate-/l*_binary647.5
Simplified4.3
rmApplied div-inv_binary644.3
Applied add-cube-cbrt_binary644.5
Applied times-frac_binary642.7
if 1.5878121550775986e305 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) Initial program 63.3
rmApplied associate-/l*_binary6446.6
Simplified15.2
rmApplied add-cube-cbrt_binary6415.9
Applied add-sqr-sqrt_binary6429.7
Applied times-frac_binary6429.7
Applied *-un-lft-identity_binary6429.7
Applied times-frac_binary6427.8
Applied add-cube-cbrt_binary6428.0
Applied times-frac_binary6420.2
Simplified20.2
Final simplification3.1
herbie shell --seed 2021110
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))