\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.re \le -1.2881291875463798 \cdot 10^{147}:\\
\;\;\;\;\frac{-1 \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot 1}\\
\mathbf{elif}\;y.re \le 2.7202606860941377 \cdot 10^{154}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right) \cdot 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot 1}\\
\end{array}double f(double x_re, double x_im, double y_re, double y_im) {
double r54920 = x_re;
double r54921 = y_re;
double r54922 = r54920 * r54921;
double r54923 = x_im;
double r54924 = y_im;
double r54925 = r54923 * r54924;
double r54926 = r54922 + r54925;
double r54927 = r54921 * r54921;
double r54928 = r54924 * r54924;
double r54929 = r54927 + r54928;
double r54930 = r54926 / r54929;
return r54930;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r54931 = y_re;
double r54932 = -1.2881291875463798e+147;
bool r54933 = r54931 <= r54932;
double r54934 = -1.0;
double r54935 = x_re;
double r54936 = r54934 * r54935;
double r54937 = y_im;
double r54938 = hypot(r54931, r54937);
double r54939 = 1.0;
double r54940 = r54938 * r54939;
double r54941 = r54936 / r54940;
double r54942 = 2.7202606860941377e+154;
bool r54943 = r54931 <= r54942;
double r54944 = x_im;
double r54945 = r54944 * r54937;
double r54946 = fma(r54935, r54931, r54945);
double r54947 = r54946 / r54938;
double r54948 = r54947 / r54940;
double r54949 = r54935 / r54940;
double r54950 = r54943 ? r54948 : r54949;
double r54951 = r54933 ? r54941 : r54950;
return r54951;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -1.2881291875463798e+147Initial program 44.4
rmApplied add-sqr-sqrt44.4
Applied *-un-lft-identity44.4
Applied times-frac44.4
Simplified44.4
Simplified29.1
rmApplied associate-*r/29.1
Simplified29.1
Taylor expanded around -inf 14.0
if -1.2881291875463798e+147 < y.re < 2.7202606860941377e+154Initial program 19.4
rmApplied add-sqr-sqrt19.4
Applied *-un-lft-identity19.4
Applied times-frac19.4
Simplified19.4
Simplified12.4
rmApplied associate-*r/12.4
Simplified12.3
if 2.7202606860941377e+154 < y.re Initial program 45.5
rmApplied add-sqr-sqrt45.5
Applied *-un-lft-identity45.5
Applied times-frac45.5
Simplified45.5
Simplified29.9
rmApplied associate-*r/29.9
Simplified29.8
Taylor expanded around inf 14.8
Final simplification12.9
herbie shell --seed 2020020 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, real part"
:precision binary64
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))