\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;\frac{a2 \cdot a1}{b2 \cdot b1} = -\infty:\\
\;\;\;\;\frac{\frac{a1}{b1}}{\frac{b2}{a2}}\\
\mathbf{elif}\;\frac{a2 \cdot a1}{b2 \cdot b1} \le -8.689229871317468393658322463867604866085 \cdot 10^{-264}:\\
\;\;\;\;\frac{a2 \cdot a1}{b2 \cdot b1}\\
\mathbf{elif}\;\frac{a2 \cdot a1}{b2 \cdot b1} \le -0.0:\\
\;\;\;\;a1 \cdot \frac{\frac{a2}{b1}}{b2}\\
\mathbf{elif}\;\frac{a2 \cdot a1}{b2 \cdot b1} \le 9.000995610168164344108674672461018222846 \cdot 10^{241}:\\
\;\;\;\;\frac{a2 \cdot a1}{b2 \cdot b1}\\
\mathbf{else}:\\
\;\;\;\;a1 \cdot \frac{\frac{a2}{b1}}{b2}\\
\end{array}double f(double a1, double a2, double b1, double b2) {
double r5672996 = a1;
double r5672997 = a2;
double r5672998 = r5672996 * r5672997;
double r5672999 = b1;
double r5673000 = b2;
double r5673001 = r5672999 * r5673000;
double r5673002 = r5672998 / r5673001;
return r5673002;
}
double f(double a1, double a2, double b1, double b2) {
double r5673003 = a2;
double r5673004 = a1;
double r5673005 = r5673003 * r5673004;
double r5673006 = b2;
double r5673007 = b1;
double r5673008 = r5673006 * r5673007;
double r5673009 = r5673005 / r5673008;
double r5673010 = -inf.0;
bool r5673011 = r5673009 <= r5673010;
double r5673012 = r5673004 / r5673007;
double r5673013 = r5673006 / r5673003;
double r5673014 = r5673012 / r5673013;
double r5673015 = -8.689229871317468e-264;
bool r5673016 = r5673009 <= r5673015;
double r5673017 = -0.0;
bool r5673018 = r5673009 <= r5673017;
double r5673019 = r5673003 / r5673007;
double r5673020 = r5673019 / r5673006;
double r5673021 = r5673004 * r5673020;
double r5673022 = 9.000995610168164e+241;
bool r5673023 = r5673009 <= r5673022;
double r5673024 = r5673023 ? r5673009 : r5673021;
double r5673025 = r5673018 ? r5673021 : r5673024;
double r5673026 = r5673016 ? r5673009 : r5673025;
double r5673027 = r5673011 ? r5673014 : r5673026;
return r5673027;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.5 |
|---|---|
| Target | 11.2 |
| Herbie | 3.8 |
if (/ (* a1 a2) (* b1 b2)) < -inf.0Initial program 64.0
rmApplied associate-/l*29.4
rmApplied *-un-lft-identity29.4
Applied times-frac13.2
Applied associate-/r*11.1
Simplified11.1
if -inf.0 < (/ (* a1 a2) (* b1 b2)) < -8.689229871317468e-264 or -0.0 < (/ (* a1 a2) (* b1 b2)) < 9.000995610168164e+241Initial program 0.9
rmApplied associate-/l*7.1
Taylor expanded around 0 0.9
if -8.689229871317468e-264 < (/ (* a1 a2) (* b1 b2)) < -0.0 or 9.000995610168164e+241 < (/ (* a1 a2) (* b1 b2)) Initial program 20.9
rmApplied associate-/l*15.0
rmApplied div-inv15.2
Simplified7.0
Final simplification3.8
herbie shell --seed 2019200
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))