\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;b1 \cdot b2 \le -3.0250245388054168 \cdot 10^{256}:\\
\;\;\;\;\frac{\frac{a1}{b1} \cdot a2}{b2}\\
\mathbf{elif}\;b1 \cdot b2 \le -4.04962770169091819 \cdot 10^{-94}:\\
\;\;\;\;a1 \cdot \left(a2 \cdot \frac{\frac{1}{b2}}{b1}\right)\\
\mathbf{elif}\;b1 \cdot b2 \le 3.18800829823527456 \cdot 10^{-295}:\\
\;\;\;\;\frac{\frac{a1}{b1} \cdot a2}{b2}\\
\mathbf{elif}\;b1 \cdot b2 \le 2.23031553909857134 \cdot 10^{300}:\\
\;\;\;\;a1 \cdot \left(a2 \cdot \frac{\frac{1}{b2}}{b1}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{a1 \cdot \frac{a2}{b2}}{b1}\\
\end{array}double f(double a1, double a2, double b1, double b2) {
double r165152 = a1;
double r165153 = a2;
double r165154 = r165152 * r165153;
double r165155 = b1;
double r165156 = b2;
double r165157 = r165155 * r165156;
double r165158 = r165154 / r165157;
return r165158;
}
double f(double a1, double a2, double b1, double b2) {
double r165159 = b1;
double r165160 = b2;
double r165161 = r165159 * r165160;
double r165162 = -3.025024538805417e+256;
bool r165163 = r165161 <= r165162;
double r165164 = a1;
double r165165 = r165164 / r165159;
double r165166 = a2;
double r165167 = r165165 * r165166;
double r165168 = r165167 / r165160;
double r165169 = -4.049627701690918e-94;
bool r165170 = r165161 <= r165169;
double r165171 = 1.0;
double r165172 = r165171 / r165160;
double r165173 = r165172 / r165159;
double r165174 = r165166 * r165173;
double r165175 = r165164 * r165174;
double r165176 = 3.1880082982352746e-295;
bool r165177 = r165161 <= r165176;
double r165178 = 2.2303155390985713e+300;
bool r165179 = r165161 <= r165178;
double r165180 = r165166 / r165160;
double r165181 = r165164 * r165180;
double r165182 = r165181 / r165159;
double r165183 = r165179 ? r165175 : r165182;
double r165184 = r165177 ? r165168 : r165183;
double r165185 = r165170 ? r165175 : r165184;
double r165186 = r165163 ? r165168 : r165185;
return r165186;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.9 |
|---|---|
| Target | 11.4 |
| Herbie | 5.5 |
if (* b1 b2) < -3.025024538805417e+256 or -4.049627701690918e-94 < (* b1 b2) < 3.1880082982352746e-295Initial program 24.1
rmApplied times-frac8.1
rmApplied associate-*r/7.5
if -3.025024538805417e+256 < (* b1 b2) < -4.049627701690918e-94 or 3.1880082982352746e-295 < (* b1 b2) < 2.2303155390985713e+300Initial program 5.4
rmApplied times-frac13.8
rmApplied div-inv13.8
Applied associate-*l*11.1
Simplified11.0
rmApplied *-un-lft-identity11.0
Applied div-inv11.1
Applied times-frac4.9
Simplified4.9
if 2.2303155390985713e+300 < (* b1 b2) Initial program 22.3
rmApplied times-frac2.8
rmApplied associate-*l/3.2
Final simplification5.5
herbie shell --seed 2020020
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))