\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.912207042542648550669797463577655559985 \cdot 10^{128}:\\
\;\;\;\;\frac{-x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \le 5.396385525097289126320674450075267015308 \cdot 10^{222}:\\
\;\;\;\;\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.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 r70289 = x_re;
double r70290 = y_re;
double r70291 = r70289 * r70290;
double r70292 = x_im;
double r70293 = y_im;
double r70294 = r70292 * r70293;
double r70295 = r70291 + r70294;
double r70296 = r70290 * r70290;
double r70297 = r70293 * r70293;
double r70298 = r70296 + r70297;
double r70299 = r70295 / r70298;
return r70299;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r70300 = y_re;
double r70301 = -1.9122070425426486e+128;
bool r70302 = r70300 <= r70301;
double r70303 = x_re;
double r70304 = -r70303;
double r70305 = y_im;
double r70306 = hypot(r70300, r70305);
double r70307 = r70304 / r70306;
double r70308 = 5.396385525097289e+222;
bool r70309 = r70300 <= r70308;
double r70310 = x_im;
double r70311 = r70310 * r70305;
double r70312 = fma(r70303, r70300, r70311);
double r70313 = r70312 / r70306;
double r70314 = r70313 / r70306;
double r70315 = r70303 / r70306;
double r70316 = r70309 ? r70314 : r70315;
double r70317 = r70302 ? r70307 : r70316;
return r70317;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -1.9122070425426486e+128Initial program 39.9
rmApplied add-sqr-sqrt39.9
Applied *-un-lft-identity39.9
Applied times-frac39.9
Simplified39.9
Simplified26.9
rmApplied associate-*r/26.9
Simplified26.9
Taylor expanded around -inf 14.2
Simplified14.2
if -1.9122070425426486e+128 < y.re < 5.396385525097289e+222Initial program 21.6
rmApplied add-sqr-sqrt21.6
Applied *-un-lft-identity21.6
Applied times-frac21.6
Simplified21.6
Simplified13.5
rmApplied associate-*r/13.5
Simplified13.4
if 5.396385525097289e+222 < y.re Initial program 41.3
rmApplied add-sqr-sqrt41.3
Applied *-un-lft-identity41.3
Applied times-frac41.3
Simplified41.3
Simplified32.5
rmApplied associate-*r/32.5
Simplified32.5
Taylor expanded around inf 9.9
Final simplification13.3
herbie shell --seed 2019212 +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))))