\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\frac{\frac{1}{\frac{\mathsf{hypot}\left(y.im, y.re\right)}{\mathsf{fma}\left(x.re, y.re, \left(x.im \cdot y.im\right)\right)}}}{\mathsf{hypot}\left(y.im, y.re\right)}double f(double x_re, double x_im, double y_re, double y_im) {
double r2732206 = x_re;
double r2732207 = y_re;
double r2732208 = r2732206 * r2732207;
double r2732209 = x_im;
double r2732210 = y_im;
double r2732211 = r2732209 * r2732210;
double r2732212 = r2732208 + r2732211;
double r2732213 = r2732207 * r2732207;
double r2732214 = r2732210 * r2732210;
double r2732215 = r2732213 + r2732214;
double r2732216 = r2732212 / r2732215;
return r2732216;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r2732217 = 1.0;
double r2732218 = y_im;
double r2732219 = y_re;
double r2732220 = hypot(r2732218, r2732219);
double r2732221 = x_re;
double r2732222 = x_im;
double r2732223 = r2732222 * r2732218;
double r2732224 = fma(r2732221, r2732219, r2732223);
double r2732225 = r2732220 / r2732224;
double r2732226 = r2732217 / r2732225;
double r2732227 = r2732226 / r2732220;
return r2732227;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Initial program 25.7
Simplified25.7
rmApplied add-sqr-sqrt25.7
Applied associate-/r*25.7
rmApplied *-un-lft-identity25.7
Applied associate-/l*25.7
rmApplied fma-udef25.7
Applied hypot-def25.7
rmApplied fma-udef25.7
Applied hypot-def16.8
Final simplification16.8
herbie shell --seed 2019130 +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))))