\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;b1 \cdot b2 \le -6.770256909762417 \cdot 10^{+247}:\\
\;\;\;\;\frac{a2}{\frac{b1}{a1}} \cdot \frac{1}{b2}\\
\mathbf{elif}\;b1 \cdot b2 \le -2.5972175215851213 \cdot 10^{-303}:\\
\;\;\;\;\frac{a1}{\frac{b1 \cdot b2}{a2}}\\
\mathbf{elif}\;b1 \cdot b2 \le 1.089678327652975 \cdot 10^{-177}:\\
\;\;\;\;\frac{a2}{\frac{b1}{a1}} \cdot \frac{1}{b2}\\
\mathbf{elif}\;b1 \cdot b2 \le 2.3504500220205782 \cdot 10^{+185}:\\
\;\;\;\;\frac{a1}{\frac{b1 \cdot b2}{a2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{a2}{\frac{b1}{a1}} \cdot \frac{1}{b2}\\
\end{array}double f(double a1, double a2, double b1, double b2) {
double r7277788 = a1;
double r7277789 = a2;
double r7277790 = r7277788 * r7277789;
double r7277791 = b1;
double r7277792 = b2;
double r7277793 = r7277791 * r7277792;
double r7277794 = r7277790 / r7277793;
return r7277794;
}
double f(double a1, double a2, double b1, double b2) {
double r7277795 = b1;
double r7277796 = b2;
double r7277797 = r7277795 * r7277796;
double r7277798 = -6.770256909762417e+247;
bool r7277799 = r7277797 <= r7277798;
double r7277800 = a2;
double r7277801 = a1;
double r7277802 = r7277795 / r7277801;
double r7277803 = r7277800 / r7277802;
double r7277804 = 1.0;
double r7277805 = r7277804 / r7277796;
double r7277806 = r7277803 * r7277805;
double r7277807 = -2.5972175215851213e-303;
bool r7277808 = r7277797 <= r7277807;
double r7277809 = r7277797 / r7277800;
double r7277810 = r7277801 / r7277809;
double r7277811 = 1.089678327652975e-177;
bool r7277812 = r7277797 <= r7277811;
double r7277813 = 2.3504500220205782e+185;
bool r7277814 = r7277797 <= r7277813;
double r7277815 = r7277814 ? r7277810 : r7277806;
double r7277816 = r7277812 ? r7277806 : r7277815;
double r7277817 = r7277808 ? r7277810 : r7277816;
double r7277818 = r7277799 ? r7277806 : r7277817;
return r7277818;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 10.9 |
|---|---|
| Target | 10.9 |
| Herbie | 5.0 |
if (* b1 b2) < -6.770256909762417e+247 or -2.5972175215851213e-303 < (* b1 b2) < 1.089678327652975e-177 or 2.3504500220205782e+185 < (* b1 b2) Initial program 21.4
rmApplied associate-/r*10.0
rmApplied *-un-lft-identity10.0
Applied associate-/r*10.0
Simplified6.2
rmApplied div-inv6.2
if -6.770256909762417e+247 < (* b1 b2) < -2.5972175215851213e-303 or 1.089678327652975e-177 < (* b1 b2) < 2.3504500220205782e+185Initial program 4.8
rmApplied associate-/l*4.3
Final simplification5.0
herbie shell --seed 2019168
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))