\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.565167565781187104932955349587597625361 \cdot 10^{162}:\\
\;\;\;\;\frac{-x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \le 6.152282888480768325547605387077337858415 \cdot 10^{76}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(y.re, x.im, -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 r59677 = x_im;
double r59678 = y_re;
double r59679 = r59677 * r59678;
double r59680 = x_re;
double r59681 = y_im;
double r59682 = r59680 * r59681;
double r59683 = r59679 - r59682;
double r59684 = r59678 * r59678;
double r59685 = r59681 * r59681;
double r59686 = r59684 + r59685;
double r59687 = r59683 / r59686;
return r59687;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r59688 = y_re;
double r59689 = -1.5651675657811871e+162;
bool r59690 = r59688 <= r59689;
double r59691 = x_im;
double r59692 = -r59691;
double r59693 = y_im;
double r59694 = hypot(r59688, r59693);
double r59695 = r59692 / r59694;
double r59696 = 6.152282888480768e+76;
bool r59697 = r59688 <= r59696;
double r59698 = x_re;
double r59699 = r59693 * r59698;
double r59700 = -r59699;
double r59701 = fma(r59688, r59691, r59700);
double r59702 = r59701 / r59694;
double r59703 = r59702 / r59694;
double r59704 = r59691 / r59694;
double r59705 = r59697 ? r59703 : r59704;
double r59706 = r59690 ? r59695 : r59705;
return r59706;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -1.5651675657811871e+162Initial program 45.9
Simplified45.9
rmApplied add-sqr-sqrt45.9
Applied *-un-lft-identity45.9
Applied times-frac45.9
Simplified45.9
Simplified30.7
rmApplied associate-*r/30.7
Simplified30.7
Taylor expanded around -inf 13.3
Simplified13.3
if -1.5651675657811871e+162 < y.re < 6.152282888480768e+76Initial program 18.7
Simplified18.7
rmApplied add-sqr-sqrt18.7
Applied *-un-lft-identity18.7
Applied times-frac18.7
Simplified18.7
Simplified11.4
rmApplied associate-*r/11.4
Simplified11.3
if 6.152282888480768e+76 < y.re Initial program 37.3
Simplified37.3
rmApplied add-sqr-sqrt37.3
Applied *-un-lft-identity37.3
Applied times-frac37.3
Simplified37.3
Simplified26.1
rmApplied associate-*r/26.1
Simplified26.1
Taylor expanded around inf 17.8
Final simplification12.8
herbie shell --seed 2019209 +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))))