Average Error: 33.6 → 10.4
Time: 28.3s
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 r21171 = x_re;
        double r21172 = r21171 * r21171;
        double r21173 = x_im;
        double r21174 = r21173 * r21173;
        double r21175 = r21172 + r21174;
        double r21176 = sqrt(r21175);
        double r21177 = log(r21176);
        double r21178 = y_re;
        double r21179 = r21177 * r21178;
        double r21180 = atan2(r21173, r21171);
        double r21181 = y_im;
        double r21182 = r21180 * r21181;
        double r21183 = r21179 - r21182;
        double r21184 = exp(r21183);
        double r21185 = r21177 * r21181;
        double r21186 = r21180 * r21178;
        double r21187 = r21185 + r21186;
        double r21188 = cos(r21187);
        double r21189 = r21184 * r21188;
        return r21189;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r21190 = x_re;
        double r21191 = -3.5665767812761e-310;
        bool r21192 = r21190 <= r21191;
        double r21193 = y_re;
        double r21194 = -1.0;
        double r21195 = r21194 / r21190;
        double r21196 = log(r21195);
        double r21197 = r21193 * r21196;
        double r21198 = -r21197;
        double r21199 = x_im;
        double r21200 = atan2(r21199, r21190);
        double r21201 = y_im;
        double r21202 = r21200 * r21201;
        double r21203 = r21198 - r21202;
        double r21204 = exp(r21203);
        double r21205 = pow(r21190, r21193);
        double r21206 = sqrt(r21205);
        double r21207 = exp(r21202);
        double r21208 = cbrt(r21207);
        double r21209 = r21208 * r21208;
        double r21210 = r21206 / r21209;
        double r21211 = r21206 / r21208;
        double r21212 = r21210 * r21211;
        double r21213 = r21192 ? r21204 : r21212;
        return r21213;
}

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