\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 -1.4037038847053747 \cdot 10^{+154}:\\
\;\;\;\;\frac{-x.im}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{elif}\;y.re \le 1.8584161242035747 \cdot 10^{+93}:\\
\;\;\;\;\frac{\frac{1}{\frac{\mathsf{hypot}\left(y.im, y.re\right)}{x.im \cdot y.re - x.re \cdot y.im}}}{\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 r2160839 = x_im;
double r2160840 = y_re;
double r2160841 = r2160839 * r2160840;
double r2160842 = x_re;
double r2160843 = y_im;
double r2160844 = r2160842 * r2160843;
double r2160845 = r2160841 - r2160844;
double r2160846 = r2160840 * r2160840;
double r2160847 = r2160843 * r2160843;
double r2160848 = r2160846 + r2160847;
double r2160849 = r2160845 / r2160848;
return r2160849;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r2160850 = y_re;
double r2160851 = -1.4037038847053747e+154;
bool r2160852 = r2160850 <= r2160851;
double r2160853 = x_im;
double r2160854 = -r2160853;
double r2160855 = y_im;
double r2160856 = hypot(r2160855, r2160850);
double r2160857 = r2160854 / r2160856;
double r2160858 = 1.8584161242035747e+93;
bool r2160859 = r2160850 <= r2160858;
double r2160860 = 1.0;
double r2160861 = r2160853 * r2160850;
double r2160862 = x_re;
double r2160863 = r2160862 * r2160855;
double r2160864 = r2160861 - r2160863;
double r2160865 = r2160856 / r2160864;
double r2160866 = r2160860 / r2160865;
double r2160867 = r2160866 / r2160856;
double r2160868 = r2160853 / r2160856;
double r2160869 = r2160859 ? r2160867 : r2160868;
double r2160870 = r2160852 ? r2160857 : r2160869;
return r2160870;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.re < -1.4037038847053747e+154Initial program 43.9
Simplified43.9
rmApplied add-sqr-sqrt43.9
Applied associate-/r*43.9
rmApplied fma-udef43.9
Applied hypot-def43.9
rmApplied fma-udef43.9
Applied hypot-def27.1
Taylor expanded around -inf 13.2
Simplified13.2
if -1.4037038847053747e+154 < y.re < 1.8584161242035747e+93Initial program 18.9
Simplified18.9
rmApplied add-sqr-sqrt18.9
Applied associate-/r*18.8
rmApplied fma-udef18.8
Applied hypot-def18.8
rmApplied fma-udef18.8
Applied hypot-def11.7
rmApplied *-un-lft-identity11.7
Applied associate-/l*11.8
if 1.8584161242035747e+93 < y.re Initial program 37.5
Simplified37.5
rmApplied add-sqr-sqrt37.5
Applied associate-/r*37.5
rmApplied fma-udef37.5
Applied hypot-def37.5
rmApplied fma-udef37.5
Applied hypot-def24.3
Taylor expanded around inf 15.9
Final simplification12.8
herbie shell --seed 2019151 +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))))