double f(double x_re, double x_im, double y_re, double y_im) {
double r3098382 = x_re;
double r3098383 = y_re;
double r3098384 = r3098382 * r3098383;
double r3098385 = x_im;
double r3098386 = y_im;
double r3098387 = r3098385 * r3098386;
double r3098388 = r3098384 + r3098387;
double r3098389 = r3098383 * r3098383;
double r3098390 = r3098386 * r3098386;
double r3098391 = r3098389 + r3098390;
double r3098392 = r3098388 / r3098391;
return r3098392;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r3098393 = y_re;
double r3098394 = -1.1649944572964785e+191;
bool r3098395 = r3098393 <= r3098394;
double r3098396 = x_re;
double r3098397 = -r3098396;
double r3098398 = y_im;
double r3098399 = hypot(r3098398, r3098393);
double r3098400 = r3098397 / r3098399;
double r3098401 = 6.443797861366497e+143;
bool r3098402 = r3098393 <= r3098401;
double r3098403 = x_im;
double r3098404 = r3098398 * r3098403;
double r3098405 = fma(r3098396, r3098393, r3098404);
double r3098406 = r3098405 / r3098399;
double r3098407 = r3098406 / r3098399;
double r3098408 = r3098396 / r3098399;
double r3098409 = r3098402 ? r3098407 : r3098408;
double r3098410 = r3098395 ? r3098400 : r3098409;
return r3098410;
}
\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\begin{array}{l}
\mathbf{if}\;y.re \le -1.1649944572964785 \cdot 10^{+191}:\\
\;\;\;\;\frac{-x.re}{\sqrt{y.im^2 + y.re^2}^*}\\
\mathbf{elif}\;y.re \le 6.443797861366497 \cdot 10^{+143}:\\
\;\;\;\;\frac{\frac{(x.re \cdot y.re + \left(y.im \cdot x.im\right))_*}{\sqrt{y.im^2 + y.re^2}^*}}{\sqrt{y.im^2 + y.re^2}^*}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{\sqrt{y.im^2 + y.re^2}^*}\\
\end{array}


Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -1.1649944572964785e+191Initial program 43.0
Simplified43.0
rmApplied add-sqr-sqrt43.0
Applied associate-/r*43.0
rmApplied fma-udef43.0
Applied hypot-def43.0
rmApplied fma-udef43.0
Applied hypot-def29.7
Taylor expanded around -inf 10.9
Simplified10.9
if -1.1649944572964785e+191 < y.re < 6.443797861366497e+143Initial program 20.5
Simplified20.5
rmApplied add-sqr-sqrt20.5
Applied associate-/r*20.4
rmApplied fma-udef20.4
Applied hypot-def20.4
rmApplied fma-udef20.4
Applied hypot-def12.4
if 6.443797861366497e+143 < y.re Initial program 43.2
Simplified43.2
rmApplied add-sqr-sqrt43.2
Applied associate-/r*43.2
rmApplied fma-udef43.2
Applied hypot-def43.2
rmApplied fma-udef43.2
Applied hypot-def26.9
Taylor expanded around inf 14.7
Final simplification12.5
herbie shell --seed 2019101 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, real part"
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))