\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\begin{array}{l}
\mathbf{if}\;y.im \leq -2.0316919383101615 \cdot 10^{+102}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x.re}{y.im}, y.re, x.im\right) \cdot \frac{-1}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{elif}\;y.im \leq 9.773934898556053 \cdot 10^{+148}:\\
\;\;\;\;\mathsf{fma}\left(x.im, \frac{y.im}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}, \frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.im, y.re\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x.re}{y.im}, \frac{y.re}{y.im}, \frac{x.im}{y.im}\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
(if (<= y.im -2.0316919383101615e+102)
(* (fma (/ x.re y.im) y.re x.im) (/ -1.0 (hypot y.im y.re)))
(if (<= y.im 9.773934898556053e+148)
(fma
x.im
(/ y.im (fma y.im y.im (* y.re y.re)))
(* (/ y.re (hypot y.im y.re)) (/ x.re (hypot y.im y.re))))
(fma (/ x.re y.im) (/ y.re y.im) (/ x.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) {
double tmp;
if (y_46_im <= -2.0316919383101615e+102) {
tmp = fma((x_46_re / y_46_im), y_46_re, x_46_im) * (-1.0 / hypot(y_46_im, y_46_re));
} else if (y_46_im <= 9.773934898556053e+148) {
tmp = fma(x_46_im, (y_46_im / fma(y_46_im, y_46_im, (y_46_re * y_46_re))), ((y_46_re / hypot(y_46_im, y_46_re)) * (x_46_re / hypot(y_46_im, y_46_re))));
} else {
tmp = fma((x_46_re / y_46_im), (y_46_re / y_46_im), (x_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
if y.im < -2.0316919383101615e102Initial program 39.5
Simplified39.5
Applied add-sqr-sqrt_binary6439.5
Applied *-un-lft-identity_binary6439.5
Applied times-frac_binary6439.4
Simplified39.4
Simplified26.4
Taylor expanded in y.im around -inf 13.2
Simplified8.7
if -2.0316919383101615e102 < y.im < 9.77393489855605291e148Initial program 18.7
Simplified18.7
Taylor expanded in x.re around 0 18.7
Simplified17.6
Applied add-sqr-sqrt_binary6417.6
Applied times-frac_binary6415.4
Simplified15.4
Simplified5.5
if 9.77393489855605291e148 < y.im Initial program 45.0
Simplified45.0
Applied add-sqr-sqrt_binary6445.0
Applied *-un-lft-identity_binary6445.0
Applied times-frac_binary6445.0
Simplified45.0
Simplified29.0
Taylor expanded in y.im around inf 14.7
Simplified7.3
Final simplification6.3
herbie shell --seed 2021275
(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))))