\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 -7.918258552369890831509695158247559340797 \cdot 10^{212}:\\
\;\;\;\;\frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \le 6.220962021564848334609656251804715714248 \cdot 10^{84}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.re, -y.im, y.re \cdot x.im\right) \cdot \frac{1}{\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 r52976 = x_im;
double r52977 = y_re;
double r52978 = r52976 * r52977;
double r52979 = x_re;
double r52980 = y_im;
double r52981 = r52979 * r52980;
double r52982 = r52978 - r52981;
double r52983 = r52977 * r52977;
double r52984 = r52980 * r52980;
double r52985 = r52983 + r52984;
double r52986 = r52982 / r52985;
return r52986;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r52987 = y_im;
double r52988 = -7.918258552369891e+212;
bool r52989 = r52987 <= r52988;
double r52990 = x_re;
double r52991 = y_re;
double r52992 = hypot(r52991, r52987);
double r52993 = r52990 / r52992;
double r52994 = 6.220962021564848e+84;
bool r52995 = r52987 <= r52994;
double r52996 = -r52987;
double r52997 = x_im;
double r52998 = r52991 * r52997;
double r52999 = fma(r52990, r52996, r52998);
double r53000 = 1.0;
double r53001 = r53000 / r52992;
double r53002 = r52999 * r53001;
double r53003 = r53002 / r52992;
double r53004 = -r52993;
double r53005 = r52995 ? r53003 : r53004;
double r53006 = r52989 ? r52993 : r53005;
return r53006;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.im < -7.918258552369891e+212Initial program 40.8
rmApplied add-sqr-sqrt40.8
Applied *-un-lft-identity40.8
Applied times-frac40.8
Simplified40.8
Simplified31.1
rmApplied associate-*r/31.1
Simplified31.1
Taylor expanded around -inf 9.7
if -7.918258552369891e+212 < y.im < 6.220962021564848e+84Initial program 21.1
rmApplied add-sqr-sqrt21.1
Applied *-un-lft-identity21.1
Applied times-frac21.1
Simplified21.1
Simplified13.3
rmApplied associate-*r/13.2
Simplified13.1
rmApplied div-inv13.2
if 6.220962021564848e+84 < y.im Initial program 37.6
rmApplied add-sqr-sqrt37.6
Applied *-un-lft-identity37.6
Applied times-frac37.6
Simplified37.6
Simplified25.2
rmApplied associate-*r/25.1
Simplified25.1
Taylor expanded around inf 17.2
Simplified17.2
Final simplification13.7
herbie shell --seed 2019195 +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))))