\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\begin{array}{l}
\mathbf{if}\;y.re \leq -8.236807978306482 \cdot 10^{+73}:\\
\;\;\;\;\frac{x.im}{y.re} - \frac{x.re \cdot y.im}{{y.re}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_0 := \frac{\frac{y.re \cdot x.im - x.re \cdot y.im}{\sqrt{{y.re}^{2} + {y.im}^{2}}}}{{\left(y.re \cdot y.re + y.im \cdot y.im\right)}^{0.5}}\\
\mathbf{if}\;y.re \leq -4.270742155339291 \cdot 10^{-94}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 3.818593708289327 \cdot 10^{-120}:\\
\;\;\;\;\frac{y.re \cdot x.im}{{y.im}^{2}} - \frac{x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 6.4153068053837126 \cdot 10^{+150}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}\\
\end{array}
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -8.236807978306482e+73)
(- (/ x.im y.re) (/ (* x.re y.im) (pow y.re 2.0)))
(let* ((t_0
(/
(/
(- (* y.re x.im) (* x.re y.im))
(sqrt (+ (pow y.re 2.0) (pow y.im 2.0))))
(pow (+ (* y.re y.re) (* y.im y.im)) 0.5))))
(if (<= y.re -4.270742155339291e-94)
t_0
(if (<= y.re 3.818593708289327e-120)
(- (/ (* y.re x.im) (pow y.im 2.0)) (/ x.re y.im))
(if (<= y.re 6.4153068053837126e+150) t_0 (/ x.im y.re)))))))double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * 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_re <= -8.236807978306482e+73) {
tmp = (x_46_im / y_46_re) - ((x_46_re * y_46_im) / pow(y_46_re, 2.0));
} else {
double t_0 = (((y_46_re * x_46_im) - (x_46_re * y_46_im)) / sqrt(pow(y_46_re, 2.0) + pow(y_46_im, 2.0))) / pow(((y_46_re * y_46_re) + (y_46_im * y_46_im)), 0.5);
double tmp_1;
if (y_46_re <= -4.270742155339291e-94) {
tmp_1 = t_0;
} else if (y_46_re <= 3.818593708289327e-120) {
tmp_1 = ((y_46_re * x_46_im) / pow(y_46_im, 2.0)) - (x_46_re / y_46_im);
} else if (y_46_re <= 6.4153068053837126e+150) {
tmp_1 = t_0;
} else {
tmp_1 = x_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
Results
if y.re < -8.236807978306482e73Initial program 37.2
Taylor expanded around inf 16.6
if -8.236807978306482e73 < y.re < -4.27074215533929121e-94 or 3.81859370828932731e-120 < y.re < 6.41530680538371258e150Initial program 16.8
rmApplied add-sqr-sqrt_binary6416.8
Applied associate-/r*_binary6416.7
Simplified16.7
rmApplied pow1_binary6416.7
Applied sqrt-pow1_binary6416.7
Simplified16.7
rmApplied sub-neg_binary6416.7
Simplified16.7
if -4.27074215533929121e-94 < y.re < 3.81859370828932731e-120Initial program 21.8
Taylor expanded around 0 11.1
if 6.41530680538371258e150 < y.re Initial program 45.3
Taylor expanded around inf 14.7
Final simplification14.7
herbie shell --seed 2021207
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, imaginary part"
:precision binary64
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))