\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.2063458127550573 \cdot 10^{+100}:\\
\;\;\;\;\frac{-x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \le 4.054287420560557 \cdot 10^{+138}:\\
\;\;\;\;\frac{\frac{1}{\frac{1}{\frac{\mathsf{fma}\left(y.re, x.re, \left(y.im \cdot x.im\right)\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 r5757120 = x_re;
double r5757121 = y_re;
double r5757122 = r5757120 * r5757121;
double r5757123 = x_im;
double r5757124 = y_im;
double r5757125 = r5757123 * r5757124;
double r5757126 = r5757122 + r5757125;
double r5757127 = r5757121 * r5757121;
double r5757128 = r5757124 * r5757124;
double r5757129 = r5757127 + r5757128;
double r5757130 = r5757126 / r5757129;
return r5757130;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r5757131 = y_re;
double r5757132 = -2.2063458127550573e+100;
bool r5757133 = r5757131 <= r5757132;
double r5757134 = x_re;
double r5757135 = -r5757134;
double r5757136 = y_im;
double r5757137 = hypot(r5757131, r5757136);
double r5757138 = r5757135 / r5757137;
double r5757139 = 4.054287420560557e+138;
bool r5757140 = r5757131 <= r5757139;
double r5757141 = 1.0;
double r5757142 = x_im;
double r5757143 = r5757136 * r5757142;
double r5757144 = fma(r5757131, r5757134, r5757143);
double r5757145 = r5757144 / r5757137;
double r5757146 = r5757141 / r5757145;
double r5757147 = r5757141 / r5757146;
double r5757148 = r5757147 / r5757137;
double r5757149 = r5757134 / r5757137;
double r5757150 = r5757140 ? r5757148 : r5757149;
double r5757151 = r5757133 ? r5757138 : r5757150;
return r5757151;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -2.2063458127550573e+100Initial program 38.4
rmApplied add-sqr-sqrt38.4
Applied associate-/r*38.4
rmApplied hypot-def38.4
rmApplied clear-num38.4
Simplified25.2
Taylor expanded around -inf 16.7
Simplified16.7
if -2.2063458127550573e+100 < y.re < 4.054287420560557e+138Initial program 18.6
rmApplied add-sqr-sqrt18.6
Applied associate-/r*18.5
rmApplied hypot-def18.5
rmApplied clear-num18.6
Simplified11.8
rmApplied clear-num11.8
if 4.054287420560557e+138 < y.re Initial program 45.0
rmApplied add-sqr-sqrt45.0
Applied associate-/r*45.0
rmApplied hypot-def45.0
Taylor expanded around inf 14.5
Final simplification13.1
herbie shell --seed 2019128 +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))))