\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} = -\infty:\\
\;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le -8.016116290645056929955993350528318122349 \cdot 10^{-318}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le -0.0:\\
\;\;\;\;\frac{a1}{\sqrt[3]{b1} \cdot \sqrt[3]{b1}} \cdot \frac{\frac{a2}{\sqrt[3]{b1}}}{b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le 8.081691575865167132123952523399231935896 \cdot 10^{299}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{else}:\\
\;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\
\end{array}double f(double a1, double a2, double b1, double b2) {
double r155589 = a1;
double r155590 = a2;
double r155591 = r155589 * r155590;
double r155592 = b1;
double r155593 = b2;
double r155594 = r155592 * r155593;
double r155595 = r155591 / r155594;
return r155595;
}
double f(double a1, double a2, double b1, double b2) {
double r155596 = a1;
double r155597 = a2;
double r155598 = r155596 * r155597;
double r155599 = b1;
double r155600 = b2;
double r155601 = r155599 * r155600;
double r155602 = r155598 / r155601;
double r155603 = -inf.0;
bool r155604 = r155602 <= r155603;
double r155605 = r155596 / r155599;
double r155606 = r155597 / r155600;
double r155607 = r155605 * r155606;
double r155608 = -8.0161162906451e-318;
bool r155609 = r155602 <= r155608;
double r155610 = -0.0;
bool r155611 = r155602 <= r155610;
double r155612 = cbrt(r155599);
double r155613 = r155612 * r155612;
double r155614 = r155596 / r155613;
double r155615 = r155597 / r155612;
double r155616 = r155615 / r155600;
double r155617 = r155614 * r155616;
double r155618 = 8.081691575865167e+299;
bool r155619 = r155602 <= r155618;
double r155620 = r155619 ? r155602 : r155607;
double r155621 = r155611 ? r155617 : r155620;
double r155622 = r155609 ? r155602 : r155621;
double r155623 = r155604 ? r155607 : r155622;
return r155623;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 10.8 |
|---|---|
| Target | 11.5 |
| Herbie | 1.9 |
if (/ (* a1 a2) (* b1 b2)) < -inf.0 or 8.081691575865167e+299 < (/ (* a1 a2) (* b1 b2)) Initial program 62.5
rmApplied times-frac8.6
if -inf.0 < (/ (* a1 a2) (* b1 b2)) < -8.0161162906451e-318 or -0.0 < (/ (* a1 a2) (* b1 b2)) < 8.081691575865167e+299Initial program 3.4
rmApplied associate-/r*7.8
rmApplied *-un-lft-identity7.8
Applied add-cube-cbrt8.5
Applied times-frac12.1
Applied times-frac12.5
Simplified12.5
rmApplied *-un-lft-identity12.5
Applied associate-*l*12.5
Simplified3.4
if -8.0161162906451e-318 < (/ (* a1 a2) (* b1 b2)) < -0.0Initial program 13.6
rmApplied associate-/r*6.5
rmApplied *-un-lft-identity6.5
Applied add-cube-cbrt6.6
Applied times-frac3.3
Applied times-frac2.1
Simplified2.1
Final simplification1.9
herbie shell --seed 2019322 +o rules:numerics
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))