\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 -2.7676331920395071 \cdot 10^{175}:\\
\;\;\;\;1 \cdot \frac{-1 \cdot x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \le 6.04553138193686982 \cdot 10^{136}:\\
\;\;\;\;\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) \cdot 1}\\
\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 r53810 = x_im;
double r53811 = y_re;
double r53812 = r53810 * r53811;
double r53813 = x_re;
double r53814 = y_im;
double r53815 = r53813 * r53814;
double r53816 = r53812 - r53815;
double r53817 = r53811 * r53811;
double r53818 = r53814 * r53814;
double r53819 = r53817 + r53818;
double r53820 = r53816 / r53819;
return r53820;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r53821 = y_re;
double r53822 = -2.767633192039507e+175;
bool r53823 = r53821 <= r53822;
double r53824 = 1.0;
double r53825 = -1.0;
double r53826 = x_im;
double r53827 = r53825 * r53826;
double r53828 = y_im;
double r53829 = hypot(r53821, r53828);
double r53830 = r53827 / r53829;
double r53831 = r53824 * r53830;
double r53832 = 6.04553138193687e+136;
bool r53833 = r53821 <= r53832;
double r53834 = r53826 * r53821;
double r53835 = x_re;
double r53836 = r53835 * r53828;
double r53837 = r53834 - r53836;
double r53838 = r53837 / r53829;
double r53839 = r53829 * r53824;
double r53840 = r53838 / r53839;
double r53841 = r53826 / r53829;
double r53842 = r53824 * r53841;
double r53843 = r53833 ? r53840 : r53842;
double r53844 = r53823 ? r53831 : r53843;
return r53844;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.re < -2.767633192039507e+175Initial program 43.4
rmApplied add-sqr-sqrt43.4
Applied *-un-lft-identity43.4
Applied times-frac43.4
Simplified43.4
Simplified30.0
rmApplied *-un-lft-identity30.0
Applied associate-*l*30.0
Simplified30.0
Taylor expanded around -inf 12.2
if -2.767633192039507e+175 < y.re < 6.04553138193687e+136Initial program 19.5
rmApplied add-sqr-sqrt19.5
Applied *-un-lft-identity19.5
Applied times-frac19.6
Simplified19.6
Simplified12.2
rmApplied clear-num12.3
rmApplied associate-*l/12.2
Simplified12.1
if 6.04553138193687e+136 < y.re Initial program 42.2
rmApplied add-sqr-sqrt42.2
Applied *-un-lft-identity42.2
Applied times-frac42.2
Simplified42.2
Simplified27.3
rmApplied *-un-lft-identity27.3
Applied associate-*l*27.3
Simplified27.2
Taylor expanded around inf 14.6
Final simplification12.5
herbie shell --seed 2020047 +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))))