\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 -1.1443562208296078 \cdot 10^{+200}:\\
\;\;\;\;\frac{-x.re}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{elif}\;y.re \le 1.3614475866611724 \cdot 10^{+128}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.re, y.re, \left(y.im \cdot x.im\right)\right) \cdot \frac{1}{\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 r2929524 = x_re;
double r2929525 = y_re;
double r2929526 = r2929524 * r2929525;
double r2929527 = x_im;
double r2929528 = y_im;
double r2929529 = r2929527 * r2929528;
double r2929530 = r2929526 + r2929529;
double r2929531 = r2929525 * r2929525;
double r2929532 = r2929528 * r2929528;
double r2929533 = r2929531 + r2929532;
double r2929534 = r2929530 / r2929533;
return r2929534;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r2929535 = y_re;
double r2929536 = -1.1443562208296078e+200;
bool r2929537 = r2929535 <= r2929536;
double r2929538 = x_re;
double r2929539 = -r2929538;
double r2929540 = y_im;
double r2929541 = hypot(r2929540, r2929535);
double r2929542 = r2929539 / r2929541;
double r2929543 = 1.3614475866611724e+128;
bool r2929544 = r2929535 <= r2929543;
double r2929545 = x_im;
double r2929546 = r2929540 * r2929545;
double r2929547 = fma(r2929538, r2929535, r2929546);
double r2929548 = 1.0;
double r2929549 = r2929548 / r2929541;
double r2929550 = r2929547 * r2929549;
double r2929551 = r2929550 / r2929541;
double r2929552 = r2929538 / r2929541;
double r2929553 = r2929544 ? r2929551 : r2929552;
double r2929554 = r2929537 ? r2929542 : r2929553;
return r2929554;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -1.1443562208296078e+200Initial program 41.6
Simplified41.6
rmApplied add-sqr-sqrt41.6
Applied associate-/r*41.6
rmApplied fma-udef41.6
Applied hypot-def41.6
rmApplied fma-udef41.6
Applied hypot-def28.5
Taylor expanded around -inf 10.3
Simplified10.3
if -1.1443562208296078e+200 < y.re < 1.3614475866611724e+128Initial program 20.9
Simplified20.9
rmApplied add-sqr-sqrt20.9
Applied associate-/r*20.8
rmApplied fma-udef20.8
Applied hypot-def20.8
rmApplied fma-udef20.8
Applied hypot-def12.9
rmApplied div-inv13.0
if 1.3614475866611724e+128 < y.re Initial program 42.4
Simplified42.4
rmApplied add-sqr-sqrt42.4
Applied associate-/r*42.4
rmApplied fma-udef42.4
Applied hypot-def42.4
rmApplied fma-udef42.4
Applied hypot-def28.2
Taylor expanded around inf 14.6
Final simplification13.0
herbie shell --seed 2019133 +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))))