\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 -6.889595916751356 \cdot 10^{+153}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x.re}{{y.im}^{2}}, y.re, \frac{x.im}{y.im}\right)\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_0 := \mathsf{fma}\left(y.im, y.im, {y.re}^{2}\right)\\
t_1 := \frac{y.im}{t_0}\\
\mathbf{if}\;y.im \leq -1.138134009878751 \cdot 10^{-83}:\\
\;\;\;\;\begin{array}{l}
t_2 := \sqrt[3]{t_0}\\
\mathsf{fma}\left(t_1, x.im, \frac{y.re}{t_2 \cdot t_2} \cdot \frac{x.re}{t_2}\right)
\end{array}\\
\mathbf{elif}\;y.im \leq 4.7526766511788395 \cdot 10^{+30}:\\
\;\;\;\;\mathsf{fma}\left(t_1, x.im, \frac{x.re}{y.re}\right)\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_3 := \frac{\sqrt{y.im}}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathsf{fma}\left(t_3 \cdot t_3, x.im, \frac{x.re \cdot y.re}{t_0}\right)
\end{array}\\
\end{array}\\
\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 -6.889595916751356e+153)
(fma (/ x.re (pow y.im 2.0)) y.re (/ x.im y.im))
(let* ((t_0 (fma y.im y.im (pow y.re 2.0))) (t_1 (/ y.im t_0)))
(if (<= y.im -1.138134009878751e-83)
(let* ((t_2 (cbrt t_0)))
(fma t_1 x.im (* (/ y.re (* t_2 t_2)) (/ x.re t_2))))
(if (<= y.im 4.7526766511788395e+30)
(fma t_1 x.im (/ x.re y.re))
(let* ((t_3 (/ (sqrt y.im) (hypot y.im y.re))))
(fma (* t_3 t_3) x.im (/ (* x.re y.re) t_0))))))))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 <= -6.889595916751356e+153) {
tmp = fma((x_46_re / pow(y_46_im, 2.0)), y_46_re, (x_46_im / y_46_im));
} else {
double t_0 = fma(y_46_im, y_46_im, pow(y_46_re, 2.0));
double t_1 = y_46_im / t_0;
double tmp_1;
if (y_46_im <= -1.138134009878751e-83) {
double t_2_2 = cbrt(t_0);
tmp_1 = fma(t_1, x_46_im, ((y_46_re / (t_2_2 * t_2_2)) * (x_46_re / t_2_2)));
} else if (y_46_im <= 4.7526766511788395e+30) {
tmp_1 = fma(t_1, x_46_im, (x_46_re / y_46_re));
} else {
double t_3 = sqrt(y_46_im) / hypot(y_46_im, y_46_re);
tmp_1 = fma((t_3 * t_3), x_46_im, ((x_46_re * y_46_re) / t_0));
}
tmp = tmp_1;
}
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 < -6.88959591675135632e153Initial program 45.4
Simplified45.4
Taylor expanded in y.re around 0 15.4
Simplified13.5
if -6.88959591675135632e153 < y.im < -1.1381340098787509e-83Initial program 18.6
Simplified18.6
Taylor expanded in x.re around 0 18.6
Simplified14.2
Applied add-cube-cbrt_binary6414.4
Applied times-frac_binary6412.7
if -1.1381340098787509e-83 < y.im < 4.7526766511788395e30Initial program 19.4
Simplified19.4
Taylor expanded in x.re around 0 19.4
Simplified19.8
Taylor expanded in y.re around inf 14.1
if 4.7526766511788395e30 < y.im Initial program 33.3
Simplified33.3
Taylor expanded in x.re around 0 33.3
Simplified30.0
Applied div-inv_binary6430.0
Applied add-sqr-sqrt_binary6430.1
Simplified30.1
Simplified13.1
Final simplification13.5
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))))