\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\begin{array}{l}
t_0 := \mathsf{fma}\left(\frac{x.re}{y.im}, y.re, x.im\right)\\
\mathbf{if}\;y.im \leq -7.183038243223042 \cdot 10^{+168}:\\
\;\;\;\;\frac{-t_0}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{elif}\;y.im \leq 5.106771931752182 \cdot 10^{+135}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x.re, y.re, y.im \cdot x.im\right)}{\mathsf{hypot}\left(y.im, y.re\right)}}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\end{array}
(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
(let* ((t_0 (fma (/ x.re y.im) y.re x.im)))
(if (<= y.im -7.183038243223042e+168)
(/ (- t_0) (hypot y.im y.re))
(if (<= y.im 5.106771931752182e+135)
(/
(/ (fma x.re y.re (* y.im x.im)) (hypot y.im y.re))
(hypot y.im y.re))
(/ t_0 (hypot y.im y.re))))))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 t_0 = fma((x_46_re / y_46_im), y_46_re, x_46_im);
double tmp;
if (y_46_im <= -7.183038243223042e+168) {
tmp = -t_0 / hypot(y_46_im, y_46_re);
} else if (y_46_im <= 5.106771931752182e+135) {
tmp = (fma(x_46_re, y_46_re, (y_46_im * x_46_im)) / hypot(y_46_im, y_46_re)) / hypot(y_46_im, y_46_re);
} else {
tmp = t_0 / hypot(y_46_im, y_46_re);
}
return tmp;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.im < -7.18303824322304229e168Initial program 44.8
Simplified44.8
Applied add-sqr-sqrt_binary6444.8
Applied *-un-lft-identity_binary6444.8
Applied times-frac_binary6444.8
Simplified44.8
Simplified29.5
Applied associate-*r/_binary6429.5
Taylor expanded in y.im around -inf 11.2
Simplified6.1
if -7.18303824322304229e168 < y.im < 5.1067719317521821e135Initial program 19.7
Simplified19.7
Applied add-sqr-sqrt_binary6419.7
Applied *-un-lft-identity_binary6419.7
Applied times-frac_binary6419.7
Simplified19.7
Simplified12.5
Applied associate-*l/_binary6412.4
Simplified12.4
if 5.1067719317521821e135 < y.im Initial program 42.1
Simplified42.1
Applied add-sqr-sqrt_binary6442.1
Applied *-un-lft-identity_binary6442.1
Applied times-frac_binary6442.1
Simplified42.1
Simplified28.9
Applied associate-*r/_binary6428.9
Taylor expanded in y.im around inf 12.0
Simplified7.6
Final simplification10.9
herbie shell --seed 2021215
(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))))