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 r24578 = x_re;
double r24579 = r24578 * r24578;
double r24580 = x_im;
double r24581 = r24580 * r24580;
double r24582 = r24579 + r24581;
double r24583 = sqrt(r24582);
double r24584 = log(r24583);
double r24585 = y_re;
double r24586 = r24584 * r24585;
double r24587 = atan2(r24580, r24578);
double r24588 = y_im;
double r24589 = r24587 * r24588;
double r24590 = r24586 - r24589;
double r24591 = exp(r24590);
double r24592 = r24584 * r24588;
double r24593 = r24587 * r24585;
double r24594 = r24592 + r24593;
double r24595 = sin(r24594);
double r24596 = r24591 * r24595;
return r24596;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r24597 = x_im;
double r24598 = x_re;
double r24599 = atan2(r24597, r24598);
double r24600 = y_re;
double r24601 = hypot(r24598, r24597);
double r24602 = log(r24601);
double r24603 = y_im;
double r24604 = r24602 * r24603;
double r24605 = fma(r24599, r24600, r24604);
double r24606 = sin(r24605);
double r24607 = log1p(r24606);
double r24608 = expm1(r24607);
double r24609 = expm1(r24608);
double r24610 = log1p(r24609);
double r24611 = r24602 * r24600;
double r24612 = r24599 * r24603;
double r24613 = r24611 - r24612;
double r24614 = exp(r24613);
double r24615 = r24610 * r24614;
return r24615;
}



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)))))