\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{b1}{a2}}}{b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq -5.768834752384833 \cdot 10^{-293}:\\
\;\;\;\;\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)) (- INFINITY))
(/ (/ a1 (/ b1 a2)) b2)
(if (<= (/ (* a1 a2) (* b1 b2)) -5.768834752384833e-293)
(/ (* 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)) <= -((double) INFINITY)) {
tmp = (a1 / (b1 / a2)) / b2;
} else if (((a1 * a2) / (b1 * b2)) <= -5.768834752384833e-293) {
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.0 |
|---|---|
| Target | 11.4 |
| Herbie | 2.7 |
if (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -inf.0Initial program 64.0
rmApplied associate-/l*_binary6428.1
Simplified16.9
rmApplied associate-/r/_binary6416.8
Applied associate-/r*_binary6418.7
if -inf.0 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -5.76883475238483279e-293Initial program 0.8
if -5.76883475238483279e-293 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) Initial program 12.9
rmApplied associate-/l*_binary6411.5
Simplified9.0
rmApplied add-cube-cbrt_binary649.6
Applied add-cube-cbrt_binary649.7
Applied times-frac_binary649.7
Applied add-cube-cbrt_binary649.8
Applied times-frac_binary647.0
Applied add-cube-cbrt_binary647.0
Applied times-frac_binary642.7
Final simplification2.7
herbie shell --seed 2021174
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))