\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.729339549361261 \cdot 10^{+115}:\\
\;\;\;\;-\frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \le 1.512622379546738 \cdot 10^{+155}:\\
\;\;\;\;\frac{\frac{x.im \cdot y.re - y.im \cdot x.re}{\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 r2616323 = x_im;
double r2616324 = y_re;
double r2616325 = r2616323 * r2616324;
double r2616326 = x_re;
double r2616327 = y_im;
double r2616328 = r2616326 * r2616327;
double r2616329 = r2616325 - r2616328;
double r2616330 = r2616324 * r2616324;
double r2616331 = r2616327 * r2616327;
double r2616332 = r2616330 + r2616331;
double r2616333 = r2616329 / r2616332;
return r2616333;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r2616334 = y_re;
double r2616335 = -7.729339549361261e+115;
bool r2616336 = r2616334 <= r2616335;
double r2616337 = x_im;
double r2616338 = y_im;
double r2616339 = hypot(r2616334, r2616338);
double r2616340 = r2616337 / r2616339;
double r2616341 = -r2616340;
double r2616342 = 1.512622379546738e+155;
bool r2616343 = r2616334 <= r2616342;
double r2616344 = r2616337 * r2616334;
double r2616345 = x_re;
double r2616346 = r2616338 * r2616345;
double r2616347 = r2616344 - r2616346;
double r2616348 = r2616347 / r2616339;
double r2616349 = r2616348 / r2616339;
double r2616350 = r2616343 ? r2616349 : r2616340;
double r2616351 = r2616336 ? r2616341 : r2616350;
return r2616351;
}



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.729339549361261e+115Initial program 40.9
rmApplied add-sqr-sqrt40.9
Applied associate-/r*40.9
rmApplied hypot-def40.9
rmApplied hypot-def26.5
Taylor expanded around -inf 15.5
Simplified15.5
if -7.729339549361261e+115 < y.re < 1.512622379546738e+155Initial program 18.5
rmApplied add-sqr-sqrt18.5
Applied associate-/r*18.4
rmApplied hypot-def18.4
rmApplied hypot-def11.4
Taylor expanded around inf 11.4
if 1.512622379546738e+155 < y.re Initial program 45.9
rmApplied add-sqr-sqrt45.9
Applied associate-/r*45.9
rmApplied hypot-def45.9
rmApplied hypot-def27.9
Taylor expanded around inf 15.7
Final simplification12.6
herbie shell --seed 2019162 +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))))