\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 -6.99838818051005 \cdot 10^{+73}:\\
\;\;\;\;\frac{-x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \le 1.938821746780901 \cdot 10^{+120}:\\
\;\;\;\;\frac{\frac{1}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{\mathsf{fma}\left(x.re, y.re, y.im \cdot x.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 r1426246 = x_re;
double r1426247 = y_re;
double r1426248 = r1426246 * r1426247;
double r1426249 = x_im;
double r1426250 = y_im;
double r1426251 = r1426249 * r1426250;
double r1426252 = r1426248 + r1426251;
double r1426253 = r1426247 * r1426247;
double r1426254 = r1426250 * r1426250;
double r1426255 = r1426253 + r1426254;
double r1426256 = r1426252 / r1426255;
return r1426256;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r1426257 = y_re;
double r1426258 = -6.99838818051005e+73;
bool r1426259 = r1426257 <= r1426258;
double r1426260 = x_re;
double r1426261 = -r1426260;
double r1426262 = y_im;
double r1426263 = hypot(r1426257, r1426262);
double r1426264 = r1426261 / r1426263;
double r1426265 = 1.938821746780901e+120;
bool r1426266 = r1426257 <= r1426265;
double r1426267 = 1.0;
double r1426268 = x_im;
double r1426269 = r1426262 * r1426268;
double r1426270 = fma(r1426260, r1426257, r1426269);
double r1426271 = r1426263 / r1426270;
double r1426272 = r1426267 / r1426271;
double r1426273 = r1426272 / r1426263;
double r1426274 = r1426260 / r1426263;
double r1426275 = r1426266 ? r1426273 : r1426274;
double r1426276 = r1426259 ? r1426264 : r1426275;
return r1426276;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -6.99838818051005e+73Initial program 37.1
rmApplied add-sqr-sqrt37.1
Applied associate-/r*37.0
rmApplied hypot-def37.0
Taylor expanded around -inf 17.1
Simplified17.1
if -6.99838818051005e+73 < y.re < 1.938821746780901e+120Initial program 18.7
rmApplied add-sqr-sqrt18.7
Applied associate-/r*18.6
rmApplied hypot-def18.6
rmApplied clear-num18.7
Simplified11.6
if 1.938821746780901e+120 < y.re Initial program 41.2
rmApplied add-sqr-sqrt41.2
Applied associate-/r*41.1
rmApplied hypot-def41.1
Taylor expanded around inf 14.6
Final simplification13.2
herbie shell --seed 2019153 +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))))