\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 -5.58972528481860216307208015835708105017 \cdot 10^{116}:\\
\;\;\;\;\frac{-x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \le 4.790153388469599519369386020665188076147 \cdot 10^{114}:\\
\;\;\;\;\frac{\frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{x.re \cdot y.im}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\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 r2402029 = x_im;
double r2402030 = y_re;
double r2402031 = r2402029 * r2402030;
double r2402032 = x_re;
double r2402033 = y_im;
double r2402034 = r2402032 * r2402033;
double r2402035 = r2402031 - r2402034;
double r2402036 = r2402030 * r2402030;
double r2402037 = r2402033 * r2402033;
double r2402038 = r2402036 + r2402037;
double r2402039 = r2402035 / r2402038;
return r2402039;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r2402040 = y_re;
double r2402041 = -5.589725284818602e+116;
bool r2402042 = r2402040 <= r2402041;
double r2402043 = x_im;
double r2402044 = -r2402043;
double r2402045 = y_im;
double r2402046 = hypot(r2402040, r2402045);
double r2402047 = r2402044 / r2402046;
double r2402048 = 4.7901533884695995e+114;
bool r2402049 = r2402040 <= r2402048;
double r2402050 = r2402043 * r2402040;
double r2402051 = r2402050 / r2402046;
double r2402052 = x_re;
double r2402053 = r2402052 * r2402045;
double r2402054 = r2402053 / r2402046;
double r2402055 = r2402051 - r2402054;
double r2402056 = r2402055 / r2402046;
double r2402057 = r2402043 / r2402046;
double r2402058 = r2402049 ? r2402056 : r2402057;
double r2402059 = r2402042 ? r2402047 : r2402058;
return r2402059;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.re < -5.589725284818602e+116Initial program 41.3
Simplified41.3
rmApplied add-sqr-sqrt41.3
Applied associate-/r*41.3
rmApplied clear-num41.5
Simplified28.7
rmApplied associate-/r*28.1
Simplified28.1
Taylor expanded around -inf 15.8
Simplified15.8
if -5.589725284818602e+116 < y.re < 4.7901533884695995e+114Initial program 18.6
Simplified18.6
rmApplied add-sqr-sqrt18.6
Applied associate-/r*18.5
rmApplied clear-num18.7
Simplified11.8
rmApplied associate-/r*11.4
Simplified11.3
rmApplied div-sub11.3
if 4.7901533884695995e+114 < y.re Initial program 40.4
Simplified40.4
rmApplied add-sqr-sqrt40.4
Applied associate-/r*40.4
rmApplied clear-num40.4
Simplified27.7
rmApplied associate-/r*27.2
Simplified27.1
Taylor expanded around inf 15.4
Final simplification12.7
herbie shell --seed 2019200 +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))))