\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 1.6167157221602814 \cdot 10^{83}:\\
\;\;\;\;\frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{x.re \cdot y.re + x.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 VAR;
if ((y_46_im <= 1.6167157221602814e+83)) {
VAR = ((1.0 / sqrt(((y_46_re * y_46_re) + (y_46_im * y_46_im)))) * (((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)))));
} else {
VAR = (x_46_im / sqrt(((y_46_re * y_46_re) + (y_46_im * y_46_im))));
}
return VAR;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.im < 1.6167157221602814e+83Initial program 22.8
rmApplied add-sqr-sqrt22.8
Applied *-un-lft-identity22.8
Applied times-frac22.9
if 1.6167157221602814e+83 < y.im Initial program 38.5
rmApplied add-sqr-sqrt38.5
Applied associate-/r*38.5
Taylor expanded around 0 37.6
Final simplification25.6
herbie shell --seed 2020092
(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))))