Average Error: 32.6 → 9.1
Time: 35.5s
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.19554071954375 \cdot 10^{-310}:\\ \;\;\;\;e^{\log \left(-x.re\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{e^{\left(\log x.re \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot 3}}\\ \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.19554071954375 \cdot 10^{-310}:\\
\;\;\;\;e^{\log \left(-x.re\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\

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

\end{array}
double f(double x_re, double x_im, double y_re, double y_im) {
        double r1059565 = x_re;
        double r1059566 = r1059565 * r1059565;
        double r1059567 = x_im;
        double r1059568 = r1059567 * r1059567;
        double r1059569 = r1059566 + r1059568;
        double r1059570 = sqrt(r1059569);
        double r1059571 = log(r1059570);
        double r1059572 = y_re;
        double r1059573 = r1059571 * r1059572;
        double r1059574 = atan2(r1059567, r1059565);
        double r1059575 = y_im;
        double r1059576 = r1059574 * r1059575;
        double r1059577 = r1059573 - r1059576;
        double r1059578 = exp(r1059577);
        double r1059579 = r1059571 * r1059575;
        double r1059580 = r1059574 * r1059572;
        double r1059581 = r1059579 + r1059580;
        double r1059582 = cos(r1059581);
        double r1059583 = r1059578 * r1059582;
        return r1059583;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r1059584 = x_re;
        double r1059585 = -3.19554071954375e-310;
        bool r1059586 = r1059584 <= r1059585;
        double r1059587 = -r1059584;
        double r1059588 = log(r1059587);
        double r1059589 = y_re;
        double r1059590 = r1059588 * r1059589;
        double r1059591 = y_im;
        double r1059592 = x_im;
        double r1059593 = atan2(r1059592, r1059584);
        double r1059594 = r1059591 * r1059593;
        double r1059595 = r1059590 - r1059594;
        double r1059596 = exp(r1059595);
        double r1059597 = log(r1059584);
        double r1059598 = r1059597 * r1059589;
        double r1059599 = r1059598 - r1059594;
        double r1059600 = 3.0;
        double r1059601 = r1059599 * r1059600;
        double r1059602 = exp(r1059601);
        double r1059603 = cbrt(r1059602);
        double r1059604 = r1059586 ? r1059596 : r1059603;
        return r1059604;
}

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.19554071954375e-310

    1. Initial program 30.7

      \[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 16.9

      \[\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 6.0

      \[\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\]
    4. Simplified6.0

      \[\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.19554071954375e-310 < x.re

    1. Initial program 34.5

      \[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 22.0

      \[\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.0

      \[\leadsto \color{blue}{\sqrt[3]{\left(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 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}\right) \cdot 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 1\]
    5. Simplified22.0

      \[\leadsto \sqrt[3]{\color{blue}{e^{3 \cdot \left(\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\right)}}} \cdot 1\]
    6. Taylor expanded around inf 12.2

      \[\leadsto \sqrt[3]{e^{3 \cdot \left(\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\right)}} \cdot 1\]
    7. Simplified12.2

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

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

Reproduce

herbie shell --seed 2019146 
(FPCore (x.re x.im y.re y.im)
  :name "powComplex, real part"
  (* (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)))))