\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.62587008307858845004116821212687409398 \cdot 10^{87}:\\
\;\;\;\;\frac{-x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \le 1.897415265281475970584947986850512250588 \cdot 10^{140}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right) \cdot \frac{1}{\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 r93637 = x_re;
double r93638 = y_re;
double r93639 = r93637 * r93638;
double r93640 = x_im;
double r93641 = y_im;
double r93642 = r93640 * r93641;
double r93643 = r93639 + r93642;
double r93644 = r93638 * r93638;
double r93645 = r93641 * r93641;
double r93646 = r93644 + r93645;
double r93647 = r93643 / r93646;
return r93647;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r93648 = y_re;
double r93649 = -6.6258700830785885e+87;
bool r93650 = r93648 <= r93649;
double r93651 = x_re;
double r93652 = -r93651;
double r93653 = y_im;
double r93654 = hypot(r93648, r93653);
double r93655 = r93652 / r93654;
double r93656 = 1.897415265281476e+140;
bool r93657 = r93648 <= r93656;
double r93658 = x_im;
double r93659 = r93658 * r93653;
double r93660 = fma(r93651, r93648, r93659);
double r93661 = 1.0;
double r93662 = r93661 / r93654;
double r93663 = r93660 * r93662;
double r93664 = r93663 / r93654;
double r93665 = r93651 / r93654;
double r93666 = r93657 ? r93664 : r93665;
double r93667 = r93650 ? r93655 : r93666;
return r93667;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -6.6258700830785885e+87Initial program 39.2
rmApplied add-sqr-sqrt39.2
Applied *-un-lft-identity39.2
Applied times-frac39.2
Simplified39.2
Simplified26.2
rmApplied associate-*r/26.2
Simplified26.1
Taylor expanded around -inf 18.0
Simplified18.0
if -6.6258700830785885e+87 < y.re < 1.897415265281476e+140Initial program 18.9
rmApplied add-sqr-sqrt18.9
Applied *-un-lft-identity18.9
Applied times-frac18.9
Simplified18.9
Simplified11.9
rmApplied associate-*r/11.9
Simplified11.8
rmApplied div-inv11.9
if 1.897415265281476e+140 < y.re Initial program 43.4
rmApplied add-sqr-sqrt43.4
Applied *-un-lft-identity43.4
Applied times-frac43.4
Simplified43.4
Simplified28.0
rmApplied associate-*r/28.0
Simplified28.0
Taylor expanded around inf 13.3
Final simplification13.2
herbie shell --seed 2019235 +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))))