\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.re \le -2.5095625752469799 \cdot 10^{113}:\\
\;\;\;\;\frac{-1 \cdot x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \le 1.04610986578791549 \cdot 10^{-126}:\\
\;\;\;\;\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.re \le 4.02564099829727292 \cdot 10^{-53}:\\
\;\;\;\;\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.re \le 2.14277106081791793 \cdot 10^{130}:\\
\;\;\;\;\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{x.im}{\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 temp;
if ((y_46_re <= -2.50956257524698e+113)) {
temp = ((-1.0 * x_46_im) / hypot(y_46_re, y_46_im));
} else {
double temp_1;
if ((y_46_re <= 1.0461098657879155e-126)) {
temp_1 = ((((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 temp_2;
if ((y_46_re <= 4.025640998297273e-53)) {
temp_2 = ((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 temp_3;
if ((y_46_re <= 2.142771060817918e+130)) {
temp_3 = ((((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 {
temp_3 = (x_46_im / hypot(y_46_re, y_46_im));
}
temp_2 = temp_3;
}
temp_1 = temp_2;
}
temp = temp_1;
}
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.re < -2.50956257524698e+113Initial program 42.1
rmApplied add-sqr-sqrt42.1
Applied *-un-lft-identity42.1
Applied times-frac42.1
Simplified42.1
Simplified28.2
rmApplied associate-*r/28.2
Simplified28.1
Taylor expanded around -inf 16.2
if -2.50956257524698e+113 < y.re < 1.0461098657879155e-126 or 4.025640998297273e-53 < y.re < 2.142771060817918e+130Initial program 18.8
rmApplied add-sqr-sqrt18.8
Applied *-un-lft-identity18.8
Applied times-frac18.8
Simplified18.8
Simplified12.4
rmApplied associate-*r/12.4
Simplified12.3
if 1.0461098657879155e-126 < y.re < 4.025640998297273e-53Initial program 13.8
rmApplied div-sub13.8
Simplified13.3
Simplified11.0
if 2.142771060817918e+130 < y.re Initial program 43.1
rmApplied add-sqr-sqrt43.1
Applied *-un-lft-identity43.1
Applied times-frac43.1
Simplified43.1
Simplified27.8
rmApplied associate-*r/27.8
Simplified27.7
Taylor expanded around inf 14.6
Final simplification13.2
herbie shell --seed 2020049 +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))))