\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq -\infty:\\
\;\;\;\;\frac{\frac{a2}{\frac{b1}{a1}}}{b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq -8.266987820202985 \cdot 10^{-304}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq 0:\\
\;\;\;\;\frac{\frac{a2}{\frac{b1}{a1}}}{b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq 4.126127910155212 \cdot 10^{+297}:\\
\;\;\;\;\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))
(/ (/ a2 (/ b1 a1)) b2)
(if (<= (/ (* a1 a2) (* b1 b2)) -8.266987820202985e-304)
(/ (* a1 a2) (* b1 b2))
(if (<= (/ (* a1 a2) (* b1 b2)) 0.0)
(/ (/ a2 (/ b1 a1)) b2)
(if (<= (/ (* a1 a2) (* b1 b2)) 4.126127910155212e+297)
(/ (* 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 = (a2 / (b1 / a1)) / b2;
} else if (((a1 * a2) / (b1 * b2)) <= -8.266987820202985e-304) {
tmp = (a1 * a2) / (b1 * b2);
} else if (((a1 * a2) / (b1 * b2)) <= 0.0) {
tmp = (a2 / (b1 / a1)) / b2;
} else if (((a1 * a2) / (b1 * b2)) <= 4.126127910155212e+297) {
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.5 |
| Herbie | 2.5 |
if (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -inf.0 or -8.266987820202985e-304 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < 0.0Initial program 17.9
rmApplied associate-/r*_binary64_24099.3
Simplified5.0
rmApplied associate-*r/_binary64_24079.3
rmApplied associate-/l*_binary64_24105.1
if -inf.0 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -8.266987820202985e-304 or 0.0 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < 4.1261279101552118e297Initial program 0.8
if 4.1261279101552118e297 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) Initial program 61.4
rmApplied associate-/l*_binary64_241046.0
Simplified12.5
rmApplied add-cube-cbrt_binary64_250013.4
Applied add-cube-cbrt_binary64_250013.5
Applied times-frac_binary64_247113.5
Applied add-cube-cbrt_binary64_250013.8
Applied times-frac_binary64_247112.4
Applied add-cube-cbrt_binary64_250012.5
Applied times-frac_binary64_24714.4
Final simplification2.5
herbie shell --seed 2020356
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))