\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 -2.352328066947031545696719548869417237498 \cdot 10^{129}:\\
\;\;\;\;\frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \le 3.537716084017609608802200540186130786223 \cdot 10^{123}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(-y.im, x.re, y.re \cdot x.im\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x.re}{\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 r52358 = x_im;
double r52359 = y_re;
double r52360 = r52358 * r52359;
double r52361 = x_re;
double r52362 = y_im;
double r52363 = r52361 * r52362;
double r52364 = r52360 - r52363;
double r52365 = r52359 * r52359;
double r52366 = r52362 * r52362;
double r52367 = r52365 + r52366;
double r52368 = r52364 / r52367;
return r52368;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r52369 = y_im;
double r52370 = -2.3523280669470315e+129;
bool r52371 = r52369 <= r52370;
double r52372 = x_re;
double r52373 = y_re;
double r52374 = hypot(r52373, r52369);
double r52375 = r52372 / r52374;
double r52376 = 3.5377160840176096e+123;
bool r52377 = r52369 <= r52376;
double r52378 = -r52369;
double r52379 = x_im;
double r52380 = r52373 * r52379;
double r52381 = fma(r52378, r52372, r52380);
double r52382 = r52381 / r52374;
double r52383 = r52382 / r52374;
double r52384 = -r52372;
double r52385 = r52384 / r52374;
double r52386 = r52377 ? r52383 : r52385;
double r52387 = r52371 ? r52375 : r52386;
return r52387;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.im < -2.3523280669470315e+129Initial program 40.8
Simplified40.8
rmApplied add-sqr-sqrt40.8
Applied *-un-lft-identity40.8
Applied times-frac40.8
Simplified40.8
Simplified26.9
rmApplied associate-*r/26.9
Simplified26.9
Taylor expanded around -inf 14.7
if -2.3523280669470315e+129 < y.im < 3.5377160840176096e+123Initial program 18.5
Simplified18.5
rmApplied add-sqr-sqrt18.5
Applied *-un-lft-identity18.5
Applied times-frac18.5
Simplified18.5
Simplified11.6
rmApplied associate-*r/11.5
Simplified11.4
if 3.5377160840176096e+123 < y.im Initial program 40.8
Simplified40.8
rmApplied add-sqr-sqrt40.8
Applied *-un-lft-identity40.8
Applied times-frac40.8
Simplified40.8
Simplified26.4
rmApplied associate-*r/26.3
Simplified26.3
Taylor expanded around inf 15.6
Simplified15.6
Final simplification12.6
herbie shell --seed 2019212 +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))))