\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq -1.472639137517851 \cdot 10^{+139}:\\
\;\;\;\;\frac{\sqrt[3]{a1} \cdot \sqrt[3]{a1}}{\frac{\sqrt[3]{b1} \cdot \sqrt[3]{b1}}{\sqrt[3]{a2} \cdot \sqrt[3]{a2}}} \cdot \frac{\sqrt[3]{a1}}{\frac{\sqrt[3]{b1}}{\frac{\sqrt[3]{a2}}{b2}}}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \leq -4.934182168999457 \cdot 10^{-303}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\sqrt[3]{a1} \cdot \sqrt[3]{a1}\right) \cdot \frac{\sqrt[3]{a2} \cdot \sqrt[3]{a2}}{\sqrt[3]{b2} \cdot \sqrt[3]{b2}}\right) \cdot \frac{\sqrt[3]{a1}}{\frac{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)) -1.472639137517851e+139)
(*
(/
(* (cbrt a1) (cbrt a1))
(/ (* (cbrt b1) (cbrt b1)) (* (cbrt a2) (cbrt a2))))
(/ (cbrt a1) (/ (cbrt b1) (/ (cbrt a2) b2))))
(if (<= (/ (* a1 a2) (* b1 b2)) -4.934182168999457e-303)
(/ (* a1 a2) (* b1 b2))
(*
(*
(* (cbrt a1) (cbrt a1))
(/ (* (cbrt a2) (cbrt a2)) (* (cbrt b2) (cbrt b2))))
(/ (cbrt a1) (/ 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)) <= -1.472639137517851e+139) {
tmp = ((cbrt(a1) * cbrt(a1)) / ((cbrt(b1) * cbrt(b1)) / (cbrt(a2) * cbrt(a2)))) * (cbrt(a1) / (cbrt(b1) / (cbrt(a2) / b2)));
} else if (((a1 * a2) / (b1 * b2)) <= -4.934182168999457e-303) {
tmp = (a1 * a2) / (b1 * b2);
} else {
tmp = ((cbrt(a1) * cbrt(a1)) * ((cbrt(a2) * cbrt(a2)) / (cbrt(b2) * cbrt(b2)))) * (cbrt(a1) / (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 | 3.7 |
if (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -1.47263913751785096e139Initial program 22.1
rmApplied associate-/l*_binary64_172817.1
Simplified16.9
rmApplied *-un-lft-identity_binary64_178316.9
Applied add-cube-cbrt_binary64_181817.7
Applied times-frac_binary64_178917.7
Applied add-cube-cbrt_binary64_181817.8
Applied times-frac_binary64_178914.5
Applied add-cube-cbrt_binary64_181814.7
Applied times-frac_binary64_17898.4
Simplified8.4
if -1.47263913751785096e139 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -4.9341821689994572e-303Initial program 0.7
if -4.9341821689994572e-303 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) Initial program 12.9
rmApplied associate-/l*_binary64_172811.5
Simplified9.9
rmApplied add-cube-cbrt_binary64_181810.4
Applied add-cube-cbrt_binary64_181810.5
Applied times-frac_binary64_178910.5
Applied *-un-lft-identity_binary64_178310.5
Applied times-frac_binary64_17897.6
Applied add-cube-cbrt_binary64_18187.7
Applied times-frac_binary64_17894.1
Simplified4.0
Final simplification3.7
herbie shell --seed 2021032
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))