\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 -9.959880769521784 \cdot 10^{+162}:\\
\;\;\;\;\frac{-x.im}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{elif}\;y.re \le 1.6080482430506382 \cdot 10^{+147}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{x.im \cdot y.re - y.im \cdot x.re}{\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 r1958720 = x_im;
double r1958721 = y_re;
double r1958722 = r1958720 * r1958721;
double r1958723 = x_re;
double r1958724 = y_im;
double r1958725 = r1958723 * r1958724;
double r1958726 = r1958722 - r1958725;
double r1958727 = r1958721 * r1958721;
double r1958728 = r1958724 * r1958724;
double r1958729 = r1958727 + r1958728;
double r1958730 = r1958726 / r1958729;
return r1958730;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r1958731 = y_re;
double r1958732 = -9.959880769521784e+162;
bool r1958733 = r1958731 <= r1958732;
double r1958734 = x_im;
double r1958735 = -r1958734;
double r1958736 = y_im;
double r1958737 = hypot(r1958736, r1958731);
double r1958738 = r1958735 / r1958737;
double r1958739 = 1.6080482430506382e+147;
bool r1958740 = r1958731 <= r1958739;
double r1958741 = 1.0;
double r1958742 = r1958741 / r1958737;
double r1958743 = r1958734 * r1958731;
double r1958744 = x_re;
double r1958745 = r1958736 * r1958744;
double r1958746 = r1958743 - r1958745;
double r1958747 = r1958746 / r1958737;
double r1958748 = r1958742 * r1958747;
double r1958749 = r1958734 / r1958737;
double r1958750 = r1958740 ? r1958748 : r1958749;
double r1958751 = r1958733 ? r1958738 : r1958750;
return r1958751;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.re < -9.959880769521784e+162Initial program 43.3
Simplified43.3
rmApplied add-sqr-sqrt43.3
Applied associate-/r*43.3
rmApplied fma-udef43.3
Applied hypot-def43.3
Taylor expanded around -inf 12.9
Simplified12.9
if -9.959880769521784e+162 < y.re < 1.6080482430506382e+147Initial program 19.0
Simplified19.0
rmApplied add-sqr-sqrt19.0
Applied associate-/r*18.9
rmApplied fma-udef18.9
Applied hypot-def18.9
rmApplied clear-num19.0
Simplified12.4
rmApplied *-un-lft-identity12.4
Applied associate-/r/12.4
Applied times-frac12.4
Simplified12.4
if 1.6080482430506382e+147 < y.re Initial program 43.4
Simplified43.4
rmApplied add-sqr-sqrt43.4
Applied associate-/r*43.4
rmApplied fma-udef43.4
Applied hypot-def43.4
rmApplied clear-num43.4
Simplified27.3
Taylor expanded around 0 13.4
Final simplification12.6
herbie shell --seed 2019134 +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))))