\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 -8.43190569036196823 \cdot 10^{188}:\\
\;\;\;\;\frac{-x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \le 1.91887418161015928 \cdot 10^{167}:\\
\;\;\;\;\frac{\frac{1}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{\mathsf{fma}\left(y.re, x.re, x.im \cdot y.im\right)}}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{\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 r103088 = x_re;
double r103089 = y_re;
double r103090 = r103088 * r103089;
double r103091 = x_im;
double r103092 = y_im;
double r103093 = r103091 * r103092;
double r103094 = r103090 + r103093;
double r103095 = r103089 * r103089;
double r103096 = r103092 * r103092;
double r103097 = r103095 + r103096;
double r103098 = r103094 / r103097;
return r103098;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r103099 = y_re;
double r103100 = -8.431905690361968e+188;
bool r103101 = r103099 <= r103100;
double r103102 = x_re;
double r103103 = -r103102;
double r103104 = y_im;
double r103105 = hypot(r103099, r103104);
double r103106 = r103103 / r103105;
double r103107 = 1.9188741816101593e+167;
bool r103108 = r103099 <= r103107;
double r103109 = 1.0;
double r103110 = x_im;
double r103111 = r103110 * r103104;
double r103112 = fma(r103099, r103102, r103111);
double r103113 = r103105 / r103112;
double r103114 = r103109 / r103113;
double r103115 = r103114 / r103105;
double r103116 = r103102 / r103105;
double r103117 = r103108 ? r103115 : r103116;
double r103118 = r103101 ? r103106 : r103117;
return r103118;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -8.431905690361968e+188Initial program 42.8
rmApplied add-sqr-sqrt42.8
Applied *-un-lft-identity42.8
Applied times-frac42.8
Simplified42.8
Simplified29.9
rmApplied associate-*r/29.9
Simplified29.9
Taylor expanded around -inf 11.5
Simplified11.5
if -8.431905690361968e+188 < y.re < 1.9188741816101593e+167Initial program 20.8
rmApplied add-sqr-sqrt20.8
Applied *-un-lft-identity20.8
Applied times-frac20.8
Simplified20.8
Simplified12.9
rmApplied associate-*r/12.9
Simplified12.8
rmApplied clear-num12.9
if 1.9188741816101593e+167 < y.re Initial program 44.3
rmApplied add-sqr-sqrt44.3
Applied *-un-lft-identity44.3
Applied times-frac44.3
Simplified44.3
Simplified29.6
rmApplied associate-*r/29.6
Simplified29.6
Taylor expanded around inf 13.9
Final simplification12.9
herbie shell --seed 2019198 +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))))