\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\frac{y.re}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{x.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} - y.im \cdot \frac{x.re}{y.re \cdot y.re + y.im \cdot y.im}(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
(FPCore (x.re x.im y.re y.im) :precision binary64 (- (* (/ y.re (sqrt (+ (* y.re y.re) (* y.im y.im)))) (/ x.im (sqrt (+ (* y.re y.re) (* y.im y.im))))) (* y.im (/ x.re (+ (* y.re y.re) (* y.im y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (((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) ((y_46_re / ((double) sqrt(((double) (((double) (y_46_re * y_46_re)) + ((double) (y_46_im * y_46_im))))))) * (x_46_im / ((double) sqrt(((double) (((double) (y_46_re * y_46_re)) + ((double) (y_46_im * y_46_im))))))))) - ((double) (y_46_im * (x_46_re / ((double) (((double) (y_46_re * y_46_re)) + ((double) (y_46_im * y_46_im)))))))));
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
Initial program Error: 26.5 bits
rmApplied div-subError: 26.5 bits
SimplifiedError: 27.0 bits
SimplifiedError: 27.6 bits
rmApplied add-sqr-sqrtError: 27.6 bits
Applied *-un-lft-identityError: 27.6 bits
Applied times-fracError: 27.6 bits
Applied associate-*r*Error: 26.1 bits
SimplifiedError: 26.0 bits
Final simplificationError: 26.0 bits
herbie shell --seed 2020204
(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))))