\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 -7.72381449609585197339080432829350912947 \cdot 10^{66}:\\
\;\;\;\;\frac{-1 \cdot x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \le 3.210000869555314649690325264102980299442 \cdot 10^{117}:\\
\;\;\;\;\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}:\\
\;\;\;\;\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 r64261 = x_im;
double r64262 = y_re;
double r64263 = r64261 * r64262;
double r64264 = x_re;
double r64265 = y_im;
double r64266 = r64264 * r64265;
double r64267 = r64263 - r64266;
double r64268 = r64262 * r64262;
double r64269 = r64265 * r64265;
double r64270 = r64268 + r64269;
double r64271 = r64267 / r64270;
return r64271;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r64272 = y_re;
double r64273 = -7.723814496095852e+66;
bool r64274 = r64272 <= r64273;
double r64275 = -1.0;
double r64276 = x_im;
double r64277 = r64275 * r64276;
double r64278 = y_im;
double r64279 = hypot(r64272, r64278);
double r64280 = r64277 / r64279;
double r64281 = 3.2100008695553146e+117;
bool r64282 = r64272 <= r64281;
double r64283 = r64276 * r64272;
double r64284 = x_re;
double r64285 = r64284 * r64278;
double r64286 = r64283 - r64285;
double r64287 = r64286 / r64279;
double r64288 = r64287 / r64279;
double r64289 = r64276 / r64279;
double r64290 = r64282 ? r64288 : r64289;
double r64291 = r64274 ? r64280 : r64290;
return r64291;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.re < -7.723814496095852e+66Initial program 37.2
rmApplied add-sqr-sqrt37.2
Applied *-un-lft-identity37.2
Applied times-frac37.2
Simplified37.2
Simplified25.4
rmApplied associate-*r/25.4
Simplified25.4
Taylor expanded around -inf 18.0
if -7.723814496095852e+66 < y.re < 3.2100008695553146e+117Initial program 19.3
rmApplied add-sqr-sqrt19.3
Applied *-un-lft-identity19.3
Applied times-frac19.3
Simplified19.3
Simplified12.3
rmApplied associate-*r/12.3
Simplified12.2
if 3.2100008695553146e+117 < y.re Initial program 40.3
rmApplied add-sqr-sqrt40.3
Applied *-un-lft-identity40.3
Applied times-frac40.3
Simplified40.3
Simplified26.0
rmApplied associate-*r/26.0
Simplified26.0
Taylor expanded around inf 15.6
Final simplification13.9
herbie shell --seed 2019353 +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))))