\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 -4.78970221325173028480304050242606063264 \cdot 10^{151}:\\
\;\;\;\;\frac{-x.im}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{elif}\;y.re \le 7.209078410675664983392874709740943245737 \cdot 10^{132}:\\
\;\;\;\;\frac{\frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.im, y.re\right)}}{\mathsf{hypot}\left(y.im, y.re\right)} - \frac{\frac{y.im \cdot x.re}{\mathsf{hypot}\left(y.im, y.re\right)}}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\end{array}double f(double x_re, double x_im, double y_re, double y_im) {
double r2545182 = x_im;
double r2545183 = y_re;
double r2545184 = r2545182 * r2545183;
double r2545185 = x_re;
double r2545186 = y_im;
double r2545187 = r2545185 * r2545186;
double r2545188 = r2545184 - r2545187;
double r2545189 = r2545183 * r2545183;
double r2545190 = r2545186 * r2545186;
double r2545191 = r2545189 + r2545190;
double r2545192 = r2545188 / r2545191;
return r2545192;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r2545193 = y_re;
double r2545194 = -4.78970221325173e+151;
bool r2545195 = r2545193 <= r2545194;
double r2545196 = x_im;
double r2545197 = -r2545196;
double r2545198 = y_im;
double r2545199 = hypot(r2545198, r2545193);
double r2545200 = r2545197 / r2545199;
double r2545201 = 7.209078410675665e+132;
bool r2545202 = r2545193 <= r2545201;
double r2545203 = r2545196 * r2545193;
double r2545204 = r2545203 / r2545199;
double r2545205 = r2545204 / r2545199;
double r2545206 = x_re;
double r2545207 = r2545198 * r2545206;
double r2545208 = r2545207 / r2545199;
double r2545209 = r2545208 / r2545199;
double r2545210 = r2545205 - r2545209;
double r2545211 = r2545196 / r2545199;
double r2545212 = r2545202 ? r2545210 : r2545211;
double r2545213 = r2545195 ? r2545200 : r2545212;
return r2545213;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.re < -4.78970221325173e+151Initial program 44.6
Simplified44.6
rmApplied add-sqr-sqrt44.6
Applied associate-/r*44.6
rmApplied fma-udef44.6
Applied hypot-def44.6
Taylor expanded around -inf 13.0
Simplified13.0
if -4.78970221325173e+151 < y.re < 7.209078410675665e+132Initial program 19.2
Simplified19.2
rmApplied add-sqr-sqrt19.2
Applied associate-/r*19.1
rmApplied fma-udef19.1
Applied hypot-def19.1
rmApplied *-un-lft-identity19.1
Applied associate-/r*19.1
Simplified12.1
rmApplied div-sub12.1
Applied div-sub12.1
if 7.209078410675665e+132 < y.re Initial program 42.3
Simplified42.3
rmApplied add-sqr-sqrt42.3
Applied associate-/r*42.3
rmApplied fma-udef42.3
Applied hypot-def42.3
Taylor expanded around inf 14.4
Final simplification12.6
herbie shell --seed 2019168 +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))))