\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 -7.628418106649201380940868857866613274008 \cdot 10^{231} \lor \neg \left(y.re \le 6.466645064161413486396068949012084680784 \cdot 10^{58}\right):\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{\frac{y.im \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y.re \cdot x.im}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{\frac{y.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{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 r41142 = x_im;
double r41143 = y_re;
double r41144 = r41142 * r41143;
double r41145 = x_re;
double r41146 = y_im;
double r41147 = r41145 * r41146;
double r41148 = r41144 - r41147;
double r41149 = r41143 * r41143;
double r41150 = r41146 * r41146;
double r41151 = r41149 + r41150;
double r41152 = r41148 / r41151;
return r41152;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r41153 = y_re;
double r41154 = -7.628418106649201e+231;
bool r41155 = r41153 <= r41154;
double r41156 = 6.466645064161413e+58;
bool r41157 = r41153 <= r41156;
double r41158 = !r41157;
bool r41159 = r41155 || r41158;
double r41160 = x_im;
double r41161 = y_im;
double r41162 = hypot(r41153, r41161);
double r41163 = r41160 / r41162;
double r41164 = r41153 * r41163;
double r41165 = r41164 / r41162;
double r41166 = x_re;
double r41167 = r41161 * r41166;
double r41168 = r41167 / r41162;
double r41169 = r41168 / r41162;
double r41170 = r41165 - r41169;
double r41171 = r41153 * r41160;
double r41172 = r41171 / r41162;
double r41173 = r41172 / r41162;
double r41174 = r41162 / r41166;
double r41175 = r41161 / r41174;
double r41176 = r41175 / r41162;
double r41177 = r41173 - r41176;
double r41178 = r41159 ? r41170 : r41177;
return r41178;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.re < -7.628418106649201e+231 or 6.466645064161413e+58 < y.re Initial program 37.7
Simplified37.7
rmApplied add-sqr-sqrt37.7
Applied *-un-lft-identity37.7
Applied times-frac37.7
Simplified37.7
Simplified26.7
rmApplied associate-*r/26.7
Simplified26.7
rmApplied div-sub26.7
Applied div-sub26.7
rmApplied *-un-lft-identity26.7
Applied times-frac7.8
Simplified7.8
if -7.628418106649201e+231 < y.re < 6.466645064161413e+58Initial program 22.2
Simplified22.2
rmApplied add-sqr-sqrt22.2
Applied *-un-lft-identity22.2
Applied times-frac22.2
Simplified22.2
Simplified13.4
rmApplied associate-*r/13.3
Simplified13.2
rmApplied div-sub13.2
Applied div-sub13.2
rmApplied associate-/l*5.2
Final simplification5.9
herbie shell --seed 2019235 +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))))