\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.264789729519792 \cdot 10^{125}:\\
\;\;\;\;\frac{-1 \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot 1}\\
\mathbf{elif}\;y.re \le 8.6098110389023642 \cdot 10^{142}:\\
\;\;\;\;\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 r292 = x_re;
double r293 = y_re;
double r294 = r292 * r293;
double r295 = x_im;
double r296 = y_im;
double r297 = r295 * r296;
double r298 = r294 + r297;
double r299 = r293 * r293;
double r300 = r296 * r296;
double r301 = r299 + r300;
double r302 = r298 / r301;
return r302;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r303 = y_re;
double r304 = -3.264789729519792e+125;
bool r305 = r303 <= r304;
double r306 = -1.0;
double r307 = x_re;
double r308 = r306 * r307;
double r309 = y_im;
double r310 = hypot(r303, r309);
double r311 = 1.0;
double r312 = r310 * r311;
double r313 = r308 / r312;
double r314 = 8.609811038902364e+142;
bool r315 = r303 <= r314;
double r316 = x_im;
double r317 = r316 * r309;
double r318 = fma(r307, r303, r317);
double r319 = r318 / r310;
double r320 = r319 / r312;
double r321 = r307 / r312;
double r322 = r315 ? r320 : r321;
double r323 = r305 ? r313 : r322;
return r323;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -3.264789729519792e+125Initial program 42.8
rmApplied add-sqr-sqrt42.8
Applied *-un-lft-identity42.8
Applied times-frac42.8
Simplified42.8
Simplified28.7
rmApplied associate-*r/28.7
Simplified28.6
Taylor expanded around -inf 15.1
if -3.264789729519792e+125 < y.re < 8.609811038902364e+142Initial program 18.8
rmApplied add-sqr-sqrt18.8
Applied *-un-lft-identity18.8
Applied times-frac18.8
Simplified18.8
Simplified11.8
rmApplied associate-*r/11.8
Simplified11.7
if 8.609811038902364e+142 < y.re Initial program 44.6
rmApplied add-sqr-sqrt44.6
Applied *-un-lft-identity44.6
Applied times-frac44.6
Simplified44.6
Simplified29.6
rmApplied associate-*r/29.6
Simplified29.6
Taylor expanded around inf 14.4
Final simplification12.7
herbie shell --seed 2020025 +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))))