\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\frac{\frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot x.im - x.re \cdot \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}double f(double x_re, double x_im, double y_re, double y_im) {
double r45715 = x_im;
double r45716 = y_re;
double r45717 = r45715 * r45716;
double r45718 = x_re;
double r45719 = y_im;
double r45720 = r45718 * r45719;
double r45721 = r45717 - r45720;
double r45722 = r45716 * r45716;
double r45723 = r45719 * r45719;
double r45724 = r45722 + r45723;
double r45725 = r45721 / r45724;
return r45725;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r45726 = y_re;
double r45727 = y_im;
double r45728 = hypot(r45726, r45727);
double r45729 = r45726 / r45728;
double r45730 = x_im;
double r45731 = r45729 * r45730;
double r45732 = x_re;
double r45733 = r45727 / r45728;
double r45734 = r45732 * r45733;
double r45735 = r45731 - r45734;
double r45736 = r45735 / r45728;
return r45736;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
Initial program 26.0
Simplified26.0
rmApplied add-sqr-sqrt26.0
Applied *-un-lft-identity26.0
Applied times-frac26.0
Simplified26.0
Simplified16.8
rmApplied *-un-lft-identity16.8
Applied associate-*l*16.8
Simplified16.6
rmApplied div-sub16.6
Simplified9.0
Simplified0.8
rmApplied div-inv0.9
Applied associate-*l*0.5
Simplified0.4
Final simplification0.4
herbie shell --seed 2019306 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, imaginary part"
:precision binary64
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))