\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 -1.698029738904270629200661330806058795869 \cdot 10^{134}:\\
\;\;\;\;\frac{-1 \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot 1}\\
\mathbf{elif}\;y.re \le 3.906672870888294447082944790587346450096 \cdot 10^{121}:\\
\;\;\;\;\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 r128143 = x_re;
double r128144 = y_re;
double r128145 = r128143 * r128144;
double r128146 = x_im;
double r128147 = y_im;
double r128148 = r128146 * r128147;
double r128149 = r128145 + r128148;
double r128150 = r128144 * r128144;
double r128151 = r128147 * r128147;
double r128152 = r128150 + r128151;
double r128153 = r128149 / r128152;
return r128153;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r128154 = y_re;
double r128155 = -1.6980297389042706e+134;
bool r128156 = r128154 <= r128155;
double r128157 = -1.0;
double r128158 = x_re;
double r128159 = r128157 * r128158;
double r128160 = y_im;
double r128161 = hypot(r128154, r128160);
double r128162 = 1.0;
double r128163 = r128161 * r128162;
double r128164 = r128159 / r128163;
double r128165 = 3.9066728708882944e+121;
bool r128166 = r128154 <= r128165;
double r128167 = x_im;
double r128168 = r128167 * r128160;
double r128169 = fma(r128158, r128154, r128168);
double r128170 = r128169 / r128161;
double r128171 = r128170 / r128163;
double r128172 = r128158 / r128163;
double r128173 = r128166 ? r128171 : r128172;
double r128174 = r128156 ? r128164 : r128173;
return r128174;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -1.6980297389042706e+134Initial program 43.6
rmApplied add-sqr-sqrt43.6
Applied *-un-lft-identity43.6
Applied times-frac43.6
Simplified43.6
Simplified29.3
rmApplied associate-*r/29.3
Simplified29.3
Taylor expanded around -inf 14.9
if -1.6980297389042706e+134 < y.re < 3.9066728708882944e+121Initial program 19.0
rmApplied add-sqr-sqrt19.0
Applied *-un-lft-identity19.0
Applied times-frac19.0
Simplified19.0
Simplified12.4
rmApplied associate-*r/12.4
Simplified12.3
if 3.9066728708882944e+121 < y.re Initial program 41.3
rmApplied add-sqr-sqrt41.3
Applied *-un-lft-identity41.3
Applied times-frac41.3
Simplified41.3
Simplified28.4
rmApplied associate-*r/28.4
Simplified28.4
Taylor expanded around inf 14.3
Final simplification13.0
herbie shell --seed 2020002 +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))))