\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\begin{array}{l}
\mathbf{if}\;y.re \le 2.2577310345661958 \cdot 10^{167}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right) \cdot 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot 1}\\
\end{array}double f(double x_re, double x_im, double y_re, double y_im) {
double r60982 = x_re;
double r60983 = y_re;
double r60984 = r60982 * r60983;
double r60985 = x_im;
double r60986 = y_im;
double r60987 = r60985 * r60986;
double r60988 = r60984 + r60987;
double r60989 = r60983 * r60983;
double r60990 = r60986 * r60986;
double r60991 = r60989 + r60990;
double r60992 = r60988 / r60991;
return r60992;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r60993 = y_re;
double r60994 = 2.2577310345661958e+167;
bool r60995 = r60993 <= r60994;
double r60996 = x_re;
double r60997 = x_im;
double r60998 = y_im;
double r60999 = r60997 * r60998;
double r61000 = fma(r60996, r60993, r60999);
double r61001 = hypot(r60993, r60998);
double r61002 = r61000 / r61001;
double r61003 = 1.0;
double r61004 = r61001 * r61003;
double r61005 = r61002 / r61004;
double r61006 = r60996 / r61004;
double r61007 = r60995 ? r61005 : r61006;
return r61007;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < 2.2577310345661958e+167Initial program 23.6
rmApplied add-sqr-sqrt23.6
Applied *-un-lft-identity23.6
Applied times-frac23.6
Simplified23.6
Simplified15.1
rmApplied associate-*r/15.0
Simplified14.9
if 2.2577310345661958e+167 < y.re Initial program 43.3
rmApplied add-sqr-sqrt43.3
Applied *-un-lft-identity43.3
Applied times-frac43.3
Simplified43.3
Simplified30.0
rmApplied associate-*r/30.0
Simplified29.9
Taylor expanded around inf 12.9
Final simplification14.7
herbie shell --seed 2020035 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, real part"
:precision binary64
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))