\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 -5.744231621044319277146767737833748463903 \cdot 10^{154}:\\
\;\;\;\;\frac{-1 \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot 1}\\
\mathbf{elif}\;y.re \le 1.753349743646188755107818530326292599547 \cdot 10^{117}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right) \cdot \frac{1}{\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 r51622 = x_re;
double r51623 = y_re;
double r51624 = r51622 * r51623;
double r51625 = x_im;
double r51626 = y_im;
double r51627 = r51625 * r51626;
double r51628 = r51624 + r51627;
double r51629 = r51623 * r51623;
double r51630 = r51626 * r51626;
double r51631 = r51629 + r51630;
double r51632 = r51628 / r51631;
return r51632;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r51633 = y_re;
double r51634 = -5.744231621044319e+154;
bool r51635 = r51633 <= r51634;
double r51636 = -1.0;
double r51637 = x_re;
double r51638 = r51636 * r51637;
double r51639 = y_im;
double r51640 = hypot(r51633, r51639);
double r51641 = 1.0;
double r51642 = r51640 * r51641;
double r51643 = r51638 / r51642;
double r51644 = 1.7533497436461888e+117;
bool r51645 = r51633 <= r51644;
double r51646 = x_im;
double r51647 = r51646 * r51639;
double r51648 = fma(r51637, r51633, r51647);
double r51649 = r51641 / r51640;
double r51650 = r51648 * r51649;
double r51651 = r51650 / r51642;
double r51652 = r51637 / r51642;
double r51653 = r51645 ? r51651 : r51652;
double r51654 = r51635 ? r51643 : r51653;
return r51654;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -5.744231621044319e+154Initial program 44.8
rmApplied add-sqr-sqrt44.8
Applied *-un-lft-identity44.8
Applied times-frac44.8
Simplified44.8
Simplified29.9
rmApplied associate-*r/29.9
Simplified29.9
Taylor expanded around -inf 14.0
if -5.744231621044319e+154 < y.re < 1.7533497436461888e+117Initial program 18.1
rmApplied add-sqr-sqrt18.1
Applied *-un-lft-identity18.1
Applied times-frac18.1
Simplified18.1
Simplified11.7
rmApplied associate-*r/11.6
Simplified11.6
rmApplied div-inv11.6
if 1.7533497436461888e+117 < y.re Initial program 40.3
rmApplied add-sqr-sqrt40.3
Applied *-un-lft-identity40.3
Applied times-frac40.3
Simplified40.3
Simplified26.9
rmApplied associate-*r/26.8
Simplified26.8
Taylor expanded around inf 15.2
Final simplification12.5
herbie shell --seed 2019352 +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))))