\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 r129802 = a1;
double r129803 = a2;
double r129804 = r129802 * r129803;
double r129805 = b1;
double r129806 = b2;
double r129807 = r129805 * r129806;
double r129808 = r129804 / r129807;
return r129808;
}
double f(double a1, double a2, double b1, double b2) {
double r129809 = a1;
double r129810 = a2;
double r129811 = r129809 * r129810;
double r129812 = b1;
double r129813 = b2;
double r129814 = r129812 * r129813;
double r129815 = r129811 / r129814;
double r129816 = -1.6828003633594403e+301;
bool r129817 = r129815 <= r129816;
double r129818 = r129810 / r129812;
double r129819 = r129809 * r129818;
double r129820 = 1.0;
double r129821 = r129820 / r129813;
double r129822 = r129819 * r129821;
double r129823 = -4.520444799089932e-307;
bool r129824 = r129815 <= r129823;
double r129825 = 0.0;
bool r129826 = r129815 <= r129825;
double r129827 = r129810 / r129813;
double r129828 = r129812 / r129827;
double r129829 = r129809 / r129828;
double r129830 = 4.517334051010812e+288;
bool r129831 = r129815 <= r129830;
double r129832 = r129831 ? r129815 : r129822;
double r129833 = r129826 ? r129829 : r129832;
double r129834 = r129824 ? r129815 : r129833;
double r129835 = r129817 ? r129822 : r129834;
return r129835;
}




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*13.7
Taylor expanded around 0 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 +o rules:numerics
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))