Average Error: 33.6 → 10.4
Time: 27.6s
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^{\left(-y.re \cdot \log \left(\frac{-1}{x.re}\right)\right) - \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^{\left(-y.re \cdot \log \left(\frac{-1}{x.re}\right)\right) - \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 r21133 = x_re;
        double r21134 = r21133 * r21133;
        double r21135 = x_im;
        double r21136 = r21135 * r21135;
        double r21137 = r21134 + r21136;
        double r21138 = sqrt(r21137);
        double r21139 = log(r21138);
        double r21140 = y_re;
        double r21141 = r21139 * r21140;
        double r21142 = atan2(r21135, r21133);
        double r21143 = y_im;
        double r21144 = r21142 * r21143;
        double r21145 = r21141 - r21144;
        double r21146 = exp(r21145);
        double r21147 = r21139 * r21143;
        double r21148 = r21142 * r21140;
        double r21149 = r21147 + r21148;
        double r21150 = cos(r21149);
        double r21151 = r21146 * r21150;
        return r21151;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r21152 = x_re;
        double r21153 = -3.5665767812761e-310;
        bool r21154 = r21152 <= r21153;
        double r21155 = y_re;
        double r21156 = -1.0;
        double r21157 = r21156 / r21152;
        double r21158 = log(r21157);
        double r21159 = r21155 * r21158;
        double r21160 = -r21159;
        double r21161 = x_im;
        double r21162 = atan2(r21161, r21152);
        double r21163 = y_im;
        double r21164 = r21162 * r21163;
        double r21165 = r21160 - r21164;
        double r21166 = exp(r21165);
        double r21167 = pow(r21152, r21155);
        double r21168 = sqrt(r21167);
        double r21169 = exp(r21164);
        double r21170 = cbrt(r21169);
        double r21171 = r21170 * r21170;
        double r21172 = r21168 / r21171;
        double r21173 = r21168 / r21170;
        double r21174 = r21172 * r21173;
        double r21175 = r21154 ? r21166 : r21174;
        return r21175;
}

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^{\color{blue}{-1 \cdot \left(y.re \cdot \log \left(\frac{-1}{x.re}\right)\right)} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\]
    7. Simplified5.7

      \[\leadsto e^{\color{blue}{\left(-y.re \cdot \log \left(\frac{-1}{x.re}\right)\right)} - \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^{\left(-y.re \cdot \log \left(\frac{-1}{x.re}\right)\right) - \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)))))