\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;b1 \cdot b2 \le -1.512192312330299 \cdot 10^{168}:\\
\;\;\;\;\frac{a1 \cdot \frac{a2}{b2}}{b1}\\
\mathbf{elif}\;b1 \cdot b2 \le -1.78311602156644772 \cdot 10^{-257}:\\
\;\;\;\;\left(a1 \cdot a2\right) \cdot \frac{1}{b1 \cdot b2}\\
\mathbf{elif}\;b1 \cdot b2 \le 5.89224416336 \cdot 10^{-314}:\\
\;\;\;\;\frac{1}{\frac{\frac{b2}{a2}}{a1} \cdot b1}\\
\mathbf{elif}\;b1 \cdot b2 \le 1.7927717050604466 \cdot 10^{257}:\\
\;\;\;\;\left(a1 \cdot a2\right) \cdot \frac{1}{b1 \cdot b2}\\
\mathbf{else}:\\
\;\;\;\;\frac{a1 \cdot \frac{a2}{b2}}{b1}\\
\end{array}double f(double a1, double a2, double b1, double b2) {
double r121476 = a1;
double r121477 = a2;
double r121478 = r121476 * r121477;
double r121479 = b1;
double r121480 = b2;
double r121481 = r121479 * r121480;
double r121482 = r121478 / r121481;
return r121482;
}
double f(double a1, double a2, double b1, double b2) {
double r121483 = b1;
double r121484 = b2;
double r121485 = r121483 * r121484;
double r121486 = -1.512192312330299e+168;
bool r121487 = r121485 <= r121486;
double r121488 = a1;
double r121489 = a2;
double r121490 = r121489 / r121484;
double r121491 = r121488 * r121490;
double r121492 = r121491 / r121483;
double r121493 = -1.7831160215664477e-257;
bool r121494 = r121485 <= r121493;
double r121495 = r121488 * r121489;
double r121496 = 1.0;
double r121497 = r121496 / r121485;
double r121498 = r121495 * r121497;
double r121499 = 5.8922441633555e-314;
bool r121500 = r121485 <= r121499;
double r121501 = r121484 / r121489;
double r121502 = r121501 / r121488;
double r121503 = r121502 * r121483;
double r121504 = r121496 / r121503;
double r121505 = 1.7927717050604466e+257;
bool r121506 = r121485 <= r121505;
double r121507 = r121506 ? r121498 : r121492;
double r121508 = r121500 ? r121504 : r121507;
double r121509 = r121494 ? r121498 : r121508;
double r121510 = r121487 ? r121492 : r121509;
return r121510;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.3 |
|---|---|
| Target | 11.3 |
| Herbie | 5.5 |
if (* b1 b2) < -1.512192312330299e+168 or 1.7927717050604466e+257 < (* b1 b2) Initial program 15.6
rmApplied associate-/r*7.8
rmApplied clear-num8.4
rmApplied associate-/r/8.6
Applied associate-/r*8.0
Simplified4.6
if -1.512192312330299e+168 < (* b1 b2) < -1.7831160215664477e-257 or 5.8922441633555e-314 < (* b1 b2) < 1.7927717050604466e+257Initial program 5.4
rmApplied div-inv5.5
if -1.7831160215664477e-257 < (* b1 b2) < 5.8922441633555e-314Initial program 50.6
rmApplied associate-/r*20.2
rmApplied clear-num20.3
rmApplied associate-/r/20.3
Simplified7.9
Final simplification5.5
herbie shell --seed 2020042
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))