\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.57 \cdot 10^{-320}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;t_0 \leq 0:\\
\;\;\;\;a1 \cdot \frac{\frac{a2}{b2}}{b1}\\
\mathbf{elif}\;t_0 \leq 6.325887104397162 \cdot 10^{+303}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{a2} \cdot \sqrt[3]{a2}}{b1} \cdot \frac{a1}{\frac{b2}{\sqrt[3]{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.57e-320)
t_0
(if (<= t_0 0.0)
(* a1 (/ (/ a2 b2) b1))
(if (<= t_0 6.325887104397162e+303)
t_0
(* (/ (* (cbrt a2) (cbrt a2)) b1) (/ a1 (/ b2 (cbrt 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.57e-320) {
tmp = t_0;
} else if (t_0 <= 0.0) {
tmp = a1 * ((a2 / b2) / b1);
} else if (t_0 <= 6.325887104397162e+303) {
tmp = t_0;
} else {
tmp = ((cbrt(a2) * cbrt(a2)) / b1) * (a1 / (b2 / cbrt(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.5 |
if (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -inf.0Initial program 64.0
Applied associate-/l*_binary6433.0
Applied div-inv_binary6433.1
Simplified33.1
Applied *-un-lft-identity_binary6433.1
Applied times-frac_binary6419.7
Applied associate-*r*_binary6410.6
Simplified10.5
if -inf.0 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -5.5701e-320 or -0.0 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < 6.32588710439716204e303Initial program 0.9
if -5.5701e-320 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -0.0Initial program 13.8
Applied associate-/l*_binary648.1
Applied div-inv_binary648.1
Simplified8.1
Applied associate-/r*_binary644.0
if 6.32588710439716204e303 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) Initial program 63.5
Applied associate-/l*_binary6448.1
Applied add-cube-cbrt_binary6448.3
Applied times-frac_binary6414.5
Applied *-un-lft-identity_binary6414.5
Applied times-frac_binary646.2
Simplified6.2
Final simplification2.5
herbie shell --seed 2021273
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))