\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 -7.72381449609585197339080432829350912947 \cdot 10^{66}:\\
\;\;\;\;\frac{-1 \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot 1}\\
\mathbf{elif}\;y.re \le 2.28477586604815435652148617808763730008 \cdot 10^{70}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right) \cdot 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot 1}\\
\end{array}double f(double x_re, double x_im, double y_re, double y_im) {
double r39993 = x_re;
double r39994 = y_re;
double r39995 = r39993 * r39994;
double r39996 = x_im;
double r39997 = y_im;
double r39998 = r39996 * r39997;
double r39999 = r39995 + r39998;
double r40000 = r39994 * r39994;
double r40001 = r39997 * r39997;
double r40002 = r40000 + r40001;
double r40003 = r39999 / r40002;
return r40003;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r40004 = y_re;
double r40005 = -7.723814496095852e+66;
bool r40006 = r40004 <= r40005;
double r40007 = -1.0;
double r40008 = x_re;
double r40009 = r40007 * r40008;
double r40010 = y_im;
double r40011 = hypot(r40004, r40010);
double r40012 = 1.0;
double r40013 = r40011 * r40012;
double r40014 = r40009 / r40013;
double r40015 = 2.2847758660481544e+70;
bool r40016 = r40004 <= r40015;
double r40017 = x_im;
double r40018 = r40017 * r40010;
double r40019 = fma(r40008, r40004, r40018);
double r40020 = r40019 / r40011;
double r40021 = r40020 / r40013;
double r40022 = r40008 / r40013;
double r40023 = r40016 ? r40021 : r40022;
double r40024 = r40006 ? r40014 : r40023;
return r40024;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -7.723814496095852e+66Initial program 36.2
rmApplied add-sqr-sqrt36.2
Applied *-un-lft-identity36.2
Applied times-frac36.2
Simplified36.2
Simplified24.1
rmApplied associate-*r/24.1
Simplified24.0
Taylor expanded around -inf 18.2
if -7.723814496095852e+66 < y.re < 2.2847758660481544e+70Initial program 18.0
rmApplied add-sqr-sqrt18.0
Applied *-un-lft-identity18.0
Applied times-frac18.0
Simplified18.0
Simplified10.6
rmApplied associate-*r/10.5
Simplified10.5
if 2.2847758660481544e+70 < y.re Initial program 37.9
rmApplied add-sqr-sqrt37.9
Applied *-un-lft-identity37.9
Applied times-frac37.9
Simplified37.9
Simplified25.3
rmApplied associate-*r/25.3
Simplified25.2
Taylor expanded around inf 18.1
Final simplification13.6
herbie shell --seed 2019353 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, real part"
:precision binary64
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))