\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}\;x.re \le -2.2571318052192643 \cdot 10^{53} \lor \neg \left(x.re \le 5.3039295420371848 \cdot 10^{69}\right):\\
\;\;\;\;\frac{\frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{x.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{x.re \cdot y.im}{\mathsf{hypot}\left(y.re, y.im\right)}}{\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 r56441 = x_im;
double r56442 = y_re;
double r56443 = r56441 * r56442;
double r56444 = x_re;
double r56445 = y_im;
double r56446 = r56444 * r56445;
double r56447 = r56443 - r56446;
double r56448 = r56442 * r56442;
double r56449 = r56445 * r56445;
double r56450 = r56448 + r56449;
double r56451 = r56447 / r56450;
return r56451;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r56452 = x_re;
double r56453 = -2.2571318052192643e+53;
bool r56454 = r56452 <= r56453;
double r56455 = 5.303929542037185e+69;
bool r56456 = r56452 <= r56455;
double r56457 = !r56456;
bool r56458 = r56454 || r56457;
double r56459 = x_im;
double r56460 = y_re;
double r56461 = r56459 * r56460;
double r56462 = y_im;
double r56463 = hypot(r56460, r56462);
double r56464 = r56461 / r56463;
double r56465 = r56463 / r56462;
double r56466 = r56452 / r56465;
double r56467 = r56464 - r56466;
double r56468 = r56467 / r56463;
double r56469 = r56460 / r56463;
double r56470 = r56459 * r56469;
double r56471 = r56452 * r56462;
double r56472 = r56471 / r56463;
double r56473 = r56470 - r56472;
double r56474 = r56473 / r56463;
double r56475 = r56458 ? r56468 : r56474;
return r56475;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if x.re < -2.2571318052192643e+53 or 5.303929542037185e+69 < x.re Initial program 33.8
rmApplied add-sqr-sqrt33.8
Applied *-un-lft-identity33.8
Applied times-frac33.8
Simplified33.8
Simplified27.1
rmApplied associate-*r/27.0
Simplified27.0
rmApplied div-sub27.0
rmApplied associate-/l*9.6
if -2.2571318052192643e+53 < x.re < 5.303929542037185e+69Initial program 21.5
rmApplied add-sqr-sqrt21.5
Applied *-un-lft-identity21.5
Applied times-frac21.5
Simplified21.5
Simplified10.5
rmApplied associate-*r/10.5
Simplified10.4
rmApplied div-sub10.4
rmApplied *-un-lft-identity10.4
Applied times-frac1.4
Simplified1.4
Final simplification4.5
herbie shell --seed 2020021 +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))))