\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}{\frac{b1}{\frac{a2}{b2}}}\\
\mathbf{elif}\;t_0 \leq -3.44917 \cdot 10^{-319} \lor \neg \left(t_0 \leq 0\right) \land t_0 \leq 4.0160797858835715 \cdot 10^{+299}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a2}{\sqrt[3]{b1} \cdot \sqrt[3]{b1}}}{\frac{b2}{\frac{a1}{\sqrt[3]{b1}}}}\\
\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 (/ b1 (/ a2 b2)))
(if (or (<= t_0 -3.44917e-319)
(and (not (<= t_0 0.0)) (<= t_0 4.0160797858835715e+299)))
t_0
(/ (/ a2 (* (cbrt b1) (cbrt b1))) (/ b2 (/ a1 (cbrt 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 t_0 = (a1 * a2) / (b1 * b2);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = a1 / (b1 / (a2 / b2));
} else if ((t_0 <= -3.44917e-319) || (!(t_0 <= 0.0) && (t_0 <= 4.0160797858835715e+299))) {
tmp = t_0;
} else {
tmp = (a2 / (cbrt(b1) * cbrt(b1))) / (b2 / (a1 / cbrt(b1)));
}
return tmp;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.4 |
|---|---|
| Target | 11.4 |
| Herbie | 2.3 |
if (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -inf.0Initial program 64.0
Applied associate-/l*_binary6434.6
Simplified17.3
if -inf.0 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -3.44917e-319 or -0.0 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < 4.01607978588357146e299Initial program 0.7
if -3.44917e-319 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) < -0.0 or 4.01607978588357146e299 < (/.f64 (*.f64 a1 a2) (*.f64 b1 b2)) Initial program 23.2
Applied associate-/r*_binary6414.5
Simplified5.8
Applied associate-/l*_binary645.8
Applied add-cube-cbrt_binary646.0
Applied *-un-lft-identity_binary646.0
Applied times-frac_binary646.0
Applied *-un-lft-identity_binary646.0
Applied times-frac_binary645.7
Applied associate-/r*_binary643.3
Simplified3.3
Final simplification2.3
herbie shell --seed 2021275
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))