\frac{a1 \cdot a2}{b1 \cdot b2}
\begin{array}{l}
t_0 := \frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{if}\;t_0 \leq -\infty:\\
\;\;\;\;\frac{a1}{b2} \cdot \frac{a2}{b1}\\
\mathbf{elif}\;t_0 \leq -5.7467652850681114 \cdot 10^{-294}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;t_0 \leq 0:\\
\;\;\;\;\frac{1}{\frac{b1}{\sqrt[3]{a2} \cdot \sqrt[3]{a2}}} \cdot \frac{a1}{\frac{b2}{\sqrt[3]{a2}}}\\
\mathbf{elif}\;t_0 \leq 1.5148245907412011 \cdot 10^{+287}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{a1} \cdot \sqrt[3]{a1}}{b1} \cdot \frac{\sqrt[3]{a1}}{\frac{b2}{a2}}\\
\end{array}
(FPCore (a1 a2 b1 b2) :precision binary64 (/ (* a1 a2) (* b1 b2)))
(FPCore (a1 a2 b1 b2)
:precision binary64
(let* ((t_0 (/ (* a1 a2) (* b1 b2))))
(if (<= t_0 (- INFINITY))
(* (/ a1 b2) (/ a2 b1))
(if (<= t_0 -5.7467652850681114e-294)
t_0
(if (<= t_0 0.0)
(* (/ 1.0 (/ b1 (* (cbrt a2) (cbrt a2)))) (/ a1 (/ b2 (cbrt a2))))
(if (<= t_0 1.5148245907412011e+287)
t_0
(* (/ (* (cbrt a1) (cbrt a1)) b1) (/ (cbrt a1) (/ b2 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 t_0 = (a1 * a2) / (b1 * b2);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (a1 / b2) * (a2 / b1);
} else if (t_0 <= -5.7467652850681114e-294) {
tmp = t_0;
} else if (t_0 <= 0.0) {
tmp = (1.0 / (b1 / (cbrt(a2) * cbrt(a2)))) * (a1 / (b2 / cbrt(a2)));
} else if (t_0 <= 1.5148245907412011e+287) {
tmp = t_0;
} else {
tmp = ((cbrt(a1) * cbrt(a1)) / b1) * (cbrt(a1) / (b2 / a2));
}
return tmp;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.2 |
|---|---|
| Target | 11.3 |
| Herbie | 2.2 |
if (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -inf.0Initial program 64.0
Applied associate-/l*_binary6426.1
Applied div-inv_binary6426.1
Simplified26.1
Applied *-un-lft-identity_binary6426.1
Applied times-frac_binary6413.5
Applied associate-*r*_binary649.7
Simplified9.7
if -inf.0 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -5.74676528506811142e-294 or -0.0 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < 1.51482459074120114e287Initial program 0.8
Applied associate-/l*_binary648.0
Applied div-inv_binary648.4
Simplified8.1
Applied pow1_binary648.1
Applied pow1_binary648.1
Applied pow-prod-down_binary648.1
Simplified0.8
if -5.74676528506811142e-294 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -0.0Initial program 13.4
Applied associate-/l*_binary647.1
Applied add-cube-cbrt_binary647.3
Applied times-frac_binary643.8
Applied *-un-lft-identity_binary643.8
Applied times-frac_binary642.4
if 1.51482459074120114e287 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) Initial program 59.9
Applied associate-/l*_binary6445.3
Applied *-un-lft-identity_binary6445.3
Applied times-frac_binary6415.7
Applied add-cube-cbrt_binary6416.5
Applied times-frac_binary648.7
Simplified8.7
Final simplification2.2
herbie shell --seed 2022004
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))