\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.63274806530215231 \cdot 10^{140}:\\
\;\;\;\;\frac{-1 \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot 1}\\
\mathbf{elif}\;y.re \le 6.6744601111871062 \cdot 10^{145}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right) \cdot 1} \cdot \frac{1}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}}\\
\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 r104496 = x_re;
double r104497 = y_re;
double r104498 = r104496 * r104497;
double r104499 = x_im;
double r104500 = y_im;
double r104501 = r104499 * r104500;
double r104502 = r104498 + r104501;
double r104503 = r104497 * r104497;
double r104504 = r104500 * r104500;
double r104505 = r104503 + r104504;
double r104506 = r104502 / r104505;
return r104506;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r104507 = y_re;
double r104508 = -4.632748065302152e+140;
bool r104509 = r104507 <= r104508;
double r104510 = -1.0;
double r104511 = x_re;
double r104512 = r104510 * r104511;
double r104513 = y_im;
double r104514 = hypot(r104507, r104513);
double r104515 = 1.0;
double r104516 = r104514 * r104515;
double r104517 = r104512 / r104516;
double r104518 = 6.674460111187106e+145;
bool r104519 = r104507 <= r104518;
double r104520 = r104515 / r104516;
double r104521 = x_im;
double r104522 = r104521 * r104513;
double r104523 = fma(r104511, r104507, r104522);
double r104524 = r104514 / r104523;
double r104525 = r104515 / r104524;
double r104526 = r104520 * r104525;
double r104527 = r104511 / r104516;
double r104528 = r104519 ? r104526 : r104527;
double r104529 = r104509 ? r104517 : r104528;
return r104529;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -4.632748065302152e+140Initial program 42.9
rmApplied add-sqr-sqrt42.9
Applied *-un-lft-identity42.9
Applied times-frac42.9
Simplified42.9
Simplified28.4
rmApplied associate-*r/28.4
Simplified28.4
Taylor expanded around -inf 14.2
if -4.632748065302152e+140 < y.re < 6.674460111187106e+145Initial program 19.4
rmApplied add-sqr-sqrt19.5
Applied *-un-lft-identity19.5
Applied times-frac19.5
Simplified19.5
Simplified12.5
rmApplied clear-num12.5
Simplified12.5
if 6.674460111187106e+145 < y.re Initial program 43.1
rmApplied add-sqr-sqrt43.1
Applied *-un-lft-identity43.1
Applied times-frac43.1
Simplified43.1
Simplified28.6
rmApplied associate-*r/28.6
Simplified28.5
Taylor expanded around inf 14.3
Final simplification13.0
herbie shell --seed 2020059 +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))))