\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\begin{array}{l}
\mathbf{if}\;y.im \le -2.07444023714736019 \cdot 10^{132}:\\
\;\;\;\;\frac{\frac{x.im \cdot y.re - x.re \cdot y.im}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \le -8.9012661082733055 \cdot 10^{62}:\\
\;\;\;\;\frac{x.im}{\frac{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}{y.re}} - \frac{x.re}{\frac{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}{y.im}}\\
\mathbf{elif}\;y.im \le 4.4076829621176479 \cdot 10^{83}:\\
\;\;\;\;\frac{\frac{x.im \cdot y.re - x.re \cdot y.im}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (((x_46_im * y_46_re) - (x_46_re * 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 <= -2.0744402371473602e+132)) {
VAR = ((((x_46_im * y_46_re) - (x_46_re * y_46_im)) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im));
} else {
double VAR_1;
if ((y_46_im <= -8.901266108273305e+62)) {
VAR_1 = ((x_46_im / (fma(y_46_re, y_46_re, (y_46_im * y_46_im)) / y_46_re)) - (x_46_re / (fma(y_46_re, y_46_re, (y_46_im * y_46_im)) / y_46_im)));
} else {
double VAR_2;
if ((y_46_im <= 4.407682962117648e+83)) {
VAR_2 = ((((x_46_im * y_46_re) - (x_46_re * y_46_im)) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im));
} else {
VAR_2 = ((-1.0 * x_46_re) / hypot(y_46_re, y_46_im));
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
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 < -2.0744402371473602e+132 or -8.901266108273305e+62 < y.im < 4.407682962117648e+83Initial program 23.3
rmApplied add-sqr-sqrt23.4
Applied *-un-lft-identity23.4
Applied times-frac23.4
Simplified23.4
Simplified14.5
rmApplied associate-*r/14.5
Simplified14.4
if -2.0744402371473602e+132 < y.im < -8.901266108273305e+62Initial program 21.6
rmApplied div-sub21.6
Simplified22.4
Simplified13.6
if 4.407682962117648e+83 < y.im Initial program 38.6
rmApplied add-sqr-sqrt38.6
Applied *-un-lft-identity38.6
Applied times-frac38.6
Simplified38.6
Simplified26.2
rmApplied associate-*r/26.2
Simplified26.2
Taylor expanded around 0 16.6
Final simplification14.8
herbie shell --seed 2020092 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, imaginary part"
:precision binary64
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))