\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;b1 \cdot b2 \le -4.452289351512009238820999151564290328377 \cdot 10^{155}:\\
\;\;\;\;\frac{\frac{a1}{b1} \cdot a2}{b2}\\
\mathbf{elif}\;b1 \cdot b2 \le -1.127744605900062648278972986449983094423 \cdot 10^{-225}:\\
\;\;\;\;\frac{a1 \cdot a2}{b2 \cdot b1}\\
\mathbf{elif}\;b1 \cdot b2 \le 1.537569596993452221139681688403437084805 \cdot 10^{-155}:\\
\;\;\;\;\frac{\frac{a1}{b1}}{\frac{b2}{a2}}\\
\mathbf{elif}\;b1 \cdot b2 \le 2.335339068356238477311146561514236710862 \cdot 10^{283}:\\
\;\;\;\;\frac{a1}{\frac{b1 \cdot b2}{a2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a1}{b1} \cdot a2}{b2}\\
\end{array}double f(double a1, double a2, double b1, double b2) {
double r125576 = a1;
double r125577 = a2;
double r125578 = r125576 * r125577;
double r125579 = b1;
double r125580 = b2;
double r125581 = r125579 * r125580;
double r125582 = r125578 / r125581;
return r125582;
}
double f(double a1, double a2, double b1, double b2) {
double r125583 = b1;
double r125584 = b2;
double r125585 = r125583 * r125584;
double r125586 = -4.452289351512009e+155;
bool r125587 = r125585 <= r125586;
double r125588 = a1;
double r125589 = r125588 / r125583;
double r125590 = a2;
double r125591 = r125589 * r125590;
double r125592 = r125591 / r125584;
double r125593 = -1.1277446059000626e-225;
bool r125594 = r125585 <= r125593;
double r125595 = r125588 * r125590;
double r125596 = r125584 * r125583;
double r125597 = r125595 / r125596;
double r125598 = 1.5375695969934522e-155;
bool r125599 = r125585 <= r125598;
double r125600 = r125584 / r125590;
double r125601 = r125589 / r125600;
double r125602 = 2.3353390683562385e+283;
bool r125603 = r125585 <= r125602;
double r125604 = r125585 / r125590;
double r125605 = r125588 / r125604;
double r125606 = r125603 ? r125605 : r125592;
double r125607 = r125599 ? r125601 : r125606;
double r125608 = r125594 ? r125597 : r125607;
double r125609 = r125587 ? r125592 : r125608;
return r125609;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.3 |
|---|---|
| Target | 10.9 |
| Herbie | 5.1 |
if (* b1 b2) < -4.452289351512009e+155 or 2.3353390683562385e+283 < (* b1 b2) Initial program 16.7
rmApplied times-frac4.6
rmApplied div-inv4.7
Applied associate-*r*4.6
rmApplied un-div-inv4.5
if -4.452289351512009e+155 < (* b1 b2) < -1.1277446059000626e-225Initial program 4.0
rmApplied times-frac15.0
rmApplied div-inv15.0
Applied associate-*r*15.7
rmApplied un-div-inv15.6
rmApplied associate-*l/11.6
Applied associate-/l/4.0
if -1.1277446059000626e-225 < (* b1 b2) < 1.5375695969934522e-155Initial program 30.2
rmApplied times-frac10.5
rmApplied div-inv10.5
Applied associate-*r*10.1
rmApplied un-div-inv10.0
rmApplied associate-/l*10.0
if 1.5375695969934522e-155 < (* b1 b2) < 2.3353390683562385e+283Initial program 4.6
rmApplied associate-/l*4.3
Final simplification5.1
herbie shell --seed 2019326 +o rules:numerics
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))