e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\mathsf{log1p}\left(\mathsf{expm1}\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\right)\right)\right)\right)\right) \cdot e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}double f(double x_re, double x_im, double y_re, double y_im) {
double r24595 = x_re;
double r24596 = r24595 * r24595;
double r24597 = x_im;
double r24598 = r24597 * r24597;
double r24599 = r24596 + r24598;
double r24600 = sqrt(r24599);
double r24601 = log(r24600);
double r24602 = y_re;
double r24603 = r24601 * r24602;
double r24604 = atan2(r24597, r24595);
double r24605 = y_im;
double r24606 = r24604 * r24605;
double r24607 = r24603 - r24606;
double r24608 = exp(r24607);
double r24609 = r24601 * r24605;
double r24610 = r24604 * r24602;
double r24611 = r24609 + r24610;
double r24612 = sin(r24611);
double r24613 = r24608 * r24612;
return r24613;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r24614 = x_im;
double r24615 = x_re;
double r24616 = atan2(r24614, r24615);
double r24617 = y_re;
double r24618 = hypot(r24615, r24614);
double r24619 = log(r24618);
double r24620 = y_im;
double r24621 = r24619 * r24620;
double r24622 = fma(r24616, r24617, r24621);
double r24623 = sin(r24622);
double r24624 = log1p(r24623);
double r24625 = expm1(r24624);
double r24626 = expm1(r24625);
double r24627 = log1p(r24626);
double r24628 = r24619 * r24617;
double r24629 = r24616 * r24620;
double r24630 = r24628 - r24629;
double r24631 = exp(r24630);
double r24632 = r24627 * r24631;
return r24632;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Initial program 33.3
Simplified8.6
rmApplied add-exp-log8.6
Applied pow-exp8.6
Applied div-exp3.3
rmApplied log1p-expm1-u3.3
rmApplied add-cube-cbrt3.5
Applied associate-*r*3.5
rmApplied expm1-log1p-u3.5
Simplified3.3
Final simplification3.3
herbie shell --seed 2019326 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
:name "powComplex, imaginary part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))