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

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

\end{array}
double f(double x_re, double x_im, double y_re, double y_im) {
        double r1316897 = x_re;
        double r1316898 = r1316897 * r1316897;
        double r1316899 = x_im;
        double r1316900 = r1316899 * r1316899;
        double r1316901 = r1316898 + r1316900;
        double r1316902 = sqrt(r1316901);
        double r1316903 = log(r1316902);
        double r1316904 = y_re;
        double r1316905 = r1316903 * r1316904;
        double r1316906 = atan2(r1316899, r1316897);
        double r1316907 = y_im;
        double r1316908 = r1316906 * r1316907;
        double r1316909 = r1316905 - r1316908;
        double r1316910 = exp(r1316909);
        double r1316911 = r1316903 * r1316907;
        double r1316912 = r1316906 * r1316904;
        double r1316913 = r1316911 + r1316912;
        double r1316914 = cos(r1316913);
        double r1316915 = r1316910 * r1316914;
        return r1316915;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r1316916 = x_re;
        double r1316917 = 1.04726288994103e-310;
        bool r1316918 = r1316916 <= r1316917;
        double r1316919 = -r1316916;
        double r1316920 = log(r1316919);
        double r1316921 = y_re;
        double r1316922 = r1316920 * r1316921;
        double r1316923 = y_im;
        double r1316924 = x_im;
        double r1316925 = atan2(r1316924, r1316916);
        double r1316926 = r1316923 * r1316925;
        double r1316927 = r1316922 - r1316926;
        double r1316928 = exp(r1316927);
        double r1316929 = cbrt(r1316916);
        double r1316930 = log(r1316929);
        double r1316931 = r1316921 + r1316921;
        double r1316932 = r1316930 * r1316931;
        double r1316933 = exp(r1316932);
        double r1316934 = r1316930 * r1316921;
        double r1316935 = r1316934 - r1316926;
        double r1316936 = exp(r1316935);
        double r1316937 = r1316933 * r1316936;
        double r1316938 = r1316918 ? r1316928 : r1316937;
        return r1316938;
}

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 < 1.04726288994103e-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 17.7

      \[\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 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\]
    4. 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 1.04726288994103e-310 < x.re

    1. Initial program 34.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.8

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

      \[\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\]
    4. Simplified12.1

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

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

      \[\leadsto e^{y.re \cdot \color{blue}{\left(\log \left(\sqrt[3]{x.re} \cdot \sqrt[3]{x.re}\right) + \log \left(\sqrt[3]{x.re}\right)\right)} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\]
    8. Applied distribute-rgt-in12.1

      \[\leadsto e^{\color{blue}{\left(\log \left(\sqrt[3]{x.re} \cdot \sqrt[3]{x.re}\right) \cdot y.re + \log \left(\sqrt[3]{x.re}\right) \cdot y.re\right)} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\]
    9. Applied associate--l+12.1

      \[\leadsto e^{\color{blue}{\log \left(\sqrt[3]{x.re} \cdot \sqrt[3]{x.re}\right) \cdot y.re + \left(\log \left(\sqrt[3]{x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}} \cdot 1\]
    10. Applied exp-sum13.9

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

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

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

Reproduce

herbie shell --seed 2019143 
(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)))))