\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq -1.525827891617212 \cdot 10^{+281}:\\
\;\;\;\;\frac{1}{\sqrt[3]{b1} \cdot \sqrt[3]{b1}} \cdot \left(\frac{a2}{b2} \cdot \frac{a1}{\sqrt[3]{b1}}\right)\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq -2.7274658798653095 \cdot 10^{-301}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq 0:\\
\;\;\;\;\frac{\sqrt[3]{a1} \cdot \sqrt[3]{a1}}{\sqrt[3]{b1} \cdot \sqrt[3]{b1}} \cdot \left(\frac{a2}{b2} \cdot \frac{\sqrt[3]{a1}}{\sqrt[3]{b1}}\right)\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq 1.1524808445941616 \cdot 10^{+274}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{else}:\\
\;\;\;\;\frac{a2}{b2} \cdot \frac{a1}{b1}\\
\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.525827891617212e+281)
(* (/ 1.0 (* (cbrt b1) (cbrt b1))) (* (/ a2 b2) (/ a1 (cbrt b1))))
(if (<= (/ (* a1 a2) (* b1 b2)) -2.7274658798653095e-301)
(/ (* a1 a2) (* b1 b2))
(if (<= (/ (* a1 a2) (* b1 b2)) 0.0)
(*
(/ (* (cbrt a1) (cbrt a1)) (* (cbrt b1) (cbrt b1)))
(* (/ a2 b2) (/ (cbrt a1) (cbrt b1))))
(if (<= (/ (* a1 a2) (* b1 b2)) 1.1524808445941616e+274)
(/ (* a1 a2) (* b1 b2))
(* (/ a2 b2) (/ a1 b1)))))))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.525827891617212e+281) {
tmp = (1.0 / (cbrt(b1) * cbrt(b1))) * ((a2 / b2) * (a1 / cbrt(b1)));
} else if (((a1 * a2) / (b1 * b2)) <= -2.7274658798653095e-301) {
tmp = (a1 * a2) / (b1 * b2);
} else if (((a1 * a2) / (b1 * b2)) <= 0.0) {
tmp = ((cbrt(a1) * cbrt(a1)) / (cbrt(b1) * cbrt(b1))) * ((a2 / b2) * (cbrt(a1) / cbrt(b1)));
} else if (((a1 * a2) / (b1 * b2)) <= 1.1524808445941616e+274) {
tmp = (a1 * a2) / (b1 * b2);
} else {
tmp = (a2 / b2) * (a1 / b1);
}
return tmp;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.6 |
|---|---|
| Target | 11.5 |
| Herbie | 2.4 |
if (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -1.52582789161721215e281Initial program 52.0
rmApplied times-frac_binary64_281214.4
rmApplied add-cube-cbrt_binary64_284115.2
Applied *-un-lft-identity_binary64_280615.2
Applied times-frac_binary64_281215.2
Applied associate-*l*_binary64_274716.9
Simplified16.9
if -1.52582789161721215e281 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -2.7274658798653095e-301 or 0.0 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < 1.15248084459416157e274Initial program 0.7
if -2.7274658798653095e-301 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < 0.0Initial program 14.3
rmApplied times-frac_binary64_28122.7
rmApplied add-cube-cbrt_binary64_28412.9
Applied add-cube-cbrt_binary64_28413.0
Applied times-frac_binary64_28123.0
Applied associate-*l*_binary64_27471.9
Simplified1.9
if 1.15248084459416157e274 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) Initial program 56.4
rmApplied times-frac_binary64_28128.3
Final simplification2.4
herbie shell --seed 2021015
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))