\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 -1.75773301102882159 \cdot 10^{162}:\\
\;\;\;\;\frac{-1 \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot 1}\\
\mathbf{elif}\;y.re \le 9.4134247976417832 \cdot 10^{156}:\\
\;\;\;\;\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 r60001 = x_re;
double r60002 = y_re;
double r60003 = r60001 * r60002;
double r60004 = x_im;
double r60005 = y_im;
double r60006 = r60004 * r60005;
double r60007 = r60003 + r60006;
double r60008 = r60002 * r60002;
double r60009 = r60005 * r60005;
double r60010 = r60008 + r60009;
double r60011 = r60007 / r60010;
return r60011;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r60012 = y_re;
double r60013 = -1.7577330110288216e+162;
bool r60014 = r60012 <= r60013;
double r60015 = -1.0;
double r60016 = x_re;
double r60017 = r60015 * r60016;
double r60018 = y_im;
double r60019 = hypot(r60012, r60018);
double r60020 = 1.0;
double r60021 = r60019 * r60020;
double r60022 = r60017 / r60021;
double r60023 = 9.413424797641783e+156;
bool r60024 = r60012 <= r60023;
double r60025 = x_im;
double r60026 = r60025 * r60018;
double r60027 = fma(r60016, r60012, r60026);
double r60028 = r60027 / r60019;
double r60029 = r60028 / r60021;
double r60030 = r60016 / r60021;
double r60031 = r60024 ? r60029 : r60030;
double r60032 = r60014 ? r60022 : r60031;
return r60032;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -1.7577330110288216e+162Initial program 45.1
rmApplied add-sqr-sqrt45.1
Applied *-un-lft-identity45.1
Applied times-frac45.1
Simplified45.1
Simplified29.0
rmApplied associate-*r/29.0
Simplified29.0
Taylor expanded around -inf 13.4
if -1.7577330110288216e+162 < y.re < 9.413424797641783e+156Initial program 20.0
rmApplied add-sqr-sqrt20.0
Applied *-un-lft-identity20.0
Applied times-frac20.0
Simplified20.0
Simplified12.9
rmApplied associate-*r/12.9
Simplified12.8
if 9.413424797641783e+156 < y.re Initial program 44.2
rmApplied add-sqr-sqrt44.2
Applied *-un-lft-identity44.2
Applied times-frac44.2
Simplified44.2
Simplified28.8
rmApplied associate-*r/28.8
Simplified28.8
Taylor expanded around inf 13.4
Final simplification12.9
herbie shell --seed 2020060 +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))))