\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 -4.78970221325173 \cdot 10^{+151}:\\
\;\;\;\;\frac{-x.im}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{elif}\;y.re \le 7.209078410675665 \cdot 10^{+132}:\\
\;\;\;\;\frac{\frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.im, y.re\right)}}{\mathsf{hypot}\left(y.im, y.re\right)} - \frac{\frac{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 r2521612 = x_im;
double r2521613 = y_re;
double r2521614 = r2521612 * r2521613;
double r2521615 = x_re;
double r2521616 = y_im;
double r2521617 = r2521615 * r2521616;
double r2521618 = r2521614 - r2521617;
double r2521619 = r2521613 * r2521613;
double r2521620 = r2521616 * r2521616;
double r2521621 = r2521619 + r2521620;
double r2521622 = r2521618 / r2521621;
return r2521622;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r2521623 = y_re;
double r2521624 = -4.78970221325173e+151;
bool r2521625 = r2521623 <= r2521624;
double r2521626 = x_im;
double r2521627 = -r2521626;
double r2521628 = y_im;
double r2521629 = hypot(r2521628, r2521623);
double r2521630 = r2521627 / r2521629;
double r2521631 = 7.209078410675665e+132;
bool r2521632 = r2521623 <= r2521631;
double r2521633 = r2521626 * r2521623;
double r2521634 = r2521633 / r2521629;
double r2521635 = r2521634 / r2521629;
double r2521636 = x_re;
double r2521637 = r2521628 * r2521636;
double r2521638 = r2521637 / r2521629;
double r2521639 = r2521638 / r2521629;
double r2521640 = r2521635 - r2521639;
double r2521641 = r2521626 / r2521629;
double r2521642 = r2521632 ? r2521640 : r2521641;
double r2521643 = r2521625 ? r2521630 : r2521642;
return r2521643;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.re < -4.78970221325173e+151Initial program 44.1
Simplified44.1
rmApplied add-sqr-sqrt44.1
Applied associate-/r*44.1
rmApplied fma-udef44.1
Applied hypot-def44.1
Taylor expanded around -inf 13.0
Simplified13.0
if -4.78970221325173e+151 < y.re < 7.209078410675665e+132Initial program 18.7
Simplified18.7
rmApplied add-sqr-sqrt18.8
Applied associate-/r*18.7
rmApplied fma-udef18.7
Applied hypot-def18.6
rmApplied *-un-lft-identity18.6
Applied associate-/r*18.6
Simplified11.7
rmApplied div-sub11.7
Applied div-sub11.7
if 7.209078410675665e+132 < y.re Initial program 41.8
Simplified41.8
rmApplied add-sqr-sqrt41.8
Applied associate-/r*41.8
rmApplied fma-udef41.8
Applied hypot-def41.8
Taylor expanded around inf 14.4
Final simplification12.3
herbie shell --seed 2019168 +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))))