\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 -1.936337481574621 \cdot 10^{-09} \lor \neg \left(y.re \leq 2.547251396127817 \cdot 10^{-98}\right):\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} - y.im \cdot \frac{x.re}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y.re \cdot x.im - y.im \cdot x.re}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\\
\end{array}double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (((double) (((double) (x_46_im * y_46_re)) - ((double) (x_46_re * y_46_im)))) / ((double) (((double) (y_46_re * y_46_re)) + ((double) (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 VAR;
if (((y_46_re <= -1.936337481574621e-09) || !(y_46_re <= 2.547251396127817e-98))) {
VAR = (((double) (((double) (y_46_re * (x_46_im / ((double) sqrt(((double) (((double) (y_46_re * y_46_re)) + ((double) (y_46_im * y_46_im))))))))) - ((double) (y_46_im * (x_46_re / ((double) sqrt(((double) (((double) (y_46_re * y_46_re)) + ((double) (y_46_im * y_46_im))))))))))) / ((double) sqrt(((double) (((double) (y_46_re * y_46_re)) + ((double) (y_46_im * y_46_im)))))));
} else {
VAR = ((((double) (((double) (y_46_re * x_46_im)) - ((double) (y_46_im * x_46_re)))) / ((double) sqrt(((double) (((double) (y_46_re * y_46_re)) + ((double) (y_46_im * y_46_im))))))) / ((double) sqrt(((double) (((double) (y_46_re * y_46_re)) + ((double) (y_46_im * y_46_im)))))));
}
return VAR;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.re < -1.93633748157462091e-9 or 2.5472513961278171e-98 < y.re Initial program Error: 29.0 bits
rmApplied add-sqr-sqrtError: 29.0 bits
Applied associate-/r*Error: 29.0 bits
rmApplied div-subError: 29.0 bits
SimplifiedError: 26.1 bits
SimplifiedError: 24.9 bits
if -1.93633748157462091e-9 < y.re < 2.5472513961278171e-98Initial program Error: 20.5 bits
rmApplied add-sqr-sqrtError: 20.5 bits
Applied associate-/r*Error: 20.4 bits
Final simplificationError: 23.2 bits
herbie shell --seed 2020200
(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))))