\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 -2.23527954643198682 \cdot 10^{180}:\\
\;\;\;\;1 \cdot \frac{-1 \cdot x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \le 3.26314722618803973 \cdot 10^{197}:\\
\;\;\;\;1 \cdot \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)}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}double f(double x_re, double x_im, double y_re, double y_im) {
double r108075 = x_im;
double r108076 = y_re;
double r108077 = r108075 * r108076;
double r108078 = x_re;
double r108079 = y_im;
double r108080 = r108078 * r108079;
double r108081 = r108077 - r108080;
double r108082 = r108076 * r108076;
double r108083 = r108079 * r108079;
double r108084 = r108082 + r108083;
double r108085 = r108081 / r108084;
return r108085;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r108086 = y_re;
double r108087 = -2.235279546431987e+180;
bool r108088 = r108086 <= r108087;
double r108089 = 1.0;
double r108090 = -1.0;
double r108091 = x_im;
double r108092 = r108090 * r108091;
double r108093 = y_im;
double r108094 = hypot(r108086, r108093);
double r108095 = r108092 / r108094;
double r108096 = r108089 * r108095;
double r108097 = 3.26314722618804e+197;
bool r108098 = r108086 <= r108097;
double r108099 = r108091 * r108086;
double r108100 = x_re;
double r108101 = r108100 * r108093;
double r108102 = r108099 - r108101;
double r108103 = r108102 / r108094;
double r108104 = r108103 / r108094;
double r108105 = r108089 * r108104;
double r108106 = r108091 / r108094;
double r108107 = r108089 * r108106;
double r108108 = r108098 ? r108105 : r108107;
double r108109 = r108088 ? r108096 : r108108;
return r108109;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.re < -2.235279546431987e+180Initial program 42.1
rmApplied add-sqr-sqrt42.1
Applied *-un-lft-identity42.1
Applied times-frac42.1
Simplified42.1
Simplified28.1
rmApplied *-un-lft-identity28.1
Applied associate-*l*28.1
Simplified28.0
Taylor expanded around -inf 11.1
if -2.235279546431987e+180 < y.re < 3.26314722618804e+197Initial program 21.2
rmApplied add-sqr-sqrt21.2
Applied *-un-lft-identity21.2
Applied times-frac21.2
Simplified21.2
Simplified13.2
rmApplied *-un-lft-identity13.2
Applied associate-*l*13.2
Simplified13.1
if 3.26314722618804e+197 < y.re Initial program 44.4
rmApplied add-sqr-sqrt44.4
Applied *-un-lft-identity44.4
Applied times-frac44.4
Simplified44.4
Simplified31.2
rmApplied *-un-lft-identity31.2
Applied associate-*l*31.2
Simplified31.2
Taylor expanded around inf 10.4
Final simplification12.6
herbie shell --seed 2020089 +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))))