double f(double x_re, double x_im, double y_re, double y_im) {
double r2309688 = x_im;
double r2309689 = y_re;
double r2309690 = r2309688 * r2309689;
double r2309691 = x_re;
double r2309692 = y_im;
double r2309693 = r2309691 * r2309692;
double r2309694 = r2309690 - r2309693;
double r2309695 = r2309689 * r2309689;
double r2309696 = r2309692 * r2309692;
double r2309697 = r2309695 + r2309696;
double r2309698 = r2309694 / r2309697;
return r2309698;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r2309699 = y_re;
double r2309700 = -4.5554482331281827e+198;
bool r2309701 = r2309699 <= r2309700;
double r2309702 = x_im;
double r2309703 = y_im;
double r2309704 = hypot(r2309703, r2309699);
double r2309705 = r2309702 / r2309704;
double r2309706 = -r2309705;
double r2309707 = 2.251215078496209e+155;
bool r2309708 = r2309699 <= r2309707;
double r2309709 = r2309702 * r2309699;
double r2309710 = x_re;
double r2309711 = r2309703 * r2309710;
double r2309712 = r2309709 - r2309711;
double r2309713 = r2309712 / r2309704;
double r2309714 = r2309713 / r2309704;
double r2309715 = r2309708 ? r2309714 : r2309705;
double r2309716 = r2309701 ? r2309706 : r2309715;
return r2309716;
}
\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 -4.5554482331281827 \cdot 10^{+198}:\\
\;\;\;\;-\frac{x.im}{\sqrt{y.im^2 + y.re^2}^*}\\
\mathbf{elif}\;y.re \le 2.251215078496209 \cdot 10^{+155}:\\
\;\;\;\;\frac{\frac{x.im \cdot y.re - y.im \cdot x.re}{\sqrt{y.im^2 + y.re^2}^*}}{\sqrt{y.im^2 + y.re^2}^*}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{\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 < -4.5554482331281827e+198Initial program 42.2
Simplified42.2
rmApplied add-sqr-sqrt42.2
Applied associate-/r*42.2
rmApplied fma-udef42.2
Applied hypot-def42.2
Taylor expanded around -inf 11.7
Simplified11.7
if -4.5554482331281827e+198 < y.re < 2.251215078496209e+155Initial program 20.6
Simplified20.6
rmApplied add-sqr-sqrt20.6
Applied associate-/r*20.5
rmApplied fma-udef20.5
Applied hypot-def20.5
rmApplied fma-udef20.5
Applied hypot-def12.2
if 2.251215078496209e+155 < y.re Initial program 44.2
Simplified44.2
rmApplied add-sqr-sqrt44.2
Applied associate-/r*44.2
rmApplied fma-udef44.2
Applied hypot-def44.2
rmApplied fma-udef44.2
Applied hypot-def28.2
Taylor expanded around inf 14.6
Final simplification12.5
herbie shell --seed 2019101 +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))))