\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 r1086356 = x_im;
double r1086357 = y_re;
double r1086358 = r1086356 * r1086357;
double r1086359 = x_re;
double r1086360 = y_im;
double r1086361 = r1086359 * r1086360;
double r1086362 = r1086358 - r1086361;
double r1086363 = r1086357 * r1086357;
double r1086364 = r1086360 * r1086360;
double r1086365 = r1086363 + r1086364;
double r1086366 = r1086362 / r1086365;
return r1086366;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r1086367 = y_re;
double r1086368 = -1.0127401874663891e+151;
bool r1086369 = r1086367 <= r1086368;
double r1086370 = x_im;
double r1086371 = y_im;
double r1086372 = hypot(r1086371, r1086367);
double r1086373 = r1086370 / r1086372;
double r1086374 = -r1086373;
double r1086375 = 1.6977188157374524e+71;
bool r1086376 = r1086367 <= r1086375;
double r1086377 = r1086370 * r1086367;
double r1086378 = x_re;
double r1086379 = r1086371 * r1086378;
double r1086380 = r1086377 - r1086379;
double r1086381 = r1086380 / r1086372;
double r1086382 = r1086381 / r1086372;
double r1086383 = r1086376 ? r1086382 : r1086373;
double r1086384 = r1086369 ? r1086374 : r1086383;
return r1086384;
}



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 *-un-lft-identity18.7
Applied associate-/r*18.7
Simplified11.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
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))))