\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\frac{\left(x.re \cdot y.re + x.im \cdot y.im\right) \cdot \frac{1}{\sqrt{{y.re}^{2} + {y.im}^{2}}}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (* (+ (* x.re y.re) (* x.im y.im)) (/ 1.0 (sqrt (+ (pow y.re 2.0) (pow y.im 2.0))))) (sqrt (+ (* 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 ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (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 (((x_46_re * y_46_re) + (x_46_im * y_46_im)) * (1.0 / sqrt(pow(y_46_re, 2.0) + pow(y_46_im, 2.0)))) / sqrt((y_46_re * y_46_re) + (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 26.3
rmApplied add-sqr-sqrt_binary6426.3
Applied associate-/r*_binary6426.2
rmApplied div-inv_binary6426.2
Simplified26.2
Final simplification26.2
herbie shell --seed 2020232
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, real part"
:precision binary64
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))