\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 -2.6364804888683188 \cdot 10^{+131}:\\
\;\;\;\;\frac{-t_0}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := \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{if}\;y.im \leq -4.650358285454888 \cdot 10^{-29}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq -3.6480508373439315 \cdot 10^{-304}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y.im}{y.re}, \frac{x.im}{y.re}, \frac{x.re}{y.re}\right)\\
\mathbf{elif}\;y.im \leq 2.050130680515523 \cdot 10^{+77}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\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
(let* ((t_0 (fma (/ x.re y.im) y.re x.im)))
(if (<= y.im -2.6364804888683188e+131)
(/ (- t_0) (hypot y.im y.re))
(let* ((t_1
(/
(/ (fma x.re y.re (* y.im x.im)) (hypot y.im y.re))
(hypot y.im y.re))))
(if (<= y.im -4.650358285454888e-29)
t_1
(if (<= y.im -3.6480508373439315e-304)
(fma (/ y.im y.re) (/ x.im y.re) (/ x.re y.re))
(if (<= y.im 2.050130680515523e+77)
t_1
(/ 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 <= -2.6364804888683188e+131) {
tmp = -t_0 / hypot(y_46_im, y_46_re);
} else {
double t_1 = (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);
double tmp_1;
if (y_46_im <= -4.650358285454888e-29) {
tmp_1 = t_1;
} else if (y_46_im <= -3.6480508373439315e-304) {
tmp_1 = fma((y_46_im / y_46_re), (x_46_im / y_46_re), (x_46_re / y_46_re));
} else if (y_46_im <= 2.050130680515523e+77) {
tmp_1 = t_1;
} else {
tmp_1 = t_0 / hypot(y_46_im, y_46_re);
}
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 < -2.6364804888683188e131Initial program 41.7
Applied add-sqr-sqrt_binary6441.7
Applied *-un-lft-identity_binary6441.7
Applied times-frac_binary6441.7
Simplified41.7
Simplified26.4
Applied associate-*l/_binary6426.3
Simplified26.3
Taylor expanded in y.im around -inf 11.5
Simplified7.0
if -2.6364804888683188e131 < y.im < -4.650358285454888e-29 or -3.6480508373439315e-304 < y.im < 2.0501306805155229e77Initial program 16.6
Applied add-sqr-sqrt_binary6416.6
Applied *-un-lft-identity_binary6416.6
Applied times-frac_binary6416.6
Simplified16.6
Simplified10.5
Applied associate-*l/_binary6410.4
Simplified10.4
if -4.650358285454888e-29 < y.im < -3.6480508373439315e-304Initial program 18.4
Taylor expanded in y.re around inf 14.6
Simplified12.7
if 2.0501306805155229e77 < y.im Initial program 39.4
Applied add-sqr-sqrt_binary6439.4
Applied *-un-lft-identity_binary6439.4
Applied times-frac_binary6439.5
Simplified39.5
Simplified26.4
Applied associate-*l/_binary6426.3
Simplified26.3
Taylor expanded in y.re around 0 13.2
Simplified9.6
Final simplification10.2
herbie shell --seed 2022088
(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))))