\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.im \le 2.12596178726660471909605146790118406087 \cdot 10^{114}:\\
\;\;\;\;\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)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}double f(double x_re, double x_im, double y_re, double y_im) {
double r49666 = x_re;
double r49667 = y_re;
double r49668 = r49666 * r49667;
double r49669 = x_im;
double r49670 = y_im;
double r49671 = r49669 * r49670;
double r49672 = r49668 + r49671;
double r49673 = r49667 * r49667;
double r49674 = r49670 * r49670;
double r49675 = r49673 + r49674;
double r49676 = r49672 / r49675;
return r49676;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r49677 = y_im;
double r49678 = 2.1259617872666047e+114;
bool r49679 = r49677 <= r49678;
double r49680 = x_re;
double r49681 = y_re;
double r49682 = x_im;
double r49683 = r49682 * r49677;
double r49684 = fma(r49680, r49681, r49683);
double r49685 = hypot(r49681, r49677);
double r49686 = r49684 / r49685;
double r49687 = r49686 / r49685;
double r49688 = r49682 / r49685;
double r49689 = r49679 ? r49687 : r49688;
return r49689;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.im < 2.1259617872666047e+114Initial program 23.0
rmApplied add-sqr-sqrt23.0
Applied *-un-lft-identity23.0
Applied times-frac23.0
Simplified23.0
Simplified14.7
rmApplied associate-*r/14.7
Simplified14.6
if 2.1259617872666047e+114 < y.im Initial program 40.4
rmApplied add-sqr-sqrt40.4
Applied *-un-lft-identity40.4
Applied times-frac40.4
Simplified40.4
Simplified27.2
rmApplied associate-*r/27.1
Simplified27.1
Taylor expanded around 0 15.2
Final simplification14.7
herbie shell --seed 2019323 +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))))