\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} = -\infty:\\
\;\;\;\;\left(\frac{1}{b2} \cdot \frac{a2}{b1}\right) \cdot a1\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le -1.859026544525180769940658588695383877197 \cdot 10^{-313}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le -0.0:\\
\;\;\;\;\frac{1}{b2} \cdot \left(\frac{a2}{b1} \cdot a1\right)\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le 1.990908588070363276139871141296651621269 \cdot 10^{287}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{else}:\\
\;\;\;\;\frac{a2}{b2} \cdot \frac{a1}{b1}\\
\end{array}double f(double a1, double a2, double b1, double b2) {
double r5696412 = a1;
double r5696413 = a2;
double r5696414 = r5696412 * r5696413;
double r5696415 = b1;
double r5696416 = b2;
double r5696417 = r5696415 * r5696416;
double r5696418 = r5696414 / r5696417;
return r5696418;
}
double f(double a1, double a2, double b1, double b2) {
double r5696419 = a1;
double r5696420 = a2;
double r5696421 = r5696419 * r5696420;
double r5696422 = b1;
double r5696423 = b2;
double r5696424 = r5696422 * r5696423;
double r5696425 = r5696421 / r5696424;
double r5696426 = -inf.0;
bool r5696427 = r5696425 <= r5696426;
double r5696428 = 1.0;
double r5696429 = r5696428 / r5696423;
double r5696430 = r5696420 / r5696422;
double r5696431 = r5696429 * r5696430;
double r5696432 = r5696431 * r5696419;
double r5696433 = -1.8590265445252e-313;
bool r5696434 = r5696425 <= r5696433;
double r5696435 = -0.0;
bool r5696436 = r5696425 <= r5696435;
double r5696437 = r5696430 * r5696419;
double r5696438 = r5696429 * r5696437;
double r5696439 = 1.9909085880703633e+287;
bool r5696440 = r5696425 <= r5696439;
double r5696441 = r5696420 / r5696423;
double r5696442 = r5696419 / r5696422;
double r5696443 = r5696441 * r5696442;
double r5696444 = r5696440 ? r5696425 : r5696443;
double r5696445 = r5696436 ? r5696438 : r5696444;
double r5696446 = r5696434 ? r5696425 : r5696445;
double r5696447 = r5696427 ? r5696432 : r5696446;
return r5696447;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.3 |
|---|---|
| Target | 11.4 |
| Herbie | 2.6 |
if (/ (* a1 a2) (* b1 b2)) < -inf.0Initial program 64.0
rmApplied associate-/l*28.6
rmApplied div-inv28.7
Simplified14.0
rmApplied div-inv14.1
if -inf.0 < (/ (* a1 a2) (* b1 b2)) < -1.8590265445252e-313 or -0.0 < (/ (* a1 a2) (* b1 b2)) < 1.9909085880703633e+287Initial program 0.8
rmApplied associate-/l*7.7
rmApplied div-inv8.1
Simplified14.2
rmApplied div-inv14.3
Applied associate-*r*14.6
rmApplied associate-*r/7.9
Applied frac-times0.8
Simplified0.8
if -1.8590265445252e-313 < (/ (* a1 a2) (* b1 b2)) < -0.0Initial program 12.9
rmApplied associate-/l*6.6
rmApplied div-inv6.7
Simplified3.1
rmApplied div-inv3.1
Applied associate-*r*3.3
if 1.9909085880703633e+287 < (/ (* a1 a2) (* b1 b2)) Initial program 58.9
rmApplied times-frac8.3
Final simplification2.6
herbie shell --seed 2019171
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))