\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq -\infty:\\
\;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq -7.087500967058436 \cdot 10^{-296} \lor \neg \left(\frac{a1 \cdot a2}{b1 \cdot b2} \leq 0\right) \land \frac{a1 \cdot a2}{b1 \cdot b2} \leq 2.4483889177719666 \cdot 10^{+305}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{else}:\\
\;\;\;\;\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}}\\
\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 b1) (/ a2 b2))
(if (or (<= (/ (* a1 a2) (* b1 b2)) -7.087500967058436e-296)
(and (not (<= (/ (* a1 a2) (* b1 b2)) 0.0))
(<= (/ (* a1 a2) (* b1 b2)) 2.4483889177719666e+305)))
(/ (* a1 a2) (* b1 b2))
(*
(* (/ a1 b1) (/ (* (cbrt a2) (cbrt a2)) (* (cbrt b2) (cbrt b2))))
(/ (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)) <= -((double) INFINITY)) {
tmp = (a1 / b1) * (a2 / b2);
} else if ((((a1 * a2) / (b1 * b2)) <= -7.087500967058436e-296) || (!(((a1 * a2) / (b1 * b2)) <= 0.0) && (((a1 * a2) / (b1 * b2)) <= 2.4483889177719666e+305))) {
tmp = (a1 * a2) / (b1 * b2);
} else {
tmp = ((a1 / b1) * ((cbrt(a2) * cbrt(a2)) / (cbrt(b2) * cbrt(b2)))) * (cbrt(a2) / cbrt(b2));
}
return tmp;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 10.9 |
|---|---|
| Target | 11.7 |
| Herbie | 1.5 |
if (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -inf.0Initial program 64.0
rmApplied times-frac_binary64_588110.8
if -inf.0 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -7.08750096705843556e-296 or -0.0 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < 2.4483889177719666e305Initial program 0.7
rmApplied *-un-lft-identity_binary64_58750.7
if -7.08750096705843556e-296 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -0.0 or 2.4483889177719666e305 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) Initial program 21.9
rmApplied times-frac_binary64_58812.9
rmApplied add-cube-cbrt_binary64_59103.2
Applied add-cube-cbrt_binary64_59103.3
Applied times-frac_binary64_58813.3
Applied associate-*r*_binary64_58151.9
Final simplification1.5
herbie shell --seed 2021079
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))