\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;b1 \cdot b2 = -\infty:\\
\;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\
\mathbf{elif}\;b1 \cdot b2 \le -4.233204880322462 \cdot 10^{-264}:\\
\;\;\;\;\frac{a1}{\frac{b1 \cdot b2}{a2}}\\
\mathbf{elif}\;b1 \cdot b2 \le 1.307211939997339 \cdot 10^{-147}:\\
\;\;\;\;\frac{\frac{1}{\frac{\frac{b1}{a1}}{a2}}}{b2}\\
\mathbf{elif}\;b1 \cdot b2 \le 3.65318349007526422 \cdot 10^{92}:\\
\;\;\;\;\frac{a1}{\frac{b1 \cdot b2}{a2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\frac{\frac{b1}{a1}}{a2}}}{b2}\\
\end{array}double f(double a1, double a2, double b1, double b2) {
double r92088 = a1;
double r92089 = a2;
double r92090 = r92088 * r92089;
double r92091 = b1;
double r92092 = b2;
double r92093 = r92091 * r92092;
double r92094 = r92090 / r92093;
return r92094;
}
double f(double a1, double a2, double b1, double b2) {
double r92095 = b1;
double r92096 = b2;
double r92097 = r92095 * r92096;
double r92098 = -inf.0;
bool r92099 = r92097 <= r92098;
double r92100 = a1;
double r92101 = r92100 / r92095;
double r92102 = a2;
double r92103 = r92102 / r92096;
double r92104 = r92101 * r92103;
double r92105 = -4.233204880322462e-264;
bool r92106 = r92097 <= r92105;
double r92107 = r92097 / r92102;
double r92108 = r92100 / r92107;
double r92109 = 1.3072119399973387e-147;
bool r92110 = r92097 <= r92109;
double r92111 = 1.0;
double r92112 = r92095 / r92100;
double r92113 = r92112 / r92102;
double r92114 = r92111 / r92113;
double r92115 = r92114 / r92096;
double r92116 = 3.653183490075264e+92;
bool r92117 = r92097 <= r92116;
double r92118 = r92117 ? r92108 : r92115;
double r92119 = r92110 ? r92115 : r92118;
double r92120 = r92106 ? r92108 : r92119;
double r92121 = r92099 ? r92104 : r92120;
return r92121;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 10.9 |
|---|---|
| Target | 11.1 |
| Herbie | 5.8 |
if (* b1 b2) < -inf.0Initial program 20.9
rmApplied times-frac2.0
if -inf.0 < (* b1 b2) < -4.233204880322462e-264 or 1.3072119399973387e-147 < (* b1 b2) < 3.653183490075264e+92Initial program 4.6
rmApplied associate-/l*4.9
if -4.233204880322462e-264 < (* b1 b2) < 1.3072119399973387e-147 or 3.653183490075264e+92 < (* b1 b2) Initial program 18.8
rmApplied associate-/r*11.6
rmApplied clear-num11.8
rmApplied associate-/r*8.3
Final simplification5.8
herbie shell --seed 2020018 +o rules:numerics
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))