\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.im \le 9.842459121637509 \cdot 10^{+163}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\mathsf{hypot}\left(y.im, y.re\right)}}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{\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 r3236543 = x_re;
double r3236544 = y_re;
double r3236545 = r3236543 * r3236544;
double r3236546 = x_im;
double r3236547 = y_im;
double r3236548 = r3236546 * r3236547;
double r3236549 = r3236545 + r3236548;
double r3236550 = r3236544 * r3236544;
double r3236551 = r3236547 * r3236547;
double r3236552 = r3236550 + r3236551;
double r3236553 = r3236549 / r3236552;
return r3236553;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r3236554 = y_im;
double r3236555 = 9.842459121637509e+163;
bool r3236556 = r3236554 <= r3236555;
double r3236557 = x_re;
double r3236558 = y_re;
double r3236559 = x_im;
double r3236560 = r3236559 * r3236554;
double r3236561 = fma(r3236557, r3236558, r3236560);
double r3236562 = hypot(r3236554, r3236558);
double r3236563 = r3236561 / r3236562;
double r3236564 = r3236563 / r3236562;
double r3236565 = r3236559 / r3236562;
double r3236566 = r3236556 ? r3236564 : r3236565;
return r3236566;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.im < 9.842459121637509e+163Initial program 23.5
Simplified23.5
rmApplied add-sqr-sqrt23.5
Applied associate-/r*23.4
rmApplied fma-udef23.4
Applied hypot-def23.4
rmApplied fma-udef23.4
Applied hypot-def14.9
if 9.842459121637509e+163 < y.im Initial program 44.9
Simplified44.9
rmApplied add-sqr-sqrt44.9
Applied associate-/r*44.9
rmApplied fma-udef44.9
Applied hypot-def44.9
Taylor expanded around 0 13.0
Final simplification14.7
herbie shell --seed 2019168 +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))))