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)\begin{array}{l}
\mathbf{if}\;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) \le 0.0:\\
\;\;\;\;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)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right) \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) + \cos \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right) \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{e^{\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}\right) \cdot \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.im\right)}}\\
\end{array}double f(double x_re, double x_im, double y_re, double y_im) {
double r24733 = x_re;
double r24734 = r24733 * r24733;
double r24735 = x_im;
double r24736 = r24735 * r24735;
double r24737 = r24734 + r24736;
double r24738 = sqrt(r24737);
double r24739 = log(r24738);
double r24740 = y_re;
double r24741 = r24739 * r24740;
double r24742 = atan2(r24735, r24733);
double r24743 = y_im;
double r24744 = r24742 * r24743;
double r24745 = r24741 - r24744;
double r24746 = exp(r24745);
double r24747 = r24739 * r24743;
double r24748 = r24742 * r24740;
double r24749 = r24747 + r24748;
double r24750 = sin(r24749);
double r24751 = r24746 * r24750;
return r24751;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r24752 = x_re;
double r24753 = r24752 * r24752;
double r24754 = x_im;
double r24755 = r24754 * r24754;
double r24756 = r24753 + r24755;
double r24757 = sqrt(r24756);
double r24758 = log(r24757);
double r24759 = y_re;
double r24760 = r24758 * r24759;
double r24761 = atan2(r24754, r24752);
double r24762 = y_im;
double r24763 = r24761 * r24762;
double r24764 = r24760 - r24763;
double r24765 = exp(r24764);
double r24766 = r24758 * r24762;
double r24767 = r24761 * r24759;
double r24768 = r24766 + r24767;
double r24769 = sin(r24768);
double r24770 = r24765 * r24769;
double r24771 = 0.0;
bool r24772 = r24770 <= r24771;
double r24773 = hypot(r24752, r24754);
double r24774 = log(r24773);
double r24775 = r24774 * r24762;
double r24776 = sin(r24775);
double r24777 = cos(r24767);
double r24778 = r24776 * r24777;
double r24779 = cos(r24775);
double r24780 = sin(r24767);
double r24781 = r24779 * r24780;
double r24782 = r24778 + r24781;
double r24783 = log1p(r24782);
double r24784 = expm1(r24783);
double r24785 = pow(r24773, r24759);
double r24786 = cbrt(r24761);
double r24787 = r24786 * r24786;
double r24788 = r24786 * r24762;
double r24789 = r24787 * r24788;
double r24790 = exp(r24789);
double r24791 = r24785 / r24790;
double r24792 = r24784 * r24791;
double r24793 = r24772 ? r24770 : r24792;
return r24793;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if (* (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)))) < 0.0Initial program 3.2
if 0.0 < (* (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)))) Initial program 43.8
Simplified9.1
rmApplied add-cube-cbrt9.1
Applied associate-*l*9.1
rmApplied expm1-log1p-u9.1
rmApplied fma-udef9.1
Applied sin-sum9.1
Final simplification6.2
herbie shell --seed 2019303 +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)))))