\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 -2.2063458127550573 \cdot 10^{+100}:\\
\;\;\;\;\frac{-x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \le 4.054287420560557 \cdot 10^{+138}:\\
\;\;\;\;\frac{\frac{1}{\frac{1}{\mathsf{fma}\left(x.re, y.re, \left(y.im \cdot x.im\right)\right)} \cdot \mathsf{hypot}\left(y.re, 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 r688433 = x_re;
double r688434 = y_re;
double r688435 = r688433 * r688434;
double r688436 = x_im;
double r688437 = y_im;
double r688438 = r688436 * r688437;
double r688439 = r688435 + r688438;
double r688440 = r688434 * r688434;
double r688441 = r688437 * r688437;
double r688442 = r688440 + r688441;
double r688443 = r688439 / r688442;
return r688443;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r688444 = y_re;
double r688445 = -2.2063458127550573e+100;
bool r688446 = r688444 <= r688445;
double r688447 = x_re;
double r688448 = -r688447;
double r688449 = y_im;
double r688450 = hypot(r688444, r688449);
double r688451 = r688448 / r688450;
double r688452 = 4.054287420560557e+138;
bool r688453 = r688444 <= r688452;
double r688454 = 1.0;
double r688455 = x_im;
double r688456 = r688449 * r688455;
double r688457 = fma(r688447, r688444, r688456);
double r688458 = r688454 / r688457;
double r688459 = r688458 * r688450;
double r688460 = r688454 / r688459;
double r688461 = r688460 / r688450;
double r688462 = r688447 / r688450;
double r688463 = r688453 ? r688461 : r688462;
double r688464 = r688446 ? r688451 : r688463;
return r688464;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -2.2063458127550573e+100Initial program 38.4
rmApplied add-sqr-sqrt38.4
Applied associate-/r*38.4
rmApplied hypot-def38.4
rmApplied clear-num38.4
Simplified25.2
Taylor expanded around -inf 16.7
Simplified16.7
if -2.2063458127550573e+100 < y.re < 4.054287420560557e+138Initial program 18.6
rmApplied add-sqr-sqrt18.6
Applied associate-/r*18.5
rmApplied hypot-def18.5
rmApplied clear-num18.6
Simplified11.8
rmApplied div-inv12.0
if 4.054287420560557e+138 < y.re Initial program 45.0
rmApplied add-sqr-sqrt45.0
Applied associate-/r*45.0
rmApplied hypot-def45.0
rmApplied clear-num45.0
Simplified29.1
Taylor expanded around inf 14.5
Final simplification13.2
herbie shell --seed 2019128 +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))))