\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}\;x.im \le -61.10607895990863625002020853571593761444 \lor \neg \left(x.im \le 1.310939369483501924587354661839021785547 \cdot 10^{-16}\right):\\
\;\;\;\;\frac{x.im}{y.re + \frac{y.im}{\frac{y.re}{y.im}}} - \frac{x.re}{y.im + \frac{y.re \cdot y.re}{y.im}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{\frac{y.im \cdot y.im}{y.re} + y.re} - \frac{x.re}{y.im + y.re \cdot \frac{y.re}{y.im}}\\
\end{array}double f(double x_re, double x_im, double y_re, double y_im) {
double r59718 = x_im;
double r59719 = y_re;
double r59720 = r59718 * r59719;
double r59721 = x_re;
double r59722 = y_im;
double r59723 = r59721 * r59722;
double r59724 = r59720 - r59723;
double r59725 = r59719 * r59719;
double r59726 = r59722 * r59722;
double r59727 = r59725 + r59726;
double r59728 = r59724 / r59727;
return r59728;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r59729 = x_im;
double r59730 = -61.106078959908636;
bool r59731 = r59729 <= r59730;
double r59732 = 1.310939369483502e-16;
bool r59733 = r59729 <= r59732;
double r59734 = !r59733;
bool r59735 = r59731 || r59734;
double r59736 = y_re;
double r59737 = y_im;
double r59738 = r59736 / r59737;
double r59739 = r59737 / r59738;
double r59740 = r59736 + r59739;
double r59741 = r59729 / r59740;
double r59742 = x_re;
double r59743 = r59736 * r59736;
double r59744 = r59743 / r59737;
double r59745 = r59737 + r59744;
double r59746 = r59742 / r59745;
double r59747 = r59741 - r59746;
double r59748 = r59737 * r59737;
double r59749 = r59748 / r59736;
double r59750 = r59749 + r59736;
double r59751 = r59729 / r59750;
double r59752 = r59736 * r59738;
double r59753 = r59737 + r59752;
double r59754 = r59742 / r59753;
double r59755 = r59751 - r59754;
double r59756 = r59735 ? r59747 : r59755;
return r59756;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if x.im < -61.106078959908636 or 1.310939369483502e-16 < x.im Initial program 32.8
rmApplied div-sub32.8
Simplified30.2
Simplified28.4
Taylor expanded around 0 16.0
Simplified16.0
Taylor expanded around 0 8.8
Simplified8.8
rmApplied associate-/l*4.9
if -61.106078959908636 < x.im < 1.310939369483502e-16Initial program 20.2
rmApplied div-sub20.2
Simplified19.7
Simplified18.3
Taylor expanded around 0 15.8
Simplified15.8
Taylor expanded around 0 7.3
Simplified7.3
rmApplied *-un-lft-identity7.3
Applied times-frac3.8
Simplified3.8
Final simplification4.3
herbie shell --seed 2019196
(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))))