\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.15437883947267018 \cdot 10^{126}:\\
\;\;\;\;\frac{-1 \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot 1}\\
\mathbf{elif}\;y.re \le 7.6439338361981289 \cdot 10^{118}:\\
\;\;\;\;\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 r58083 = x_re;
double r58084 = y_re;
double r58085 = r58083 * r58084;
double r58086 = x_im;
double r58087 = y_im;
double r58088 = r58086 * r58087;
double r58089 = r58085 + r58088;
double r58090 = r58084 * r58084;
double r58091 = r58087 * r58087;
double r58092 = r58090 + r58091;
double r58093 = r58089 / r58092;
return r58093;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r58094 = y_re;
double r58095 = -4.15437883947267e+126;
bool r58096 = r58094 <= r58095;
double r58097 = -1.0;
double r58098 = x_re;
double r58099 = r58097 * r58098;
double r58100 = y_im;
double r58101 = hypot(r58094, r58100);
double r58102 = 1.0;
double r58103 = r58101 * r58102;
double r58104 = r58099 / r58103;
double r58105 = 7.643933836198129e+118;
bool r58106 = r58094 <= r58105;
double r58107 = x_im;
double r58108 = r58107 * r58100;
double r58109 = fma(r58098, r58094, r58108);
double r58110 = r58109 / r58101;
double r58111 = r58110 / r58103;
double r58112 = r58098 / r58103;
double r58113 = r58106 ? r58111 : r58112;
double r58114 = r58096 ? r58104 : r58113;
return r58114;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -4.15437883947267e+126Initial program 41.5
rmApplied add-sqr-sqrt41.5
Applied *-un-lft-identity41.5
Applied times-frac41.5
Simplified41.5
Simplified27.5
rmApplied associate-*r/27.5
Simplified27.4
Taylor expanded around -inf 15.5
if -4.15437883947267e+126 < y.re < 7.643933836198129e+118Initial program 18.5
rmApplied add-sqr-sqrt18.5
Applied *-un-lft-identity18.5
Applied times-frac18.5
Simplified18.5
Simplified11.9
rmApplied associate-*r/11.9
Simplified11.8
if 7.643933836198129e+118 < y.re Initial program 42.4
rmApplied add-sqr-sqrt42.4
Applied *-un-lft-identity42.4
Applied times-frac42.4
Simplified42.4
Simplified28.5
rmApplied associate-*r/28.5
Simplified28.4
Taylor expanded around inf 15.6
Final simplification13.0
herbie shell --seed 2020083 +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))))