\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 -3.81966799797845806 \cdot 10^{158}:\\
\;\;\;\;\frac{-1 \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot 1}\\
\mathbf{elif}\;y.re \le 1.3841272509628985 \cdot 10^{136}:\\
\;\;\;\;\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 r63060 = x_re;
double r63061 = y_re;
double r63062 = r63060 * r63061;
double r63063 = x_im;
double r63064 = y_im;
double r63065 = r63063 * r63064;
double r63066 = r63062 + r63065;
double r63067 = r63061 * r63061;
double r63068 = r63064 * r63064;
double r63069 = r63067 + r63068;
double r63070 = r63066 / r63069;
return r63070;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r63071 = y_re;
double r63072 = -3.819667997978458e+158;
bool r63073 = r63071 <= r63072;
double r63074 = -1.0;
double r63075 = x_re;
double r63076 = r63074 * r63075;
double r63077 = y_im;
double r63078 = hypot(r63071, r63077);
double r63079 = 1.0;
double r63080 = r63078 * r63079;
double r63081 = r63076 / r63080;
double r63082 = 1.3841272509628985e+136;
bool r63083 = r63071 <= r63082;
double r63084 = x_im;
double r63085 = r63084 * r63077;
double r63086 = fma(r63075, r63071, r63085);
double r63087 = r63086 / r63078;
double r63088 = r63087 / r63080;
double r63089 = r63075 / r63080;
double r63090 = r63083 ? r63088 : r63089;
double r63091 = r63073 ? r63081 : r63090;
return r63091;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -3.819667997978458e+158Initial program 44.6
rmApplied add-sqr-sqrt44.6
Applied *-un-lft-identity44.6
Applied times-frac44.6
Simplified44.6
Simplified30.0
rmApplied associate-*r/30.0
Simplified29.9
Taylor expanded around -inf 13.0
if -3.819667997978458e+158 < y.re < 1.3841272509628985e+136Initial program 19.9
rmApplied add-sqr-sqrt19.9
Applied *-un-lft-identity19.9
Applied times-frac19.9
Simplified19.9
Simplified12.8
rmApplied associate-*r/12.8
Simplified12.7
if 1.3841272509628985e+136 < y.re Initial program 42.4
rmApplied add-sqr-sqrt42.4
Applied *-un-lft-identity42.4
Applied times-frac42.4
Simplified42.4
Simplified27.0
rmApplied associate-*r/27.0
Simplified27.0
Taylor expanded around inf 13.8
Final simplification12.9
herbie shell --seed 2020046 +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))))