\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 r162840 = a1;
double r162841 = a2;
double r162842 = r162840 * r162841;
double r162843 = b1;
double r162844 = b2;
double r162845 = r162843 * r162844;
double r162846 = r162842 / r162845;
return r162846;
}
double f(double a1, double a2, double b1, double b2) {
double r162847 = b1;
double r162848 = b2;
double r162849 = r162847 * r162848;
double r162850 = -inf.0;
bool r162851 = r162849 <= r162850;
double r162852 = a1;
double r162853 = r162852 / r162847;
double r162854 = a2;
double r162855 = r162854 / r162848;
double r162856 = r162853 * r162855;
double r162857 = -4.233204880322462e-264;
bool r162858 = r162849 <= r162857;
double r162859 = r162849 / r162854;
double r162860 = r162852 / r162859;
double r162861 = 1.3072119399973387e-147;
bool r162862 = r162849 <= r162861;
double r162863 = 1.0;
double r162864 = r162847 / r162852;
double r162865 = r162864 / r162854;
double r162866 = r162863 / r162865;
double r162867 = r162866 / r162848;
double r162868 = 3.653183490075264e+92;
bool r162869 = r162849 <= r162868;
double r162870 = r162869 ? r162860 : r162867;
double r162871 = r162862 ? r162867 : r162870;
double r162872 = r162858 ? r162860 : r162871;
double r162873 = r162851 ? r162856 : r162872;
return r162873;
}




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
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))