Average Error: 32.9 → 4.0
Time: 7.1s
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)\]
\[\log \left({\left(e^{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}\right)}^{\left(\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}}\right)}\right)\]
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)
\log \left({\left(e^{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}\right)}^{\left(\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}}\right)}\right)
double f(double x_re, double x_im, double y_re, double y_im) {
        double r12082 = x_re;
        double r12083 = r12082 * r12082;
        double r12084 = x_im;
        double r12085 = r12084 * r12084;
        double r12086 = r12083 + r12085;
        double r12087 = sqrt(r12086);
        double r12088 = log(r12087);
        double r12089 = y_re;
        double r12090 = r12088 * r12089;
        double r12091 = atan2(r12084, r12082);
        double r12092 = y_im;
        double r12093 = r12091 * r12092;
        double r12094 = r12090 - r12093;
        double r12095 = exp(r12094);
        double r12096 = r12088 * r12092;
        double r12097 = r12091 * r12089;
        double r12098 = r12096 + r12097;
        double r12099 = cos(r12098);
        double r12100 = r12095 * r12099;
        return r12100;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r12101 = x_re;
        double r12102 = x_im;
        double r12103 = hypot(r12101, r12102);
        double r12104 = y_re;
        double r12105 = pow(r12103, r12104);
        double r12106 = exp(r12105);
        double r12107 = atan2(r12102, r12101);
        double r12108 = y_im;
        double r12109 = r12107 * r12108;
        double r12110 = -r12109;
        double r12111 = exp(r12110);
        double r12112 = cbrt(r12111);
        double r12113 = r12112 * r12112;
        double r12114 = r12113 * r12112;
        double r12115 = pow(r12106, r12114);
        double r12116 = log(r12115);
        return r12116;
}

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. Initial program 32.9

    \[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 19.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. Using strategy rm
  4. Applied add-log-exp19.7

    \[\leadsto \color{blue}{\log \left(e^{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 1\]
  5. Simplified4.0

    \[\leadsto \log \color{blue}{\left({\left(e^{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}\right)}^{\left(e^{-\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right)}\right)} \cdot 1\]
  6. Using strategy rm
  7. Applied add-cube-cbrt4.0

    \[\leadsto \log \left({\left(e^{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}\right)}^{\color{blue}{\left(\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}}\right)}}\right) \cdot 1\]
  8. Final simplification4.0

    \[\leadsto \log \left({\left(e^{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}\right)}^{\left(\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}}\right)}\right)\]

Reproduce

herbie shell --seed 2019347 +o rules:numerics
(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)))))