\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 -3.9328947580125936 \cdot 10^{148}:\\
\;\;\;\;\frac{-1 \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot 1}\\
\mathbf{elif}\;y.re \le 1.1661264907998782 \cdot 10^{265}:\\
\;\;\;\;\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 r117227 = x_re;
double r117228 = y_re;
double r117229 = r117227 * r117228;
double r117230 = x_im;
double r117231 = y_im;
double r117232 = r117230 * r117231;
double r117233 = r117229 + r117232;
double r117234 = r117228 * r117228;
double r117235 = r117231 * r117231;
double r117236 = r117234 + r117235;
double r117237 = r117233 / r117236;
return r117237;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r117238 = y_re;
double r117239 = -3.9328947580125936e+148;
bool r117240 = r117238 <= r117239;
double r117241 = -1.0;
double r117242 = x_re;
double r117243 = r117241 * r117242;
double r117244 = y_im;
double r117245 = hypot(r117238, r117244);
double r117246 = 1.0;
double r117247 = r117245 * r117246;
double r117248 = r117243 / r117247;
double r117249 = 1.1661264907998782e+265;
bool r117250 = r117238 <= r117249;
double r117251 = x_im;
double r117252 = r117251 * r117244;
double r117253 = fma(r117242, r117238, r117252);
double r117254 = r117253 / r117245;
double r117255 = r117254 / r117247;
double r117256 = r117242 / r117247;
double r117257 = r117250 ? r117255 : r117256;
double r117258 = r117240 ? r117248 : r117257;
return r117258;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -3.9328947580125936e+148Initial program 43.4
rmApplied add-sqr-sqrt43.4
Applied *-un-lft-identity43.4
Applied times-frac43.4
Simplified43.4
Simplified28.0
rmApplied associate-*r/27.9
Simplified27.9
Taylor expanded around -inf 13.2
if -3.9328947580125936e+148 < y.re < 1.1661264907998782e+265Initial program 23.2
rmApplied add-sqr-sqrt23.2
Applied *-un-lft-identity23.2
Applied times-frac23.2
Simplified23.2
Simplified15.0
rmApplied associate-*r/14.9
Simplified14.8
if 1.1661264907998782e+265 < y.re Initial program 38.9
rmApplied add-sqr-sqrt38.9
Applied *-un-lft-identity38.9
Applied times-frac38.9
Simplified38.9
Simplified32.6
rmApplied associate-*r/32.6
Simplified32.6
Taylor expanded around inf 8.2
Final simplification14.3
herbie shell --seed 2020034 +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))))