\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq -1.4389488001089445 \cdot 10^{+300}:\\
\;\;\;\;\left(\sqrt[3]{\frac{a2}{b2}} \cdot \sqrt[3]{\frac{a2}{b2}}\right) \cdot \frac{a1}{\frac{b1}{\sqrt[3]{\frac{a2}{b2}}}}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq -3.2866929428459785 \cdot 10^{-231}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{a1} \cdot \sqrt[3]{a1}}{\frac{\sqrt[3]{b1} \cdot \sqrt[3]{b1}}{\frac{\sqrt[3]{a2} \cdot \sqrt[3]{a2}}{\sqrt[3]{b2} \cdot \sqrt[3]{b2}}}} \cdot \frac{\sqrt[3]{a1}}{\frac{\sqrt[3]{b1}}{\frac{\sqrt[3]{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)) -1.4389488001089445e+300)
(* (* (cbrt (/ a2 b2)) (cbrt (/ a2 b2))) (/ a1 (/ b1 (cbrt (/ a2 b2)))))
(if (<= (/ (* a1 a2) (* b1 b2)) -3.2866929428459785e-231)
(/ (* a1 a2) (* b1 b2))
(*
(/
(* (cbrt a1) (cbrt a1))
(/
(* (cbrt b1) (cbrt b1))
(/ (* (cbrt a2) (cbrt a2)) (* (cbrt b2) (cbrt b2)))))
(/ (cbrt a1) (/ (cbrt b1) (/ (cbrt 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)) <= -1.4389488001089445e+300) {
tmp = (cbrt(a2 / b2) * cbrt(a2 / b2)) * (a1 / (b1 / cbrt(a2 / b2)));
} else if (((a1 * a2) / (b1 * b2)) <= -3.2866929428459785e-231) {
tmp = (a1 * a2) / (b1 * b2);
} else {
tmp = ((cbrt(a1) * cbrt(a1)) / ((cbrt(b1) * cbrt(b1)) / ((cbrt(a2) * cbrt(a2)) / (cbrt(b2) * cbrt(b2))))) * (cbrt(a1) / (cbrt(b1) / (cbrt(a2) / cbrt(b2))));
}
return tmp;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.6 |
|---|---|
| Target | 11.3 |
| Herbie | 2.8 |
if (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -1.4389488001089445e300Initial program 60.2
rmApplied associate-/l*_binary64_343326.8
Simplified17.3
rmApplied add-cube-cbrt_binary64_352318.0
Applied *-un-lft-identity_binary64_348818.0
Applied times-frac_binary64_349418.0
Applied *-un-lft-identity_binary64_348818.0
Applied times-frac_binary64_349415.0
Simplified15.0
if -1.4389488001089445e300 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -3.2866929428459785e-231Initial program 0.9
if -3.2866929428459785e-231 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) Initial program 13.0
rmApplied associate-/l*_binary64_343312.2
Simplified10.2
rmApplied add-cube-cbrt_binary64_352310.7
Applied add-cube-cbrt_binary64_352310.8
Applied times-frac_binary64_349410.8
Applied add-cube-cbrt_binary64_352310.9
Applied times-frac_binary64_34947.9
Applied add-cube-cbrt_binary64_35238.0
Applied times-frac_binary64_34942.8
Final simplification2.8
herbie shell --seed 2021013
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))