\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 -3.264789729519792 \cdot 10^{125}:\\
\;\;\;\;\frac{-1 \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot 1}\\
\mathbf{elif}\;y.re \le 8.6098110389023642 \cdot 10^{142}:\\
\;\;\;\;\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 r65450 = x_re;
double r65451 = y_re;
double r65452 = r65450 * r65451;
double r65453 = x_im;
double r65454 = y_im;
double r65455 = r65453 * r65454;
double r65456 = r65452 + r65455;
double r65457 = r65451 * r65451;
double r65458 = r65454 * r65454;
double r65459 = r65457 + r65458;
double r65460 = r65456 / r65459;
return r65460;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r65461 = y_re;
double r65462 = -3.264789729519792e+125;
bool r65463 = r65461 <= r65462;
double r65464 = -1.0;
double r65465 = x_re;
double r65466 = r65464 * r65465;
double r65467 = y_im;
double r65468 = hypot(r65461, r65467);
double r65469 = 1.0;
double r65470 = r65468 * r65469;
double r65471 = r65466 / r65470;
double r65472 = 8.609811038902364e+142;
bool r65473 = r65461 <= r65472;
double r65474 = x_im;
double r65475 = r65474 * r65467;
double r65476 = fma(r65465, r65461, r65475);
double r65477 = r65476 / r65468;
double r65478 = r65477 / r65470;
double r65479 = r65465 / r65470;
double r65480 = r65473 ? r65478 : r65479;
double r65481 = r65463 ? r65471 : r65480;
return r65481;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -3.264789729519792e+125Initial program 42.8
rmApplied add-sqr-sqrt42.8
Applied *-un-lft-identity42.8
Applied times-frac42.8
Simplified42.8
Simplified28.7
rmApplied associate-*r/28.7
Simplified28.6
Taylor expanded around -inf 15.1
if -3.264789729519792e+125 < y.re < 8.609811038902364e+142Initial program 18.8
rmApplied add-sqr-sqrt18.8
Applied *-un-lft-identity18.8
Applied times-frac18.8
Simplified18.8
Simplified11.8
rmApplied associate-*r/11.8
Simplified11.7
if 8.609811038902364e+142 < y.re Initial program 44.6
rmApplied add-sqr-sqrt44.6
Applied *-un-lft-identity44.6
Applied times-frac44.6
Simplified44.6
Simplified29.6
rmApplied associate-*r/29.6
Simplified29.6
Taylor expanded around inf 14.4
Final simplification12.7
herbie shell --seed 2020025 +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))))