\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.4815058757062313 \cdot 10^{+190}:\\
\;\;\;\;-\frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{elif}\;y.re \le 4.948399038442073 \cdot 10^{+94}:\\
\;\;\;\;\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 r2152062 = x_im;
double r2152063 = y_re;
double r2152064 = r2152062 * r2152063;
double r2152065 = x_re;
double r2152066 = y_im;
double r2152067 = r2152065 * r2152066;
double r2152068 = r2152064 - r2152067;
double r2152069 = r2152063 * r2152063;
double r2152070 = r2152066 * r2152066;
double r2152071 = r2152069 + r2152070;
double r2152072 = r2152068 / r2152071;
return r2152072;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r2152073 = y_re;
double r2152074 = -1.4815058757062313e+190;
bool r2152075 = r2152073 <= r2152074;
double r2152076 = x_im;
double r2152077 = y_im;
double r2152078 = hypot(r2152077, r2152073);
double r2152079 = r2152076 / r2152078;
double r2152080 = -r2152079;
double r2152081 = 4.948399038442073e+94;
bool r2152082 = r2152073 <= r2152081;
double r2152083 = r2152076 * r2152073;
double r2152084 = x_re;
double r2152085 = r2152077 * r2152084;
double r2152086 = r2152083 - r2152085;
double r2152087 = r2152086 / r2152078;
double r2152088 = r2152087 / r2152078;
double r2152089 = r2152082 ? r2152088 : r2152079;
double r2152090 = r2152075 ? r2152080 : r2152089;
return r2152090;
}



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.4815058757062313e+190Initial program 41.5
Simplified41.5
rmApplied add-sqr-sqrt41.5
Applied *-un-lft-identity41.5
Applied times-frac41.5
rmApplied fma-udef41.5
Applied hypot-def41.5
rmApplied associate-*l/41.5
Simplified30.3
Taylor expanded around -inf 11.0
Simplified11.0
if -1.4815058757062313e+190 < y.re < 4.948399038442073e+94Initial program 20.1
Simplified20.1
rmApplied add-sqr-sqrt20.1
Applied *-un-lft-identity20.1
Applied times-frac20.1
rmApplied fma-udef20.1
Applied hypot-def20.1
rmApplied associate-*l/20.0
Simplified12.3
if 4.948399038442073e+94 < y.re Initial program 38.5
Simplified38.5
rmApplied add-sqr-sqrt38.5
Applied *-un-lft-identity38.5
Applied times-frac38.5
rmApplied fma-udef38.5
Applied hypot-def38.5
rmApplied associate-*l/38.5
Simplified25.3
Taylor expanded around inf 16.6
Final simplification12.9
herbie shell --seed 2019142 +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))))