\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.8763806766248217 \cdot 10^{136}:\\
\;\;\;\;\frac{-1 \cdot x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \le 6.60217994199644213 \cdot 10^{202}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right) \cdot 1} \cdot \frac{\mathsf{fma}\left(x.im, y.re, -x.re \cdot 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 f(double x_re, double x_im, double y_re, double y_im) {
double r56411 = x_im;
double r56412 = y_re;
double r56413 = r56411 * r56412;
double r56414 = x_re;
double r56415 = y_im;
double r56416 = r56414 * r56415;
double r56417 = r56413 - r56416;
double r56418 = r56412 * r56412;
double r56419 = r56415 * r56415;
double r56420 = r56418 + r56419;
double r56421 = r56417 / r56420;
return r56421;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r56422 = y_re;
double r56423 = -2.8763806766248217e+136;
bool r56424 = r56422 <= r56423;
double r56425 = -1.0;
double r56426 = x_im;
double r56427 = r56425 * r56426;
double r56428 = y_im;
double r56429 = hypot(r56422, r56428);
double r56430 = r56427 / r56429;
double r56431 = 6.602179941996442e+202;
bool r56432 = r56422 <= r56431;
double r56433 = 1.0;
double r56434 = r56429 * r56433;
double r56435 = r56433 / r56434;
double r56436 = x_re;
double r56437 = r56436 * r56428;
double r56438 = -r56437;
double r56439 = fma(r56426, r56422, r56438);
double r56440 = r56439 / r56429;
double r56441 = r56435 * r56440;
double r56442 = r56426 / r56429;
double r56443 = r56432 ? r56441 : r56442;
double r56444 = r56424 ? r56430 : r56443;
return r56444;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -2.8763806766248217e+136Initial program 41.7
rmApplied add-sqr-sqrt41.7
Applied *-un-lft-identity41.7
Applied times-frac41.7
Simplified41.7
Simplified27.3
rmApplied associate-*r/27.3
Simplified27.2
Taylor expanded around -inf 15.1
if -2.8763806766248217e+136 < y.re < 6.602179941996442e+202Initial program 21.3
rmApplied add-sqr-sqrt21.3
Applied *-un-lft-identity21.3
Applied times-frac21.3
Simplified21.3
Simplified13.1
rmApplied fma-neg13.1
if 6.602179941996442e+202 < y.re Initial program 41.0
rmApplied add-sqr-sqrt41.0
Applied *-un-lft-identity41.0
Applied times-frac41.0
Simplified41.0
Simplified29.3
rmApplied associate-*r/29.2
Simplified29.2
Taylor expanded around inf 12.0
Final simplification13.3
herbie shell --seed 2020018 +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))))