\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 -8.305623690601149751122925407417973083209 \cdot 10^{163}:\\
\;\;\;\;-\frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{elif}\;y.re \le 2.805404912411875912470168548725953456027 \cdot 10^{84}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(y.re, x.im, x.re \cdot \left(-y.im\right)\right)}{\mathsf{hypot}\left(y.im, y.re\right)}}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\end{array}double f(double x_re, double x_im, double y_re, double y_im) {
double r3120635 = x_im;
double r3120636 = y_re;
double r3120637 = r3120635 * r3120636;
double r3120638 = x_re;
double r3120639 = y_im;
double r3120640 = r3120638 * r3120639;
double r3120641 = r3120637 - r3120640;
double r3120642 = r3120636 * r3120636;
double r3120643 = r3120639 * r3120639;
double r3120644 = r3120642 + r3120643;
double r3120645 = r3120641 / r3120644;
return r3120645;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r3120646 = y_re;
double r3120647 = -8.30562369060115e+163;
bool r3120648 = r3120646 <= r3120647;
double r3120649 = x_im;
double r3120650 = y_im;
double r3120651 = hypot(r3120650, r3120646);
double r3120652 = r3120649 / r3120651;
double r3120653 = -r3120652;
double r3120654 = 2.805404912411876e+84;
bool r3120655 = r3120646 <= r3120654;
double r3120656 = x_re;
double r3120657 = -r3120650;
double r3120658 = r3120656 * r3120657;
double r3120659 = fma(r3120646, r3120649, r3120658);
double r3120660 = r3120659 / r3120651;
double r3120661 = r3120660 / r3120651;
double r3120662 = r3120655 ? r3120661 : r3120652;
double r3120663 = r3120648 ? r3120653 : r3120662;
return r3120663;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -8.30562369060115e+163Initial program 45.0
Simplified45.0
rmApplied add-sqr-sqrt45.0
Applied associate-/r*45.0
rmApplied fma-udef45.0
Applied hypot-def45.0
Taylor expanded around -inf 13.0
Simplified13.0
if -8.30562369060115e+163 < y.re < 2.805404912411876e+84Initial program 19.4
Simplified19.4
rmApplied add-sqr-sqrt19.5
Applied associate-/r*19.4
rmApplied fma-udef19.4
Applied hypot-def19.3
rmApplied *-un-lft-identity19.3
Applied associate-/r*19.3
Simplified12.1
rmApplied fma-neg12.1
if 2.805404912411876e+84 < y.re Initial program 38.3
Simplified38.3
rmApplied add-sqr-sqrt38.3
Applied associate-/r*38.3
rmApplied fma-udef38.3
Applied hypot-def38.3
Taylor expanded around inf 18.2
Final simplification13.4
herbie shell --seed 2019179 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, imaginary part"
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))