\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\frac{1}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{1}} \cdot \left(\mathsf{fma}\left(\frac{x.im}{1}, \frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, -\frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{1}\right) + \mathsf{fma}\left(-\frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.re}{1}, \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{1}\right)\right)double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((double) (((double) (((double) (x_46_im * y_46_re)) - ((double) (x_46_re * y_46_im)))) / ((double) (((double) (y_46_re * y_46_re)) + ((double) (y_46_im * y_46_im))))));
}
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((double) (((double) (1.0 / ((double) (((double) hypot(y_46_re, y_46_im)) / 1.0)))) * ((double) (((double) fma(((double) (x_46_im / 1.0)), ((double) (y_46_re / ((double) hypot(y_46_re, y_46_im)))), ((double) -(((double) (((double) (y_46_im / ((double) hypot(y_46_re, y_46_im)))) * ((double) (x_46_re / 1.0)))))))) + ((double) fma(((double) -(((double) (y_46_im / ((double) hypot(y_46_re, y_46_im)))))), ((double) (x_46_re / 1.0)), ((double) (((double) (y_46_im / ((double) hypot(y_46_re, y_46_im)))) * ((double) (x_46_re / 1.0))))))))));
}



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
rmApplied add-sqr-sqrt26.0
Applied *-un-lft-identity26.0
Applied times-frac26.0
Simplified26.0
Simplified16.9
rmApplied div-sub16.9
Simplified9.2
Simplified0.8
rmApplied clear-num0.8
Applied associate-/r/0.7
Applied clear-num0.8
Applied associate-/r/0.7
Applied prod-diff0.7
Final simplification0.7
herbie shell --seed 2020114 +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))))