\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 -4.431736220616081 \cdot 10^{+97}:\\
\;\;\;\;-\frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{elif}\;y.re \le 6.920723654382158 \cdot 10^{+133}:\\
\;\;\;\;\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 r1772515 = x_im;
double r1772516 = y_re;
double r1772517 = r1772515 * r1772516;
double r1772518 = x_re;
double r1772519 = y_im;
double r1772520 = r1772518 * r1772519;
double r1772521 = r1772517 - r1772520;
double r1772522 = r1772516 * r1772516;
double r1772523 = r1772519 * r1772519;
double r1772524 = r1772522 + r1772523;
double r1772525 = r1772521 / r1772524;
return r1772525;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r1772526 = y_re;
double r1772527 = -4.431736220616081e+97;
bool r1772528 = r1772526 <= r1772527;
double r1772529 = x_im;
double r1772530 = y_im;
double r1772531 = hypot(r1772530, r1772526);
double r1772532 = r1772529 / r1772531;
double r1772533 = -r1772532;
double r1772534 = 6.920723654382158e+133;
bool r1772535 = r1772526 <= r1772534;
double r1772536 = r1772529 * r1772526;
double r1772537 = x_re;
double r1772538 = r1772530 * r1772537;
double r1772539 = r1772536 - r1772538;
double r1772540 = r1772539 / r1772531;
double r1772541 = r1772540 / r1772531;
double r1772542 = r1772535 ? r1772541 : r1772532;
double r1772543 = r1772528 ? r1772533 : r1772542;
return r1772543;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.re < -4.431736220616081e+97Initial program 39.3
Simplified39.3
rmApplied add-sqr-sqrt39.3
Applied associate-/r*39.3
rmApplied div-inv39.3
rmApplied fma-udef39.3
Applied hypot-def39.3
Taylor expanded around -inf 17.3
Simplified17.3
if -4.431736220616081e+97 < y.re < 6.920723654382158e+133Initial program 19.0
Simplified19.0
rmApplied add-sqr-sqrt19.0
Applied associate-/r*18.9
rmApplied div-inv19.0
rmApplied fma-udef19.0
Applied hypot-def19.0
rmApplied *-un-lft-identity19.0
Applied associate-/r*19.0
Simplified11.7
if 6.920723654382158e+133 < y.re Initial program 41.4
Simplified41.4
rmApplied add-sqr-sqrt41.4
Applied associate-/r*41.4
rmApplied div-inv41.4
rmApplied fma-udef41.4
Applied hypot-def41.4
Taylor expanded around inf 13.7
Final simplification13.0
herbie shell --seed 2019146 +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))))