\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 \le -1.5195216293899823 \cdot 10^{103}:\\
\;\;\;\;{\left(\frac{-1 \cdot x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\right)}^{1}\\
\mathbf{elif}\;y.re \le 9.14594638519536889 \cdot 10^{130}:\\
\;\;\;\;{\left(\frac{\frac{x.im \cdot y.re - x.re \cdot y.im}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\right)}^{1}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\right)}^{1}\\
\end{array}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 temp;
if ((y_46_re <= -1.5195216293899823e+103)) {
temp = pow(((-1.0 * x_46_im) / hypot(y_46_re, y_46_im)), 1.0);
} else {
double temp_1;
if ((y_46_re <= 9.145946385195369e+130)) {
temp_1 = pow(((((x_46_im * y_46_re) - (x_46_re * y_46_im)) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im)), 1.0);
} else {
temp_1 = pow((x_46_im / hypot(y_46_re, y_46_im)), 1.0);
}
temp = temp_1;
}
return temp;
}



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.5195216293899823e+103Initial program 40.0
rmApplied add-sqr-sqrt40.0
Applied *-un-lft-identity40.0
Applied times-frac40.0
Simplified40.0
Simplified26.4
rmApplied pow126.4
Applied pow126.4
Applied pow-prod-down26.4
Simplified26.4
Taylor expanded around -inf 15.7
if -1.5195216293899823e+103 < y.re < 9.145946385195369e+130Initial program 19.1
rmApplied add-sqr-sqrt19.1
Applied *-un-lft-identity19.1
Applied times-frac19.1
Simplified19.1
Simplified12.1
rmApplied pow112.1
Applied pow112.1
Applied pow-prod-down12.1
Simplified12.0
if 9.145946385195369e+130 < y.re Initial program 42.0
rmApplied add-sqr-sqrt42.0
Applied *-un-lft-identity42.0
Applied times-frac42.0
Simplified42.0
Simplified28.3
rmApplied pow128.3
Applied pow128.3
Applied pow-prod-down28.3
Simplified28.3
Taylor expanded around inf 14.0
Final simplification13.0
herbie shell --seed 2020058 +o rules:numerics
(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))))