\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 -1.4352057347664762 \cdot 10^{+138}:\\
\;\;\;\;t_0 \cdot \frac{-1}{\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 -3.2946202192791303 \cdot 10^{-195}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 1.1327597853587381 \cdot 10^{-247}:\\
\;\;\;\;\frac{y.im \cdot x.im}{{y.re}^{2}} + \frac{x.re}{y.re}\\
\mathbf{elif}\;y.im \leq 4.032187018528407 \cdot 10^{+74}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot t_0\\
\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 -1.4352057347664762e+138)
(* t_0 (/ -1.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 -3.2946202192791303e-195)
t_1
(if (<= y.im 1.1327597853587381e-247)
(+ (/ (* y.im x.im) (pow y.re 2.0)) (/ x.re y.re))
(if (<= y.im 4.032187018528407e+74)
t_1
(* (/ 1.0 (hypot y.im 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 t_0 = fma((x_46_re / y_46_im), y_46_re, x_46_im);
double tmp;
if (y_46_im <= -1.4352057347664762e+138) {
tmp = t_0 * (-1.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 <= -3.2946202192791303e-195) {
tmp_1 = t_1;
} else if (y_46_im <= 1.1327597853587381e-247) {
tmp_1 = ((y_46_im * x_46_im) / pow(y_46_re, 2.0)) + (x_46_re / y_46_re);
} else if (y_46_im <= 4.032187018528407e+74) {
tmp_1 = t_1;
} else {
tmp_1 = (1.0 / hypot(y_46_im, 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 < -1.43520573476647616e138Initial program 42.8
Applied add-sqr-sqrt_binary6442.8
Applied *-un-lft-identity_binary6442.8
Applied times-frac_binary6442.8
Simplified42.8
Simplified28.1
Taylor expanded in y.im around -inf 11.8
Simplified7.9
if -1.43520573476647616e138 < y.im < -3.2946202192791303e-195 or 1.13275978535873808e-247 < y.im < 4.0321870185284071e74Initial program 17.9
Applied add-sqr-sqrt_binary6417.9
Applied *-un-lft-identity_binary6417.9
Applied times-frac_binary6417.9
Simplified17.9
Simplified11.9
Applied associate-*l/_binary6411.7
Simplified11.7
if -3.2946202192791303e-195 < y.im < 1.13275978535873808e-247Initial program 25.0
Taylor expanded in y.re around inf 9.4
if 4.0321870185284071e74 < y.im Initial program 37.6
Applied add-sqr-sqrt_binary6437.6
Applied *-un-lft-identity_binary6437.6
Applied times-frac_binary6437.6
Simplified37.6
Simplified24.6
Taylor expanded in y.im around inf 14.6
Simplified11.4
Final simplification10.8
herbie shell --seed 2021340
(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))))