\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 -2.328453055309952838396386350346556939505 \cdot 10^{184}:\\
\;\;\;\;\frac{-x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \le 1.721692170326450703244997905752579178238 \cdot 10^{180}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x.im, y.im, x.re \cdot y.re\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 r55179 = x_re;
double r55180 = y_re;
double r55181 = r55179 * r55180;
double r55182 = x_im;
double r55183 = y_im;
double r55184 = r55182 * r55183;
double r55185 = r55181 + r55184;
double r55186 = r55180 * r55180;
double r55187 = r55183 * r55183;
double r55188 = r55186 + r55187;
double r55189 = r55185 / r55188;
return r55189;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r55190 = y_re;
double r55191 = -2.328453055309953e+184;
bool r55192 = r55190 <= r55191;
double r55193 = x_re;
double r55194 = -r55193;
double r55195 = y_im;
double r55196 = hypot(r55190, r55195);
double r55197 = r55194 / r55196;
double r55198 = 1.7216921703264507e+180;
bool r55199 = r55190 <= r55198;
double r55200 = x_im;
double r55201 = r55193 * r55190;
double r55202 = fma(r55200, r55195, r55201);
double r55203 = r55202 / r55196;
double r55204 = r55203 / r55196;
double r55205 = r55193 / r55196;
double r55206 = r55199 ? r55204 : r55205;
double r55207 = r55192 ? r55197 : r55206;
return r55207;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -2.328453055309953e+184Initial program 45.4
rmApplied add-sqr-sqrt45.4
Applied *-un-lft-identity45.4
Applied times-frac45.4
Simplified45.4
Simplified32.6
rmApplied associate-*r/32.6
Simplified32.6
rmApplied clear-num32.6
Taylor expanded around -inf 10.9
Simplified10.9
if -2.328453055309953e+184 < y.re < 1.7216921703264507e+180Initial program 20.8
rmApplied add-sqr-sqrt20.8
Applied *-un-lft-identity20.8
Applied times-frac20.8
Simplified20.8
Simplified12.3
rmApplied associate-*r/12.2
Simplified12.1
if 1.7216921703264507e+180 < y.re Initial program 42.8
rmApplied add-sqr-sqrt42.8
Applied *-un-lft-identity42.8
Applied times-frac42.8
Simplified42.8
Simplified29.2
rmApplied associate-*r/29.1
Simplified29.1
Taylor expanded around 0 11.6
Final simplification11.9
herbie shell --seed 2019194 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, real part"
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))