\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;b1 \cdot b2 \le -3.2418970626461063 \cdot 10^{+149}:\\
\;\;\;\;\frac{\frac{1}{b1}}{\frac{\frac{b2}{a1}}{a2}}\\
\mathbf{elif}\;b1 \cdot b2 \le -1.0084599578011689 \cdot 10^{-263}:\\
\;\;\;\;\frac{a1}{\frac{b1 \cdot b2}{a2}}\\
\mathbf{elif}\;b1 \cdot b2 \le 3.019673003289364 \cdot 10^{-116}:\\
\;\;\;\;\frac{\frac{a2}{\frac{b1}{a1}}}{b2}\\
\mathbf{elif}\;b1 \cdot b2 \le 2.5857146802439288 \cdot 10^{+182}:\\
\;\;\;\;\frac{a1}{\frac{b1 \cdot b2}{a2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{b1}}{\frac{\frac{b2}{a1}}{a2}}\\
\end{array}double f(double a1, double a2, double b1, double b2) {
double r5309537 = a1;
double r5309538 = a2;
double r5309539 = r5309537 * r5309538;
double r5309540 = b1;
double r5309541 = b2;
double r5309542 = r5309540 * r5309541;
double r5309543 = r5309539 / r5309542;
return r5309543;
}
double f(double a1, double a2, double b1, double b2) {
double r5309544 = b1;
double r5309545 = b2;
double r5309546 = r5309544 * r5309545;
double r5309547 = -3.2418970626461063e+149;
bool r5309548 = r5309546 <= r5309547;
double r5309549 = 1.0;
double r5309550 = r5309549 / r5309544;
double r5309551 = a1;
double r5309552 = r5309545 / r5309551;
double r5309553 = a2;
double r5309554 = r5309552 / r5309553;
double r5309555 = r5309550 / r5309554;
double r5309556 = -1.0084599578011689e-263;
bool r5309557 = r5309546 <= r5309556;
double r5309558 = r5309546 / r5309553;
double r5309559 = r5309551 / r5309558;
double r5309560 = 3.019673003289364e-116;
bool r5309561 = r5309546 <= r5309560;
double r5309562 = r5309544 / r5309551;
double r5309563 = r5309553 / r5309562;
double r5309564 = r5309563 / r5309545;
double r5309565 = 2.5857146802439288e+182;
bool r5309566 = r5309546 <= r5309565;
double r5309567 = r5309566 ? r5309559 : r5309555;
double r5309568 = r5309561 ? r5309564 : r5309567;
double r5309569 = r5309557 ? r5309559 : r5309568;
double r5309570 = r5309548 ? r5309555 : r5309569;
return r5309570;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.1 |
|---|---|
| Target | 10.9 |
| Herbie | 5.4 |
if (* b1 b2) < -3.2418970626461063e+149 or 2.5857146802439288e+182 < (* b1 b2) Initial program 14.6
rmApplied associate-/r*7.9
rmApplied *-un-lft-identity7.9
Applied associate-/r*7.9
Simplified5.5
rmApplied div-inv5.5
Applied *-un-lft-identity5.5
Applied times-frac7.9
Applied associate-/l*8.2
Simplified5.5
if -3.2418970626461063e+149 < (* b1 b2) < -1.0084599578011689e-263 or 3.019673003289364e-116 < (* b1 b2) < 2.5857146802439288e+182Initial program 3.8
rmApplied associate-/l*3.8
if -1.0084599578011689e-263 < (* b1 b2) < 3.019673003289364e-116Initial program 28.0
rmApplied associate-/r*15.4
rmApplied *-un-lft-identity15.4
Applied associate-/r*15.4
Simplified10.0
Final simplification5.4
herbie shell --seed 2019146 +o rules:numerics
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))