\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 -7.4027860136639313 \cdot 10^{164}:\\
\;\;\;\;\frac{-1 \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot 1}\\
\mathbf{elif}\;y.re \le 9.2828111171168996 \cdot 10^{132}:\\
\;\;\;\;\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 r61586 = x_re;
double r61587 = y_re;
double r61588 = r61586 * r61587;
double r61589 = x_im;
double r61590 = y_im;
double r61591 = r61589 * r61590;
double r61592 = r61588 + r61591;
double r61593 = r61587 * r61587;
double r61594 = r61590 * r61590;
double r61595 = r61593 + r61594;
double r61596 = r61592 / r61595;
return r61596;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r61597 = y_re;
double r61598 = -7.402786013663931e+164;
bool r61599 = r61597 <= r61598;
double r61600 = -1.0;
double r61601 = x_re;
double r61602 = r61600 * r61601;
double r61603 = y_im;
double r61604 = hypot(r61597, r61603);
double r61605 = 1.0;
double r61606 = r61604 * r61605;
double r61607 = r61602 / r61606;
double r61608 = 9.2828111171169e+132;
bool r61609 = r61597 <= r61608;
double r61610 = x_im;
double r61611 = r61610 * r61603;
double r61612 = fma(r61601, r61597, r61611);
double r61613 = r61612 / r61604;
double r61614 = r61613 / r61606;
double r61615 = r61601 / r61606;
double r61616 = r61609 ? r61614 : r61615;
double r61617 = r61599 ? r61607 : r61616;
return r61617;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -7.402786013663931e+164Initial program 47.0
rmApplied add-sqr-sqrt47.0
Applied *-un-lft-identity47.0
Applied times-frac47.0
Simplified47.0
Simplified32.4
rmApplied associate-*r/32.4
Simplified32.3
Taylor expanded around -inf 13.2
if -7.402786013663931e+164 < y.re < 9.2828111171169e+132Initial program 20.4
rmApplied add-sqr-sqrt20.4
Applied *-un-lft-identity20.4
Applied times-frac20.4
Simplified20.4
Simplified12.7
rmApplied associate-*r/12.7
Simplified12.6
if 9.2828111171169e+132 < y.re Initial program 41.9
rmApplied add-sqr-sqrt41.9
Applied *-un-lft-identity41.9
Applied times-frac41.9
Simplified41.9
Simplified27.4
rmApplied associate-*r/27.4
Simplified27.4
Taylor expanded around inf 14.1
Final simplification12.9
herbie shell --seed 2020064 +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))))