Average Error: 33.6 → 10.4
Time: 27.7s
Precision: 64
\[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 \cos \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}\;x.re \le -3.566576781276111012185154762547093345551 \cdot 10^{-310}:\\ \;\;\;\;e^{\log \left(-x.re\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{{x.re}^{y.re}}}{\sqrt[3]{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot \sqrt[3]{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}} \cdot \frac{\sqrt{{x.re}^{y.re}}}{\sqrt[3]{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}}\\ \end{array}\]
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 \cos \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}\;x.re \le -3.566576781276111012185154762547093345551 \cdot 10^{-310}:\\
\;\;\;\;e^{\log \left(-x.re\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{{x.re}^{y.re}}}{\sqrt[3]{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot \sqrt[3]{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}} \cdot \frac{\sqrt{{x.re}^{y.re}}}{\sqrt[3]{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}}\\

\end{array}
double f(double x_re, double x_im, double y_re, double y_im) {
        double r21089 = x_re;
        double r21090 = r21089 * r21089;
        double r21091 = x_im;
        double r21092 = r21091 * r21091;
        double r21093 = r21090 + r21092;
        double r21094 = sqrt(r21093);
        double r21095 = log(r21094);
        double r21096 = y_re;
        double r21097 = r21095 * r21096;
        double r21098 = atan2(r21091, r21089);
        double r21099 = y_im;
        double r21100 = r21098 * r21099;
        double r21101 = r21097 - r21100;
        double r21102 = exp(r21101);
        double r21103 = r21095 * r21099;
        double r21104 = r21098 * r21096;
        double r21105 = r21103 + r21104;
        double r21106 = cos(r21105);
        double r21107 = r21102 * r21106;
        return r21107;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r21108 = x_re;
        double r21109 = -3.5665767812761e-310;
        bool r21110 = r21108 <= r21109;
        double r21111 = -r21108;
        double r21112 = log(r21111);
        double r21113 = y_re;
        double r21114 = r21112 * r21113;
        double r21115 = x_im;
        double r21116 = atan2(r21115, r21108);
        double r21117 = y_im;
        double r21118 = r21116 * r21117;
        double r21119 = r21114 - r21118;
        double r21120 = exp(r21119);
        double r21121 = pow(r21108, r21113);
        double r21122 = sqrt(r21121);
        double r21123 = exp(r21118);
        double r21124 = cbrt(r21123);
        double r21125 = r21124 * r21124;
        double r21126 = r21122 / r21125;
        double r21127 = r21122 / r21124;
        double r21128 = r21126 * r21127;
        double r21129 = r21110 ? r21120 : r21128;
        return r21129;
}

Error

Bits error versus x.re

Bits error versus x.im

Bits error versus y.re

Bits error versus y.im

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if x.re < -3.5665767812761e-310

    1. Initial program 32.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 \cos \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)\]
    2. Taylor expanded around 0 17.1

      \[\leadsto 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 \color{blue}{1}\]
    3. Using strategy rm
    4. Applied add-cbrt-cube22.8

      \[\leadsto e^{\log \color{blue}{\left(\sqrt[3]{\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im} \cdot \sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot \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 1\]
    5. Simplified22.8

      \[\leadsto e^{\log \left(\sqrt[3]{\color{blue}{{\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{3}}}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\]
    6. Taylor expanded around -inf 5.7

      \[\leadsto e^{\log \color{blue}{\left(-1 \cdot x.re\right)} \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\]
    7. Simplified5.7

      \[\leadsto e^{\log \color{blue}{\left(-x.re\right)} \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\]

    if -3.5665767812761e-310 < x.re

    1. Initial program 35.2

      \[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 \cos \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)\]
    2. Taylor expanded around 0 21.4

      \[\leadsto 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 \color{blue}{1}\]
    3. Taylor expanded around inf 11.7

      \[\leadsto \color{blue}{e^{-\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + y.re \cdot \log \left(\frac{1}{x.re}\right)\right)}} \cdot 1\]
    4. Simplified14.9

      \[\leadsto \color{blue}{\frac{{x.re}^{y.re}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}} \cdot 1\]
    5. Using strategy rm
    6. Applied add-cube-cbrt14.9

      \[\leadsto \frac{{x.re}^{y.re}}{\color{blue}{\left(\sqrt[3]{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot \sqrt[3]{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\right) \cdot \sqrt[3]{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}}} \cdot 1\]
    7. Applied add-sqr-sqrt14.9

      \[\leadsto \frac{\color{blue}{\sqrt{{x.re}^{y.re}} \cdot \sqrt{{x.re}^{y.re}}}}{\left(\sqrt[3]{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot \sqrt[3]{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\right) \cdot \sqrt[3]{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}} \cdot 1\]
    8. Applied times-frac14.9

      \[\leadsto \color{blue}{\left(\frac{\sqrt{{x.re}^{y.re}}}{\sqrt[3]{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot \sqrt[3]{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}} \cdot \frac{\sqrt{{x.re}^{y.re}}}{\sqrt[3]{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}}\right)} \cdot 1\]
  3. Recombined 2 regimes into one program.
  4. Final simplification10.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.re \le -3.566576781276111012185154762547093345551 \cdot 10^{-310}:\\ \;\;\;\;e^{\log \left(-x.re\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{{x.re}^{y.re}}}{\sqrt[3]{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot \sqrt[3]{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}} \cdot \frac{\sqrt{{x.re}^{y.re}}}{\sqrt[3]{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019323 
(FPCore (x.re x.im y.re y.im)
  :name "powComplex, real part"
  :precision binary64
  (* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (cos (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))