\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.im \le 3.9280894087478495 \cdot 10^{46}:\\
\;\;\;\;\frac{\frac{x.re \cdot y.re + x.im \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\\
\end{array}double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)));
}
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double temp;
if ((y_46_im <= 3.9280894087478495e+46)) {
temp = ((((x_46_re * y_46_re) + (x_46_im * y_46_im)) / sqrt(((y_46_re * y_46_re) + (y_46_im * y_46_im)))) / sqrt(((y_46_re * y_46_re) + (y_46_im * y_46_im))));
} else {
temp = (x_46_im / sqrt(((y_46_re * y_46_re) + (y_46_im * y_46_im))));
}
return temp;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.im < 3.9280894087478495e+46Initial program 23.3
rmApplied add-sqr-sqrt23.3
Applied associate-/r*23.2
if 3.9280894087478495e+46 < y.im Initial program 35.1
rmApplied add-sqr-sqrt35.1
Applied associate-/r*35.1
Taylor expanded around 0 36.0
Final simplification26.0
herbie shell --seed 2020053
(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))))