\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 r944375 = x_re;
double r944376 = y_re;
double r944377 = r944375 * r944376;
double r944378 = x_im;
double r944379 = y_im;
double r944380 = r944378 * r944379;
double r944381 = r944377 + r944380;
double r944382 = r944376 * r944376;
double r944383 = r944379 * r944379;
double r944384 = r944382 + r944383;
double r944385 = r944381 / r944384;
return r944385;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r944386 = y_re;
double r944387 = -6.99838818051005e+73;
bool r944388 = r944386 <= r944387;
double r944389 = x_re;
double r944390 = -r944389;
double r944391 = y_im;
double r944392 = hypot(r944386, r944391);
double r944393 = r944390 / r944392;
double r944394 = 1.938821746780901e+120;
bool r944395 = r944386 <= r944394;
double r944396 = 1.0;
double r944397 = x_im;
double r944398 = r944391 * r944397;
double r944399 = fma(r944389, r944386, r944398);
double r944400 = r944392 / r944399;
double r944401 = r944396 / r944400;
double r944402 = r944401 / r944392;
double r944403 = r944389 / r944392;
double r944404 = r944395 ? r944402 : r944403;
double r944405 = r944388 ? r944393 : r944404;
return r944405;
}



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))))