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) {
double tmp;
if ((y_46_im <= -3.6058658773741186e+115) || !(y_46_im <= 2.2524233065491668e+111)) {
tmp = x_46_im / y_46_im;
} else {
tmp = (((x_46_re * y_46_re) + (y_46_im * x_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));
}
return tmp;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.im < -3.60586587737411862e115 or 2.25242330654916681e111 < y.im Initial program 41.1
rmApplied add-sqr-sqrt41.1
Applied associate-/r*41.1
Simplified41.1
Taylor expanded around 0 42.6
Taylor expanded around 0 16.4
if -3.60586587737411862e115 < y.im < 2.25242330654916681e111Initial program 19.0
rmApplied add-sqr-sqrt19.1
Applied associate-/r*19.0
Simplified19.0
rmApplied div-inv19.0
Final simplification18.2
herbie shell --seed 2020338
(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))))