\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 r64084 = x_im;
double r64085 = y_re;
double r64086 = r64084 * r64085;
double r64087 = x_re;
double r64088 = y_im;
double r64089 = r64087 * r64088;
double r64090 = r64086 - r64089;
double r64091 = r64085 * r64085;
double r64092 = r64088 * r64088;
double r64093 = r64091 + r64092;
double r64094 = r64090 / r64093;
return r64094;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r64095 = y_re;
double r64096 = y_im;
double r64097 = hypot(r64095, r64096);
double r64098 = r64095 / r64097;
double r64099 = x_im;
double r64100 = r64098 * r64099;
double r64101 = x_re;
double r64102 = r64096 / r64097;
double r64103 = r64101 * r64102;
double r64104 = r64100 - r64103;
double r64105 = r64104 / r64097;
return r64105;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
Initial program 25.9
Simplified25.9
rmApplied add-sqr-sqrt25.9
Applied *-un-lft-identity25.9
Applied times-frac25.9
Simplified25.9
Simplified16.8
rmApplied associate-*r/16.8
Simplified16.7
rmApplied div-sub16.7
Simplified9.0
Simplified0.9
rmApplied div-inv1.0
Applied associate-*l*0.5
Simplified0.4
Final simplification0.4
herbie shell --seed 2019323 +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))))