\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.0127401874663891 \cdot 10^{+151}:\\
\;\;\;\;-\frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{elif}\;y.re \le 1.6977188157374524 \cdot 10^{+71}:\\
\;\;\;\;\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 r1138701 = x_im;
double r1138702 = y_re;
double r1138703 = r1138701 * r1138702;
double r1138704 = x_re;
double r1138705 = y_im;
double r1138706 = r1138704 * r1138705;
double r1138707 = r1138703 - r1138706;
double r1138708 = r1138702 * r1138702;
double r1138709 = r1138705 * r1138705;
double r1138710 = r1138708 + r1138709;
double r1138711 = r1138707 / r1138710;
return r1138711;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r1138712 = y_re;
double r1138713 = -1.0127401874663891e+151;
bool r1138714 = r1138712 <= r1138713;
double r1138715 = x_im;
double r1138716 = y_im;
double r1138717 = hypot(r1138716, r1138712);
double r1138718 = r1138715 / r1138717;
double r1138719 = -r1138718;
double r1138720 = 1.6977188157374524e+71;
bool r1138721 = r1138712 <= r1138720;
double r1138722 = r1138715 * r1138712;
double r1138723 = x_re;
double r1138724 = r1138716 * r1138723;
double r1138725 = r1138722 - r1138724;
double r1138726 = r1138725 / r1138717;
double r1138727 = r1138726 / r1138717;
double r1138728 = r1138721 ? r1138727 : r1138718;
double r1138729 = r1138714 ? r1138719 : r1138728;
return r1138729;
}



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.0127401874663891e+151Initial program 43.5
Simplified43.5
rmApplied add-sqr-sqrt43.5
Applied associate-/r*43.5
rmApplied fma-udef43.5
Applied hypot-def43.5
Taylor expanded around -inf 13.0
Simplified13.0
if -1.0127401874663891e+151 < y.re < 1.6977188157374524e+71Initial program 18.8
Simplified18.8
rmApplied add-sqr-sqrt18.8
Applied associate-/r*18.7
rmApplied fma-udef18.7
Applied hypot-def18.7
rmApplied fma-udef18.7
Applied hypot-def11.5
if 1.6977188157374524e+71 < y.re Initial program 35.8
Simplified35.8
rmApplied add-sqr-sqrt35.8
Applied associate-/r*35.8
rmApplied fma-udef35.8
Applied hypot-def35.8
rmApplied fma-udef35.8
Applied hypot-def23.5
Taylor expanded around inf 17.3
Final simplification12.9
herbie shell --seed 2019153 +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))))