\frac{a1 \cdot a2}{b1 \cdot b2}
\begin{array}{l}
t_0 := \sqrt[3]{b1} \cdot \sqrt[3]{b1}\\
t_1 := \sqrt[3]{b2} \cdot \sqrt[3]{b2}\\
t_2 := \frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\frac{\sqrt[3]{a1} \cdot \sqrt[3]{a1}}{t_0 \cdot t_1} \cdot \frac{\sqrt[3]{a1}}{\frac{\sqrt[3]{b1}}{\frac{a2}{\sqrt[3]{b2}}}}\\
\mathbf{elif}\;t_2 \leq -2.653892108765896 \cdot 10^{-209}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\sqrt[3]{a2} \cdot \sqrt[3]{a2}}{t_1}}{t_0} \cdot \frac{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
(let* ((t_0 (* (cbrt b1) (cbrt b1)))
(t_1 (* (cbrt b2) (cbrt b2)))
(t_2 (/ (* a1 a2) (* b1 b2))))
(if (<= t_2 (- INFINITY))
(*
(/ (* (cbrt a1) (cbrt a1)) (* t_0 t_1))
(/ (cbrt a1) (/ (cbrt b1) (/ a2 (cbrt b2)))))
(if (<= t_2 -2.653892108765896e-209)
t_2
(*
(/ (/ (* (cbrt a2) (cbrt a2)) t_1) t_0)
(/ 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 t_0 = cbrt(b1) * cbrt(b1);
double t_1 = cbrt(b2) * cbrt(b2);
double t_2 = (a1 * a2) / (b1 * b2);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = ((cbrt(a1) * cbrt(a1)) / (t_0 * t_1)) * (cbrt(a1) / (cbrt(b1) / (a2 / cbrt(b2))));
} else if (t_2 <= -2.653892108765896e-209) {
tmp = t_2;
} else {
tmp = (((cbrt(a2) * cbrt(a2)) / t_1) / t_0) * (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.4 |
|---|---|
| Target | 11.6 |
| Herbie | 2.4 |
if (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -inf.0Initial program 64.0
Applied associate-/l*_binary6429.1
Simplified16.2
Applied add-cube-cbrt_binary6417.0
Applied *-un-lft-identity_binary6417.0
Applied times-frac_binary6417.0
Applied add-cube-cbrt_binary6417.2
Applied times-frac_binary6415.4
Applied add-cube-cbrt_binary6415.5
Applied times-frac_binary646.0
Simplified6.0
if -inf.0 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -2.6538921087658958e-209Initial program 0.8
if -2.6538921087658958e-209 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) Initial program 12.8
Applied associate-/l*_binary6411.9
Simplified9.7
Applied add-cube-cbrt_binary6410.2
Applied add-cube-cbrt_binary6410.3
Applied times-frac_binary6410.3
Applied add-cube-cbrt_binary6410.4
Applied times-frac_binary647.5
Applied *-un-lft-identity_binary647.5
Applied times-frac_binary642.8
Simplified2.8
Final simplification2.4
herbie shell --seed 2021215
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))