\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.10226154286646485 \cdot 10^{147}:\\
\;\;\;\;\frac{-x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \le 8.6334403648755915 \cdot 10^{78}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x.im, y.re, -y.im \cdot x.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{\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 r47290 = x_im;
double r47291 = y_re;
double r47292 = r47290 * r47291;
double r47293 = x_re;
double r47294 = y_im;
double r47295 = r47293 * r47294;
double r47296 = r47292 - r47295;
double r47297 = r47291 * r47291;
double r47298 = r47294 * r47294;
double r47299 = r47297 + r47298;
double r47300 = r47296 / r47299;
return r47300;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r47301 = y_re;
double r47302 = -1.1022615428664649e+147;
bool r47303 = r47301 <= r47302;
double r47304 = x_im;
double r47305 = -r47304;
double r47306 = y_im;
double r47307 = hypot(r47301, r47306);
double r47308 = r47305 / r47307;
double r47309 = 8.633440364875592e+78;
bool r47310 = r47301 <= r47309;
double r47311 = x_re;
double r47312 = r47306 * r47311;
double r47313 = -r47312;
double r47314 = fma(r47304, r47301, r47313);
double r47315 = r47314 / r47307;
double r47316 = r47315 / r47307;
double r47317 = r47304 / r47307;
double r47318 = r47310 ? r47316 : r47317;
double r47319 = r47303 ? r47308 : r47318;
return r47319;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -1.1022615428664649e+147Initial program 43.9
rmApplied add-sqr-sqrt43.9
Applied *-un-lft-identity43.9
Applied times-frac43.9
Simplified43.9
Simplified28.9
rmApplied associate-*r/28.9
Simplified28.9
Taylor expanded around -inf 14.1
Simplified14.1
if -1.1022615428664649e+147 < y.re < 8.633440364875592e+78Initial program 18.4
rmApplied add-sqr-sqrt18.4
Applied *-un-lft-identity18.4
Applied times-frac18.4
Simplified18.4
Simplified11.7
rmApplied associate-*r/11.7
Simplified11.6
if 8.633440364875592e+78 < y.re Initial program 38.7
rmApplied add-sqr-sqrt38.7
Applied *-un-lft-identity38.7
Applied times-frac38.7
Simplified38.7
Simplified27.0
rmApplied associate-*r/26.9
Simplified26.9
Taylor expanded around inf 17.2
Final simplification13.0
herbie shell --seed 2019195 +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))))