\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.2616143508082277 \cdot 10^{79} \lor \neg \left(y.re \le 1.03827084215452011 \cdot 10^{-35}\right):\\
\;\;\;\;\frac{\frac{x.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.re}}}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{\frac{x.re \cdot y.im}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{\frac{x.re}{1}}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{\frac{y.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 r76231 = x_im;
double r76232 = y_re;
double r76233 = r76231 * r76232;
double r76234 = x_re;
double r76235 = y_im;
double r76236 = r76234 * r76235;
double r76237 = r76233 - r76236;
double r76238 = r76232 * r76232;
double r76239 = r76235 * r76235;
double r76240 = r76238 + r76239;
double r76241 = r76237 / r76240;
return r76241;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r76242 = y_re;
double r76243 = -2.2616143508082277e+79;
bool r76244 = r76242 <= r76243;
double r76245 = 1.0382708421545201e-35;
bool r76246 = r76242 <= r76245;
double r76247 = !r76246;
bool r76248 = r76244 || r76247;
double r76249 = x_im;
double r76250 = y_im;
double r76251 = hypot(r76242, r76250);
double r76252 = r76251 / r76242;
double r76253 = r76249 / r76252;
double r76254 = r76253 / r76251;
double r76255 = x_re;
double r76256 = r76255 * r76250;
double r76257 = r76256 / r76251;
double r76258 = r76257 / r76251;
double r76259 = r76254 - r76258;
double r76260 = r76249 * r76242;
double r76261 = r76260 / r76251;
double r76262 = r76261 / r76251;
double r76263 = 1.0;
double r76264 = r76255 / r76263;
double r76265 = r76250 / r76251;
double r76266 = r76251 / r76265;
double r76267 = r76264 / r76266;
double r76268 = r76262 - r76267;
double r76269 = r76248 ? r76259 : r76268;
return r76269;
}



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.2616143508082277e+79 or 1.0382708421545201e-35 < y.re Initial program 33.6
rmApplied add-sqr-sqrt33.6
Applied *-un-lft-identity33.6
Applied times-frac33.6
Simplified33.6
Simplified23.3
rmApplied associate-*r/23.2
Simplified23.2
rmApplied div-sub23.2
Applied div-sub23.2
rmApplied associate-/l*7.8
if -2.2616143508082277e+79 < y.re < 1.0382708421545201e-35Initial program 19.6
rmApplied add-sqr-sqrt19.6
Applied *-un-lft-identity19.6
Applied times-frac19.6
Simplified19.6
Simplified11.8
rmApplied associate-*r/11.7
Simplified11.7
rmApplied div-sub11.7
Applied div-sub11.7
rmApplied *-un-lft-identity11.7
Applied times-frac1.7
Applied associate-/l*1.9
Final simplification4.8
herbie shell --seed 2020060 +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))))