\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{-1}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot x.re\\
\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.im, y.re\right)}}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\end{array}double f(double x_re, double x_im, double y_re, double y_im) {
double r68724 = x_re;
double r68725 = y_re;
double r68726 = r68724 * r68725;
double r68727 = x_im;
double r68728 = y_im;
double r68729 = r68727 * r68728;
double r68730 = r68726 + r68729;
double r68731 = r68725 * r68725;
double r68732 = r68728 * r68728;
double r68733 = r68731 + r68732;
double r68734 = r68730 / r68733;
return r68734;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r68735 = y_re;
double r68736 = -2.328453055309953e+184;
bool r68737 = r68735 <= r68736;
double r68738 = -1.0;
double r68739 = y_im;
double r68740 = hypot(r68739, r68735);
double r68741 = r68738 / r68740;
double r68742 = x_re;
double r68743 = r68741 * r68742;
double r68744 = 1.7216921703264507e+180;
bool r68745 = r68735 <= r68744;
double r68746 = x_im;
double r68747 = r68742 * r68735;
double r68748 = fma(r68746, r68739, r68747);
double r68749 = r68748 / r68740;
double r68750 = r68749 / r68740;
double r68751 = r68742 / r68740;
double r68752 = r68745 ? r68750 : r68751;
double r68753 = r68737 ? r68743 : r68752;
return r68753;
}



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
Simplified45.4
rmApplied add-sqr-sqrt45.4
Applied *-un-lft-identity45.4
Applied times-frac45.4
Simplified45.4
Simplified32.6
Taylor expanded around -inf 11.1
Simplified11.1
if -2.328453055309953e+184 < y.re < 1.7216921703264507e+180Initial program 20.8
Simplified20.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
Simplified42.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 simplification12.0
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))))