\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le -1.68280036335944034 \cdot 10^{301}:\\
\;\;\;\;\left(a1 \cdot \frac{a2}{b1}\right) \cdot \frac{1}{b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le -4.5204447990899316 \cdot 10^{-307}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le 0.0:\\
\;\;\;\;\frac{a1}{\frac{b1}{\frac{a2}{b2}}}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le 4.51733405101081216 \cdot 10^{288}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{else}:\\
\;\;\;\;\left(a1 \cdot \frac{a2}{b1}\right) \cdot \frac{1}{b2}\\
\end{array}double f(double a1, double a2, double b1, double b2) {
double r165801 = a1;
double r165802 = a2;
double r165803 = r165801 * r165802;
double r165804 = b1;
double r165805 = b2;
double r165806 = r165804 * r165805;
double r165807 = r165803 / r165806;
return r165807;
}
double f(double a1, double a2, double b1, double b2) {
double r165808 = a1;
double r165809 = a2;
double r165810 = r165808 * r165809;
double r165811 = b1;
double r165812 = b2;
double r165813 = r165811 * r165812;
double r165814 = r165810 / r165813;
double r165815 = -1.6828003633594403e+301;
bool r165816 = r165814 <= r165815;
double r165817 = r165809 / r165811;
double r165818 = r165808 * r165817;
double r165819 = 1.0;
double r165820 = r165819 / r165812;
double r165821 = r165818 * r165820;
double r165822 = -4.520444799089932e-307;
bool r165823 = r165814 <= r165822;
double r165824 = 0.0;
bool r165825 = r165814 <= r165824;
double r165826 = r165809 / r165812;
double r165827 = r165811 / r165826;
double r165828 = r165808 / r165827;
double r165829 = 4.517334051010812e+288;
bool r165830 = r165814 <= r165829;
double r165831 = r165830 ? r165814 : r165821;
double r165832 = r165825 ? r165828 : r165831;
double r165833 = r165823 ? r165814 : r165832;
double r165834 = r165816 ? r165821 : r165833;
return r165834;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.4 |
|---|---|
| Target | 11.5 |
| Herbie | 3.4 |
if (/ (* a1 a2) (* b1 b2)) < -1.6828003633594403e+301 or 4.517334051010812e+288 < (/ (* a1 a2) (* b1 b2)) Initial program 59.3
rmApplied associate-/l*39.8
rmApplied div-inv39.9
Simplified39.8
rmApplied associate-/r*15.2
rmApplied div-inv15.3
Applied associate-*r*14.9
if -1.6828003633594403e+301 < (/ (* a1 a2) (* b1 b2)) < -4.520444799089932e-307 or 0.0 < (/ (* a1 a2) (* b1 b2)) < 4.517334051010812e+288Initial program 0.8
rmApplied associate-/l*7.3
rmApplied div-inv7.6
Simplified7.3
rmApplied associate-*r/0.8
if -4.520444799089932e-307 < (/ (* a1 a2) (* b1 b2)) < 0.0Initial program 13.1
rmApplied associate-/l*7.1
rmApplied associate-/l*3.8
Final simplification3.4
herbie shell --seed 2020060
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))