\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;b2 \cdot b1 \le -5.027198331468452971083277390987079564256 \cdot 10^{271}:\\
\;\;\;\;\frac{a2}{b2} \cdot \frac{a1}{b1}\\
\mathbf{elif}\;b2 \cdot b1 \le -1.708279358278811067826228393370497973053 \cdot 10^{-240}:\\
\;\;\;\;\frac{a1}{b2 \cdot b1} \cdot a2\\
\mathbf{elif}\;b2 \cdot b1 \le 2.491183802213925616452581733594161045108 \cdot 10^{-239}:\\
\;\;\;\;\frac{1}{b1} \cdot \frac{a1}{\frac{b2}{a2}}\\
\mathbf{elif}\;b2 \cdot b1 \le 3.274003468956291087635927220582233224264 \cdot 10^{201}:\\
\;\;\;\;\frac{a1}{b2 \cdot b1} \cdot a2\\
\mathbf{else}:\\
\;\;\;\;\frac{a2}{b2} \cdot \frac{a1}{b1}\\
\end{array}double f(double a1, double a2, double b1, double b2) {
double r3822286 = a1;
double r3822287 = a2;
double r3822288 = r3822286 * r3822287;
double r3822289 = b1;
double r3822290 = b2;
double r3822291 = r3822289 * r3822290;
double r3822292 = r3822288 / r3822291;
return r3822292;
}
double f(double a1, double a2, double b1, double b2) {
double r3822293 = b2;
double r3822294 = b1;
double r3822295 = r3822293 * r3822294;
double r3822296 = -5.027198331468453e+271;
bool r3822297 = r3822295 <= r3822296;
double r3822298 = a2;
double r3822299 = r3822298 / r3822293;
double r3822300 = a1;
double r3822301 = r3822300 / r3822294;
double r3822302 = r3822299 * r3822301;
double r3822303 = -1.708279358278811e-240;
bool r3822304 = r3822295 <= r3822303;
double r3822305 = r3822300 / r3822295;
double r3822306 = r3822305 * r3822298;
double r3822307 = 2.4911838022139256e-239;
bool r3822308 = r3822295 <= r3822307;
double r3822309 = 1.0;
double r3822310 = r3822309 / r3822294;
double r3822311 = r3822293 / r3822298;
double r3822312 = r3822300 / r3822311;
double r3822313 = r3822310 * r3822312;
double r3822314 = 3.274003468956291e+201;
bool r3822315 = r3822295 <= r3822314;
double r3822316 = r3822315 ? r3822306 : r3822302;
double r3822317 = r3822308 ? r3822313 : r3822316;
double r3822318 = r3822304 ? r3822306 : r3822317;
double r3822319 = r3822297 ? r3822302 : r3822318;
return r3822319;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.5 |
|---|---|
| Target | 11.2 |
| Herbie | 5.0 |
if (* b1 b2) < -5.027198331468453e+271 or 3.274003468956291e+201 < (* b1 b2) Initial program 17.4
rmApplied times-frac3.7
if -5.027198331468453e+271 < (* b1 b2) < -1.708279358278811e-240 or 2.4911838022139256e-239 < (* b1 b2) < 3.274003468956291e+201Initial program 4.9
rmApplied associate-/l*4.6
rmApplied associate-/r/4.9
if -1.708279358278811e-240 < (* b1 b2) < 2.4911838022139256e-239Initial program 40.3
rmApplied associate-/l*39.4
rmApplied *-un-lft-identity39.4
Applied times-frac17.8
Applied *-un-lft-identity17.8
Applied times-frac8.9
Simplified8.9
Final simplification5.0
herbie shell --seed 2019200 +o rules:numerics
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))