\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 -6.603705426560988 \cdot 10^{+145}:\\
\;\;\;\;-\frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{elif}\;y.re \le 7.75132925369235 \cdot 10^{+139}:\\
\;\;\;\;\frac{\frac{x.im \cdot y.re - 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 r1595590 = x_im;
double r1595591 = y_re;
double r1595592 = r1595590 * r1595591;
double r1595593 = x_re;
double r1595594 = y_im;
double r1595595 = r1595593 * r1595594;
double r1595596 = r1595592 - r1595595;
double r1595597 = r1595591 * r1595591;
double r1595598 = r1595594 * r1595594;
double r1595599 = r1595597 + r1595598;
double r1595600 = r1595596 / r1595599;
return r1595600;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r1595601 = y_re;
double r1595602 = -6.603705426560988e+145;
bool r1595603 = r1595601 <= r1595602;
double r1595604 = x_im;
double r1595605 = y_im;
double r1595606 = hypot(r1595605, r1595601);
double r1595607 = r1595604 / r1595606;
double r1595608 = -r1595607;
double r1595609 = 7.75132925369235e+139;
bool r1595610 = r1595601 <= r1595609;
double r1595611 = r1595604 * r1595601;
double r1595612 = x_re;
double r1595613 = r1595605 * r1595612;
double r1595614 = r1595611 - r1595613;
double r1595615 = r1595614 / r1595606;
double r1595616 = r1595615 / r1595606;
double r1595617 = r1595610 ? r1595616 : r1595607;
double r1595618 = r1595603 ? r1595608 : r1595617;
return r1595618;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.re < -6.603705426560988e+145Initial program 43.7
Simplified43.7
rmApplied add-sqr-sqrt43.7
Applied associate-/r*43.7
rmApplied fma-udef43.7
Applied hypot-def43.7
rmApplied fma-udef43.7
Applied hypot-def28.4
Taylor expanded around -inf 14.1
Simplified14.1
if -6.603705426560988e+145 < y.re < 7.75132925369235e+139Initial program 19.0
Simplified19.0
rmApplied add-sqr-sqrt19.0
Applied associate-/r*19.0
rmApplied fma-udef19.0
Applied hypot-def18.9
rmApplied fma-udef18.9
Applied hypot-def12.3
Taylor expanded around inf 12.3
if 7.75132925369235e+139 < y.re Initial program 42.9
Simplified42.9
rmApplied add-sqr-sqrt42.9
Applied associate-/r*42.9
rmApplied fma-udef42.9
Applied hypot-def42.9
rmApplied fma-udef42.9
Applied hypot-def29.0
Taylor expanded around inf 15.2
Final simplification13.0
herbie shell --seed 2019156 +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))))