\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 -1.01458341645274 \cdot 10^{+165}:\\
\;\;\;\;\frac{-x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \le 2.0408764461888536 \cdot 10^{+156}:\\
\;\;\;\;\frac{\frac{1}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im \cdot y.re - x.re \cdot y.im}}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}double f(double x_re, double x_im, double y_re, double y_im) {
double r1269781 = x_im;
double r1269782 = y_re;
double r1269783 = r1269781 * r1269782;
double r1269784 = x_re;
double r1269785 = y_im;
double r1269786 = r1269784 * r1269785;
double r1269787 = r1269783 - r1269786;
double r1269788 = r1269782 * r1269782;
double r1269789 = r1269785 * r1269785;
double r1269790 = r1269788 + r1269789;
double r1269791 = r1269787 / r1269790;
return r1269791;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r1269792 = y_re;
double r1269793 = -1.01458341645274e+165;
bool r1269794 = r1269792 <= r1269793;
double r1269795 = x_im;
double r1269796 = -r1269795;
double r1269797 = y_im;
double r1269798 = hypot(r1269792, r1269797);
double r1269799 = r1269796 / r1269798;
double r1269800 = 2.0408764461888536e+156;
bool r1269801 = r1269792 <= r1269800;
double r1269802 = 1.0;
double r1269803 = r1269795 * r1269792;
double r1269804 = x_re;
double r1269805 = r1269804 * r1269797;
double r1269806 = r1269803 - r1269805;
double r1269807 = r1269798 / r1269806;
double r1269808 = r1269802 / r1269807;
double r1269809 = r1269808 / r1269798;
double r1269810 = r1269795 / r1269798;
double r1269811 = r1269801 ? r1269809 : r1269810;
double r1269812 = r1269794 ? r1269799 : r1269811;
return r1269812;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.re < -1.01458341645274e+165Initial program 44.3
rmApplied add-sqr-sqrt44.3
Applied associate-/r*44.3
rmApplied fma-neg44.3
rmApplied hypot-def44.3
Taylor expanded around -inf 12.7
Simplified12.7
if -1.01458341645274e+165 < y.re < 2.0408764461888536e+156Initial program 19.6
rmApplied add-sqr-sqrt19.6
Applied associate-/r*19.5
rmApplied fma-neg19.5
rmApplied hypot-def19.5
rmApplied clear-num19.6
Simplified12.6
if 2.0408764461888536e+156 < y.re Initial program 44.7
rmApplied add-sqr-sqrt44.7
Applied associate-/r*44.7
rmApplied fma-neg44.7
rmApplied hypot-def44.7
Taylor expanded around inf 14.0
Final simplification12.8
herbie shell --seed 2019128 +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))))