\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 -4.379830691407506152483526105989468908471 \cdot 10^{106}:\\
\;\;\;\;x.re \cdot \frac{-1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \le 9.741722452995778162218720265388181385737 \cdot 10^{95}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x.im, y.im, x.re \cdot y.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{\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 r62098 = x_re;
double r62099 = y_re;
double r62100 = r62098 * r62099;
double r62101 = x_im;
double r62102 = y_im;
double r62103 = r62101 * r62102;
double r62104 = r62100 + r62103;
double r62105 = r62099 * r62099;
double r62106 = r62102 * r62102;
double r62107 = r62105 + r62106;
double r62108 = r62104 / r62107;
return r62108;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r62109 = y_re;
double r62110 = -4.379830691407506e+106;
bool r62111 = r62109 <= r62110;
double r62112 = x_re;
double r62113 = -1.0;
double r62114 = y_im;
double r62115 = hypot(r62109, r62114);
double r62116 = r62113 / r62115;
double r62117 = r62112 * r62116;
double r62118 = 9.741722452995778e+95;
bool r62119 = r62109 <= r62118;
double r62120 = x_im;
double r62121 = r62112 * r62109;
double r62122 = fma(r62120, r62114, r62121);
double r62123 = r62122 / r62115;
double r62124 = r62123 / r62115;
double r62125 = r62112 / r62115;
double r62126 = r62119 ? r62124 : r62125;
double r62127 = r62111 ? r62117 : r62126;
return r62127;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -4.379830691407506e+106Initial program 41.0
Simplified41.0
rmApplied add-sqr-sqrt41.0
Applied *-un-lft-identity41.0
Applied times-frac41.0
Simplified41.0
Simplified28.5
Taylor expanded around -inf 16.1
Simplified16.1
if -4.379830691407506e+106 < y.re < 9.741722452995778e+95Initial program 18.4
Simplified18.4
rmApplied add-sqr-sqrt18.4
Applied *-un-lft-identity18.4
Applied times-frac18.5
Simplified18.4
Simplified11.2
rmApplied associate-*r/11.2
Simplified11.1
if 9.741722452995778e+95 < y.re Initial program 39.1
Simplified39.1
rmApplied add-sqr-sqrt39.1
Applied *-un-lft-identity39.1
Applied times-frac39.1
Simplified39.1
Simplified27.3
rmApplied associate-*r/27.3
Simplified27.2
Taylor expanded around 0 16.6
Final simplification12.9
herbie shell --seed 2019209 +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))))