\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.115404358127398 \cdot 10^{+126}:\\
\;\;\;\;\frac{-x.re}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{elif}\;y.re \le 1.0136212948540185 \cdot 10^{+209}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.re, y.re, y.im \cdot x.im\right)}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{1}{\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 r3156017 = x_re;
double r3156018 = y_re;
double r3156019 = r3156017 * r3156018;
double r3156020 = x_im;
double r3156021 = y_im;
double r3156022 = r3156020 * r3156021;
double r3156023 = r3156019 + r3156022;
double r3156024 = r3156018 * r3156018;
double r3156025 = r3156021 * r3156021;
double r3156026 = r3156024 + r3156025;
double r3156027 = r3156023 / r3156026;
return r3156027;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r3156028 = y_re;
double r3156029 = -8.115404358127398e+126;
bool r3156030 = r3156028 <= r3156029;
double r3156031 = x_re;
double r3156032 = -r3156031;
double r3156033 = y_im;
double r3156034 = hypot(r3156033, r3156028);
double r3156035 = r3156032 / r3156034;
double r3156036 = 1.0136212948540185e+209;
bool r3156037 = r3156028 <= r3156036;
double r3156038 = x_im;
double r3156039 = r3156033 * r3156038;
double r3156040 = fma(r3156031, r3156028, r3156039);
double r3156041 = r3156040 / r3156034;
double r3156042 = 1.0;
double r3156043 = r3156042 / r3156034;
double r3156044 = r3156041 * r3156043;
double r3156045 = r3156031 / r3156034;
double r3156046 = r3156037 ? r3156044 : r3156045;
double r3156047 = r3156030 ? r3156035 : r3156046;
return r3156047;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -8.115404358127398e+126Initial program 41.2
Simplified41.2
rmApplied add-sqr-sqrt41.2
Applied *-un-lft-identity41.2
Applied times-frac41.2
rmApplied fma-udef41.2
Applied hypot-def41.2
rmApplied associate-*l/41.2
Simplified27.5
Taylor expanded around -inf 16.1
Simplified16.1
if -8.115404358127398e+126 < y.re < 1.0136212948540185e+209Initial program 20.9
Simplified20.9
rmApplied add-sqr-sqrt20.9
Applied *-un-lft-identity20.9
Applied times-frac20.9
rmApplied fma-udef20.9
Applied hypot-def20.9
rmApplied associate-*l/20.8
Simplified12.5
rmApplied div-inv12.7
if 1.0136212948540185e+209 < y.re Initial program 43.0
Simplified43.0
rmApplied add-sqr-sqrt43.0
Applied *-un-lft-identity43.0
Applied times-frac43.0
rmApplied fma-udef43.0
Applied hypot-def43.0
rmApplied associate-*l/43.0
Simplified32.0
Taylor expanded around inf 11.8
Final simplification13.1
herbie shell --seed 2019142 +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))))