\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;b1 \cdot b2 \le -2.776996541214902 \cdot 10^{+242}:\\
\;\;\;\;\frac{\frac{a1}{b1}}{\frac{b2}{a2}}\\
\mathbf{elif}\;b1 \cdot b2 \le -1.2620149532156769 \cdot 10^{-221}:\\
\;\;\;\;\frac{a1}{\frac{1}{\frac{a2}{b1 \cdot b2}}}\\
\mathbf{elif}\;b1 \cdot b2 \le -0.0:\\
\;\;\;\;\frac{\frac{a1}{b1}}{\frac{b2}{a2}}\\
\mathbf{elif}\;b1 \cdot b2 \le 5.0652006343350663 \cdot 10^{+179}:\\
\;\;\;\;\frac{1}{\frac{\frac{b1 \cdot b2}{a2}}{a1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a1}{b1}}{\frac{b2}{a2}}\\
\end{array}double f(double a1, double a2, double b1, double b2) {
double r6338005 = a1;
double r6338006 = a2;
double r6338007 = r6338005 * r6338006;
double r6338008 = b1;
double r6338009 = b2;
double r6338010 = r6338008 * r6338009;
double r6338011 = r6338007 / r6338010;
return r6338011;
}
double f(double a1, double a2, double b1, double b2) {
double r6338012 = b1;
double r6338013 = b2;
double r6338014 = r6338012 * r6338013;
double r6338015 = -2.776996541214902e+242;
bool r6338016 = r6338014 <= r6338015;
double r6338017 = a1;
double r6338018 = r6338017 / r6338012;
double r6338019 = a2;
double r6338020 = r6338013 / r6338019;
double r6338021 = r6338018 / r6338020;
double r6338022 = -1.2620149532156769e-221;
bool r6338023 = r6338014 <= r6338022;
double r6338024 = 1.0;
double r6338025 = r6338019 / r6338014;
double r6338026 = r6338024 / r6338025;
double r6338027 = r6338017 / r6338026;
double r6338028 = -0.0;
bool r6338029 = r6338014 <= r6338028;
double r6338030 = 5.0652006343350663e+179;
bool r6338031 = r6338014 <= r6338030;
double r6338032 = r6338014 / r6338019;
double r6338033 = r6338032 / r6338017;
double r6338034 = r6338024 / r6338033;
double r6338035 = r6338031 ? r6338034 : r6338021;
double r6338036 = r6338029 ? r6338021 : r6338035;
double r6338037 = r6338023 ? r6338027 : r6338036;
double r6338038 = r6338016 ? r6338021 : r6338037;
return r6338038;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 10.7 |
|---|---|
| Target | 10.8 |
| Herbie | 5.0 |
if (* b1 b2) < -2.776996541214902e+242 or -1.2620149532156769e-221 < (* b1 b2) < -0.0 or 5.0652006343350663e+179 < (* b1 b2) Initial program 21.5
rmApplied associate-/l*21.8
rmApplied *-un-lft-identity21.8
Applied times-frac9.3
Simplified9.3
rmApplied associate-/r*4.9
if -2.776996541214902e+242 < (* b1 b2) < -1.2620149532156769e-221Initial program 4.6
rmApplied associate-/l*4.1
rmApplied clear-num4.4
if -0.0 < (* b1 b2) < 5.0652006343350663e+179Initial program 5.1
rmApplied associate-/l*5.3
rmApplied *-un-lft-identity5.3
Applied associate-/l*5.7
Final simplification5.0
herbie shell --seed 2019141 +o rules:numerics
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))