\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 -5.5307531516126024 \cdot 10^{+200}:\\
\;\;\;\;-\frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{elif}\;y.re \le 1.5338542263631544 \cdot 10^{+153}:\\
\;\;\;\;\frac{\frac{x.im \cdot y.re - y.im \cdot x.re}{\mathsf{hypot}\left(y.im, y.re\right)}}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\end{array}double f(double x_re, double x_im, double y_re, double y_im) {
double r2861739 = x_im;
double r2861740 = y_re;
double r2861741 = r2861739 * r2861740;
double r2861742 = x_re;
double r2861743 = y_im;
double r2861744 = r2861742 * r2861743;
double r2861745 = r2861741 - r2861744;
double r2861746 = r2861740 * r2861740;
double r2861747 = r2861743 * r2861743;
double r2861748 = r2861746 + r2861747;
double r2861749 = r2861745 / r2861748;
return r2861749;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r2861750 = y_re;
double r2861751 = -5.5307531516126024e+200;
bool r2861752 = r2861750 <= r2861751;
double r2861753 = x_im;
double r2861754 = y_im;
double r2861755 = hypot(r2861754, r2861750);
double r2861756 = r2861753 / r2861755;
double r2861757 = -r2861756;
double r2861758 = 1.5338542263631544e+153;
bool r2861759 = r2861750 <= r2861758;
double r2861760 = r2861753 * r2861750;
double r2861761 = x_re;
double r2861762 = r2861754 * r2861761;
double r2861763 = r2861760 - r2861762;
double r2861764 = r2861763 / r2861755;
double r2861765 = r2861764 / r2861755;
double r2861766 = r2861759 ? r2861765 : r2861756;
double r2861767 = r2861752 ? r2861757 : r2861766;
return r2861767;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.re < -5.5307531516126024e+200Initial program 40.6
Simplified40.6
rmApplied add-sqr-sqrt40.6
Applied associate-/r*40.6
rmApplied fma-udef40.6
Applied hypot-def40.6
Taylor expanded around -inf 11.7
Simplified11.7
if -5.5307531516126024e+200 < y.re < 1.5338542263631544e+153Initial program 20.1
Simplified20.1
rmApplied add-sqr-sqrt20.1
Applied associate-/r*20.1
rmApplied fma-udef20.1
Applied hypot-def20.0
rmApplied fma-udef20.0
Applied hypot-def12.7
if 1.5338542263631544e+153 < y.re Initial program 45.1
Simplified45.1
rmApplied add-sqr-sqrt45.1
Applied associate-/r*45.1
rmApplied fma-udef45.1
Applied hypot-def45.1
rmApplied fma-udef45.1
Applied hypot-def28.2
Taylor expanded around inf 13.3
Final simplification12.7
herbie shell --seed 2019143 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, imaginary part"
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))