\frac{a1 \cdot a2}{b1 \cdot b2}\begin{array}{l}
\mathbf{if}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le -1.002329447227761808147469830815412761507 \cdot 10^{264}:\\
\;\;\;\;\frac{\frac{a1}{b1}}{\frac{b2}{a2}}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le -2.941470907051121937881790391096071314592 \cdot 10^{-294}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le 2.304552242205900595612811993092939692084 \cdot 10^{-302}:\\
\;\;\;\;\frac{\frac{a1}{b1}}{\frac{b2}{a2}}\\
\mathbf{elif}\;\frac{a1 \cdot a2}{b1 \cdot b2} \le 1.501180578243183430701187487175576593932 \cdot 10^{300}:\\
\;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\
\mathbf{else}:\\
\;\;\;\;\frac{a1}{b2} \cdot \left(\frac{1}{b1} \cdot a2\right)\\
\end{array}double f(double a1, double a2, double b1, double b2) {
double r138839 = a1;
double r138840 = a2;
double r138841 = r138839 * r138840;
double r138842 = b1;
double r138843 = b2;
double r138844 = r138842 * r138843;
double r138845 = r138841 / r138844;
return r138845;
}
double f(double a1, double a2, double b1, double b2) {
double r138846 = a1;
double r138847 = a2;
double r138848 = r138846 * r138847;
double r138849 = b1;
double r138850 = b2;
double r138851 = r138849 * r138850;
double r138852 = r138848 / r138851;
double r138853 = -1.0023294472277618e+264;
bool r138854 = r138852 <= r138853;
double r138855 = r138846 / r138849;
double r138856 = r138850 / r138847;
double r138857 = r138855 / r138856;
double r138858 = -2.941470907051122e-294;
bool r138859 = r138852 <= r138858;
double r138860 = 2.3045522422059006e-302;
bool r138861 = r138852 <= r138860;
double r138862 = 1.5011805782431834e+300;
bool r138863 = r138852 <= r138862;
double r138864 = r138846 / r138850;
double r138865 = 1.0;
double r138866 = r138865 / r138849;
double r138867 = r138866 * r138847;
double r138868 = r138864 * r138867;
double r138869 = r138863 ? r138852 : r138868;
double r138870 = r138861 ? r138857 : r138869;
double r138871 = r138859 ? r138852 : r138870;
double r138872 = r138854 ? r138857 : r138871;
return r138872;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.5 |
|---|---|
| Target | 11.4 |
| Herbie | 2.7 |
if (/ (* a1 a2) (* b1 b2)) < -1.0023294472277618e+264 or -2.941470907051122e-294 < (/ (* a1 a2) (* b1 b2)) < 2.3045522422059006e-302Initial program 17.9
rmApplied times-frac4.8
rmApplied associate-*r/6.4
rmApplied associate-/l*4.8
if -1.0023294472277618e+264 < (/ (* a1 a2) (* b1 b2)) < -2.941470907051122e-294 or 2.3045522422059006e-302 < (/ (* a1 a2) (* b1 b2)) < 1.5011805782431834e+300Initial program 0.8
rmApplied times-frac16.5
rmApplied associate-*r/14.4
rmApplied associate-/l*16.4
Taylor expanded around 0 0.8
if 1.5011805782431834e+300 < (/ (* a1 a2) (* b1 b2)) Initial program 61.7
rmApplied times-frac7.2
rmApplied associate-*r/15.4
rmApplied associate-/l*7.0
rmApplied div-inv7.1
Applied div-inv7.1
Applied times-frac5.8
Simplified5.8
Final simplification2.7
herbie shell --seed 2019354 +o rules:numerics
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))