\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.im \le 1.5173701027657723 \cdot 10^{98}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right) \cdot 1} \cdot \frac{1}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im \cdot y.re - x.re \cdot y.im}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{-1 \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\right)}^{1}\\
\end{array}double f(double x_re, double x_im, double y_re, double y_im) {
double r74862 = x_im;
double r74863 = y_re;
double r74864 = r74862 * r74863;
double r74865 = x_re;
double r74866 = y_im;
double r74867 = r74865 * r74866;
double r74868 = r74864 - r74867;
double r74869 = r74863 * r74863;
double r74870 = r74866 * r74866;
double r74871 = r74869 + r74870;
double r74872 = r74868 / r74871;
return r74872;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r74873 = y_im;
double r74874 = 1.5173701027657723e+98;
bool r74875 = r74873 <= r74874;
double r74876 = 1.0;
double r74877 = y_re;
double r74878 = hypot(r74877, r74873);
double r74879 = r74878 * r74876;
double r74880 = r74876 / r74879;
double r74881 = x_im;
double r74882 = r74881 * r74877;
double r74883 = x_re;
double r74884 = r74883 * r74873;
double r74885 = r74882 - r74884;
double r74886 = r74878 / r74885;
double r74887 = r74876 / r74886;
double r74888 = r74880 * r74887;
double r74889 = -1.0;
double r74890 = r74889 * r74883;
double r74891 = r74890 / r74878;
double r74892 = pow(r74891, r74876);
double r74893 = r74875 ? r74888 : r74892;
return r74893;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.im < 1.5173701027657723e+98Initial program 22.6
rmApplied add-sqr-sqrt22.6
Applied *-un-lft-identity22.6
Applied times-frac22.6
Simplified22.6
Simplified14.0
rmApplied clear-num14.0
if 1.5173701027657723e+98 < y.im Initial program 39.2
rmApplied add-sqr-sqrt39.2
Applied *-un-lft-identity39.2
Applied times-frac39.2
Simplified39.2
Simplified26.3
rmApplied pow126.3
Applied pow126.3
Applied pow-prod-down26.3
Simplified26.2
Taylor expanded around 0 16.8
Final simplification14.5
herbie shell --seed 2020035 +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))))