\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 -2.251241914834782347967678627443361391441 \cdot 10^{52}:\\
\;\;\;\;\frac{-x.re}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{elif}\;y.re \le 1.801608638015658355582080604789631060504 \cdot 10^{148}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x.re, y.re, y.im \cdot x.im\right)}{\mathsf{hypot}\left(y.im, y.re\right)}}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{\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 r2977095 = x_re;
double r2977096 = y_re;
double r2977097 = r2977095 * r2977096;
double r2977098 = x_im;
double r2977099 = y_im;
double r2977100 = r2977098 * r2977099;
double r2977101 = r2977097 + r2977100;
double r2977102 = r2977096 * r2977096;
double r2977103 = r2977099 * r2977099;
double r2977104 = r2977102 + r2977103;
double r2977105 = r2977101 / r2977104;
return r2977105;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r2977106 = y_re;
double r2977107 = -2.2512419148347823e+52;
bool r2977108 = r2977106 <= r2977107;
double r2977109 = x_re;
double r2977110 = -r2977109;
double r2977111 = y_im;
double r2977112 = hypot(r2977111, r2977106);
double r2977113 = r2977110 / r2977112;
double r2977114 = 1.8016086380156584e+148;
bool r2977115 = r2977106 <= r2977114;
double r2977116 = x_im;
double r2977117 = r2977111 * r2977116;
double r2977118 = fma(r2977109, r2977106, r2977117);
double r2977119 = r2977118 / r2977112;
double r2977120 = r2977119 / r2977112;
double r2977121 = r2977109 / r2977112;
double r2977122 = r2977115 ? r2977120 : r2977121;
double r2977123 = r2977108 ? r2977113 : r2977122;
return r2977123;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -2.2512419148347823e+52Initial program 37.6
Simplified37.6
rmApplied add-sqr-sqrt37.6
Applied associate-/r*37.5
rmApplied fma-udef37.5
Applied hypot-def37.5
rmApplied fma-udef37.5
Applied hypot-def25.5
Taylor expanded around -inf 18.2
Simplified18.2
if -2.2512419148347823e+52 < y.re < 1.8016086380156584e+148Initial program 19.0
Simplified19.0
rmApplied add-sqr-sqrt19.0
Applied associate-/r*18.9
rmApplied fma-udef18.9
Applied hypot-def18.9
rmApplied fma-udef18.9
Applied hypot-def12.1
if 1.8016086380156584e+148 < y.re Initial program 45.0
Simplified45.0
rmApplied add-sqr-sqrt45.0
Applied associate-/r*45.0
rmApplied fma-udef45.0
Applied hypot-def45.0
rmApplied fma-udef45.0
Applied hypot-def28.7
Taylor expanded around inf 13.1
Final simplification13.6
herbie shell --seed 2019170 +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))))