\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 -3.15237965316425658713861194838439775727 \cdot 10^{161}:\\
\;\;\;\;1 \cdot \frac{-1 \cdot x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \le 1.921207477017030655217671855912447948644 \cdot 10^{123}:\\
\;\;\;\;1 \cdot \frac{\frac{x.im \cdot y.re - x.re \cdot y.im}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \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 r90528 = x_im;
double r90529 = y_re;
double r90530 = r90528 * r90529;
double r90531 = x_re;
double r90532 = y_im;
double r90533 = r90531 * r90532;
double r90534 = r90530 - r90533;
double r90535 = r90529 * r90529;
double r90536 = r90532 * r90532;
double r90537 = r90535 + r90536;
double r90538 = r90534 / r90537;
return r90538;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r90539 = y_re;
double r90540 = -3.1523796531642566e+161;
bool r90541 = r90539 <= r90540;
double r90542 = 1.0;
double r90543 = -1.0;
double r90544 = x_im;
double r90545 = r90543 * r90544;
double r90546 = y_im;
double r90547 = hypot(r90539, r90546);
double r90548 = r90545 / r90547;
double r90549 = r90542 * r90548;
double r90550 = 1.9212074770170307e+123;
bool r90551 = r90539 <= r90550;
double r90552 = r90544 * r90539;
double r90553 = x_re;
double r90554 = r90553 * r90546;
double r90555 = r90552 - r90554;
double r90556 = r90555 / r90547;
double r90557 = r90556 / r90547;
double r90558 = r90542 * r90557;
double r90559 = r90544 / r90547;
double r90560 = r90542 * r90559;
double r90561 = r90551 ? r90558 : r90560;
double r90562 = r90541 ? r90549 : r90561;
return r90562;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.re < -3.1523796531642566e+161Initial program 45.4
rmApplied add-sqr-sqrt45.4
Applied *-un-lft-identity45.4
Applied times-frac45.4
Simplified45.4
Simplified29.9
rmApplied *-un-lft-identity29.9
Applied associate-*l*29.9
Simplified29.8
Taylor expanded around -inf 12.9
if -3.1523796531642566e+161 < y.re < 1.9212074770170307e+123Initial program 19.1
rmApplied add-sqr-sqrt19.1
Applied *-un-lft-identity19.1
Applied times-frac19.1
Simplified19.1
Simplified12.1
rmApplied *-un-lft-identity12.1
Applied associate-*l*12.1
Simplified12.0
if 1.9212074770170307e+123 < y.re Initial program 41.4
rmApplied add-sqr-sqrt41.4
Applied *-un-lft-identity41.4
Applied times-frac41.4
Simplified41.4
Simplified26.6
rmApplied *-un-lft-identity26.6
Applied associate-*l*26.6
Simplified26.6
Taylor expanded around inf 14.7
Final simplification12.5
herbie shell --seed 2019354 +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))))