\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq -3.417901669555667 \cdot 10^{+301}:\\
\;\;\;\;\frac{\frac{a1}{b2}}{\frac{b1}{a2}}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq -2.542552855874417 \cdot 10^{-297}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq 0:\\
\;\;\;\;\frac{1}{\frac{\sqrt[3]{b1} \cdot \sqrt[3]{b1}}{\frac{\sqrt[3]{a1} \cdot \sqrt[3]{a1}}{\sqrt[3]{b2} \cdot \sqrt[3]{b2}}} \cdot \frac{\sqrt[3]{b1}}{\frac{\sqrt[3]{a1}}{\frac{\sqrt[3]{b2}}{a2}}}}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq 1.7044719015567174 \cdot 10^{+305}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a1}{b2}}{\frac{b1}{a2}}\\
\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)) -3.417901669555667e+301)
(/ (/ a1 b2) (/ b1 a2))
(if (<= (/ (* a1 a2) (* b1 b2)) -2.542552855874417e-297)
(/ (* a1 a2) (* b1 b2))
(if (<= (/ (* a1 a2) (* b1 b2)) 0.0)
(/
1.0
(*
(/
(* (cbrt b1) (cbrt b1))
(/ (* (cbrt a1) (cbrt a1)) (* (cbrt b2) (cbrt b2))))
(/ (cbrt b1) (/ (cbrt a1) (/ (cbrt b2) a2)))))
(if (<= (/ (* a1 a2) (* b1 b2)) 1.7044719015567174e+305)
(/ (* a1 a2) (* b1 b2))
(/ (/ a1 b2) (/ b1 a2)))))))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)) <= -3.417901669555667e+301) {
tmp = (a1 / b2) / (b1 / a2);
} else if (((a1 * a2) / (b1 * b2)) <= -2.542552855874417e-297) {
tmp = (a1 * a2) / (b1 * b2);
} else if (((a1 * a2) / (b1 * b2)) <= 0.0) {
tmp = 1.0 / (((cbrt(b1) * cbrt(b1)) / ((cbrt(a1) * cbrt(a1)) / (cbrt(b2) * cbrt(b2)))) * (cbrt(b1) / (cbrt(a1) / (cbrt(b2) / a2))));
} else if (((a1 * a2) / (b1 * b2)) <= 1.7044719015567174e+305) {
tmp = (a1 * a2) / (b1 * b2);
} else {
tmp = (a1 / b2) / (b1 / a2);
}
return tmp;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.3 |
|---|---|
| Target | 11.5 |
| Herbie | 2.0 |
if (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -3.41790166955566683e301 or 1.7044719015567174e305 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) Initial program 63.0
rmApplied clear-num_binary64_280563.0
rmApplied associate-/l*_binary64_275144.0
Simplified13.9
rmApplied associate-/r/_binary64_275214.1
Applied *-un-lft-identity_binary64_280614.1
Applied times-frac_binary64_28127.2
Applied associate-/r*_binary64_27507.2
Simplified7.1
if -3.41790166955566683e301 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -2.5425528558744169e-297 or 0.0 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < 1.7044719015567174e305Initial program 0.8
if -2.5425528558744169e-297 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < 0.0Initial program 13.3
rmApplied clear-num_binary64_280513.7
rmApplied associate-/l*_binary64_27517.1
Simplified4.5
rmApplied *-un-lft-identity_binary64_28064.5
Applied add-cube-cbrt_binary64_28414.7
Applied times-frac_binary64_28124.7
Applied add-cube-cbrt_binary64_28414.7
Applied times-frac_binary64_28124.2
Applied add-cube-cbrt_binary64_28414.2
Applied times-frac_binary64_28122.7
Simplified2.7
Final simplification2.0
herbie shell --seed 2020298
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))