\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\begin{array}{l}
\mathbf{if}\;y.im \le -1.0287542866145704 \cdot 10^{+96}:\\
\;\;\;\;\frac{1}{\frac{\mathsf{hypot}\left(y.im, y.re\right)}{-x.im}}\\
\mathbf{elif}\;y.im \le 6.658964062989261 \cdot 10^{+180}:\\
\;\;\;\;\frac{\frac{1}{\mathsf{hypot}\left(y.im, y.re\right)}}{\frac{1}{\frac{\mathsf{fma}\left(x.im, y.im, y.re \cdot x.re\right)}{\mathsf{hypot}\left(y.im, y.re\right)}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\mathsf{hypot}\left(y.im, y.re\right)}}{\frac{1}{x.im}}\\
\end{array}double f(double x_re, double x_im, double y_re, double y_im) {
double r1935893 = x_re;
double r1935894 = y_re;
double r1935895 = r1935893 * r1935894;
double r1935896 = x_im;
double r1935897 = y_im;
double r1935898 = r1935896 * r1935897;
double r1935899 = r1935895 + r1935898;
double r1935900 = r1935894 * r1935894;
double r1935901 = r1935897 * r1935897;
double r1935902 = r1935900 + r1935901;
double r1935903 = r1935899 / r1935902;
return r1935903;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r1935904 = y_im;
double r1935905 = -1.0287542866145704e+96;
bool r1935906 = r1935904 <= r1935905;
double r1935907 = 1.0;
double r1935908 = y_re;
double r1935909 = hypot(r1935904, r1935908);
double r1935910 = x_im;
double r1935911 = -r1935910;
double r1935912 = r1935909 / r1935911;
double r1935913 = r1935907 / r1935912;
double r1935914 = 6.658964062989261e+180;
bool r1935915 = r1935904 <= r1935914;
double r1935916 = r1935907 / r1935909;
double r1935917 = x_re;
double r1935918 = r1935908 * r1935917;
double r1935919 = fma(r1935910, r1935904, r1935918);
double r1935920 = r1935919 / r1935909;
double r1935921 = r1935907 / r1935920;
double r1935922 = r1935916 / r1935921;
double r1935923 = r1935907 / r1935910;
double r1935924 = r1935916 / r1935923;
double r1935925 = r1935915 ? r1935922 : r1935924;
double r1935926 = r1935906 ? r1935913 : r1935925;
return r1935926;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.im < -1.0287542866145704e+96Initial program 38.8
Simplified38.8
rmApplied add-sqr-sqrt38.8
Applied associate-/r*38.8
rmApplied clear-num38.8
Simplified26.2
Taylor expanded around -inf 17.5
Simplified17.5
if -1.0287542866145704e+96 < y.im < 6.658964062989261e+180Initial program 19.6
Simplified19.6
rmApplied add-sqr-sqrt19.6
Applied associate-/r*19.6
rmApplied clear-num19.8
Simplified12.5
rmApplied div-inv12.5
Applied associate-/r*12.3
if 6.658964062989261e+180 < y.im Initial program 44.1
Simplified44.1
rmApplied add-sqr-sqrt44.1
Applied associate-/r*44.1
rmApplied clear-num44.1
Simplified31.2
rmApplied div-inv31.2
Applied associate-/r*30.7
Taylor expanded around inf 11.9
Final simplification13.2
herbie shell --seed 2019152 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, real part"
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))