\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 -3.54617340469776 \cdot 10^{+94}:\\
\;\;\;\;\frac{-x.im}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{elif}\;y.re \le 1.9951833757328278 \cdot 10^{+142}:\\
\;\;\;\;\frac{\frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.im, y.re\right)} - \frac{x.re \cdot y.im}{\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 r2070503 = x_im;
double r2070504 = y_re;
double r2070505 = r2070503 * r2070504;
double r2070506 = x_re;
double r2070507 = y_im;
double r2070508 = r2070506 * r2070507;
double r2070509 = r2070505 - r2070508;
double r2070510 = r2070504 * r2070504;
double r2070511 = r2070507 * r2070507;
double r2070512 = r2070510 + r2070511;
double r2070513 = r2070509 / r2070512;
return r2070513;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r2070514 = y_re;
double r2070515 = -3.54617340469776e+94;
bool r2070516 = r2070514 <= r2070515;
double r2070517 = x_im;
double r2070518 = -r2070517;
double r2070519 = y_im;
double r2070520 = hypot(r2070519, r2070514);
double r2070521 = r2070518 / r2070520;
double r2070522 = 1.9951833757328278e+142;
bool r2070523 = r2070514 <= r2070522;
double r2070524 = r2070517 * r2070514;
double r2070525 = r2070524 / r2070520;
double r2070526 = x_re;
double r2070527 = r2070526 * r2070519;
double r2070528 = r2070527 / r2070520;
double r2070529 = r2070525 - r2070528;
double r2070530 = r2070529 / r2070520;
double r2070531 = r2070517 / r2070520;
double r2070532 = r2070523 ? r2070530 : r2070531;
double r2070533 = r2070516 ? r2070521 : r2070532;
return r2070533;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.re < -3.54617340469776e+94Initial program 38.3
Simplified38.3
rmApplied add-sqr-sqrt38.3
Applied associate-/r*38.3
rmApplied fma-udef38.3
Applied hypot-def38.3
Taylor expanded around -inf 16.2
Simplified16.2
if -3.54617340469776e+94 < y.re < 1.9951833757328278e+142Initial program 18.6
Simplified18.6
rmApplied add-sqr-sqrt18.6
Applied associate-/r*18.5
rmApplied fma-udef18.5
Applied hypot-def18.5
rmApplied *-un-lft-identity18.5
Applied associate-/r*18.5
Simplified11.4
rmApplied div-sub11.4
if 1.9951833757328278e+142 < y.re Initial program 41.4
Simplified41.4
rmApplied add-sqr-sqrt41.4
Applied associate-/r*41.4
rmApplied fma-udef41.4
Applied hypot-def41.4
rmApplied *-un-lft-identity41.4
Applied associate-/r*41.4
Simplified27.2
Taylor expanded around inf 14.8
Final simplification12.8
herbie shell --seed 2019135 +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))))