\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.9497673481821607 \cdot 10^{115} \lor \neg \left(y.im \le 6.67079582011057737 \cdot 10^{138}\right):\\
\;\;\;\;\frac{-1 \cdot {x.im}^{2}}{x.re \cdot y.re - x.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re \cdot y.re + x.im \cdot y.im}{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.9497673481821607e+115) || !(y_46_im <= 6.670795820110577e+138))) {
VAR = ((-1.0 * pow(x_46_im, 2.0)) / ((x_46_re * y_46_re) - (x_46_im * y_46_im)));
} else {
VAR = (((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((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.9497673481821607e+115 or 6.670795820110577e+138 < y.im Initial program 41.7
rmApplied clear-num41.8
rmApplied flip-+48.6
Applied associate-/r/48.7
Applied associate-/r*48.7
Simplified48.6
Taylor expanded around 0 34.7
if -1.9497673481821607e+115 < y.im < 6.670795820110577e+138Initial program 19.0
Final simplification23.9
herbie shell --seed 2020071 +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))))