\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;b1 \cdot b2 \le -8.468172603848108220180232219464164813833 \cdot 10^{70}:\\
\;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\
\mathbf{elif}\;b1 \cdot b2 \le -6.72354558279401312652197739398469610707 \cdot 10^{-110}:\\
\;\;\;\;\frac{a2 \cdot a1}{b1 \cdot b2}\\
\mathbf{elif}\;b1 \cdot b2 \le -7.879034991079353473964043405516768477683 \cdot 10^{-195}:\\
\;\;\;\;\frac{\frac{a2}{b2}}{b1} \cdot a1\\
\mathbf{elif}\;b1 \cdot b2 \le -4.802620426891657887802294832116642457905 \cdot 10^{-258}:\\
\;\;\;\;\frac{a2 \cdot a1}{b1 \cdot b2}\\
\mathbf{elif}\;b1 \cdot b2 \le 1.073716929976885382619318839914274699583 \cdot 10^{-232}:\\
\;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\
\mathbf{elif}\;b1 \cdot b2 \le 1.599269239471855967164130916465496234962 \cdot 10^{63}:\\
\;\;\;\;\frac{a2 \cdot a1}{b1 \cdot b2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a2}{b2}}{b1} \cdot a1\\
\end{array}double f(double a1, double a2, double b1, double b2) {
double r103920 = a1;
double r103921 = a2;
double r103922 = r103920 * r103921;
double r103923 = b1;
double r103924 = b2;
double r103925 = r103923 * r103924;
double r103926 = r103922 / r103925;
return r103926;
}
double f(double a1, double a2, double b1, double b2) {
double r103927 = b1;
double r103928 = b2;
double r103929 = r103927 * r103928;
double r103930 = -8.468172603848108e+70;
bool r103931 = r103929 <= r103930;
double r103932 = a1;
double r103933 = r103932 / r103927;
double r103934 = a2;
double r103935 = r103934 / r103928;
double r103936 = r103933 * r103935;
double r103937 = -6.723545582794013e-110;
bool r103938 = r103929 <= r103937;
double r103939 = r103934 * r103932;
double r103940 = r103939 / r103929;
double r103941 = -7.879034991079353e-195;
bool r103942 = r103929 <= r103941;
double r103943 = r103935 / r103927;
double r103944 = r103943 * r103932;
double r103945 = -4.802620426891658e-258;
bool r103946 = r103929 <= r103945;
double r103947 = 1.0737169299768854e-232;
bool r103948 = r103929 <= r103947;
double r103949 = 1.599269239471856e+63;
bool r103950 = r103929 <= r103949;
double r103951 = r103950 ? r103940 : r103944;
double r103952 = r103948 ? r103936 : r103951;
double r103953 = r103946 ? r103940 : r103952;
double r103954 = r103942 ? r103944 : r103953;
double r103955 = r103938 ? r103940 : r103954;
double r103956 = r103931 ? r103936 : r103955;
return r103956;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.5 |
|---|---|
| Target | 11.3 |
| Herbie | 6.8 |
if (* b1 b2) < -8.468172603848108e+70 or -4.802620426891658e-258 < (* b1 b2) < 1.0737169299768854e-232Initial program 20.1
Simplified20.4
rmApplied *-un-lft-identity20.4
Applied times-frac12.2
Applied associate-*r*8.0
Simplified8.0
if -8.468172603848108e+70 < (* b1 b2) < -6.723545582794013e-110 or -7.879034991079353e-195 < (* b1 b2) < -4.802620426891658e-258 or 1.0737169299768854e-232 < (* b1 b2) < 1.599269239471856e+63Initial program 4.2
Simplified4.4
rmApplied associate-*r/4.2
Simplified4.2
if -6.723545582794013e-110 < (* b1 b2) < -7.879034991079353e-195 or 1.599269239471856e+63 < (* b1 b2) Initial program 11.4
Simplified10.9
rmApplied *-un-lft-identity10.9
Applied times-frac9.0
Applied associate-*r*8.6
Simplified8.6
rmApplied div-inv8.6
Applied associate-*l*9.0
Simplified9.0
Final simplification6.8
herbie shell --seed 2019195
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))