Average Error: 33.3 → 5.2
Time: 8.8s
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)\]
\[2 \cdot \log \left(\sqrt{\sqrt[3]{{\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)}}} \cdot \sqrt{\sqrt[3]{{\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) + \log \left(\sqrt[3]{{\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)\]
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 \cdot \log \left(\sqrt{\sqrt[3]{{\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)}}} \cdot \sqrt{\sqrt[3]{{\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) + \log \left(\sqrt[3]{{\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)
double f(double x_re, double x_im, double y_re, double y_im) {
        double r15100 = x_re;
        double r15101 = r15100 * r15100;
        double r15102 = x_im;
        double r15103 = r15102 * r15102;
        double r15104 = r15101 + r15103;
        double r15105 = sqrt(r15104);
        double r15106 = log(r15105);
        double r15107 = y_re;
        double r15108 = r15106 * r15107;
        double r15109 = atan2(r15102, r15100);
        double r15110 = y_im;
        double r15111 = r15109 * r15110;
        double r15112 = r15108 - r15111;
        double r15113 = exp(r15112);
        double r15114 = r15106 * r15110;
        double r15115 = r15109 * r15107;
        double r15116 = r15114 + r15115;
        double r15117 = cos(r15116);
        double r15118 = r15113 * r15117;
        return r15118;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r15119 = 2.0;
        double r15120 = x_re;
        double r15121 = x_im;
        double r15122 = hypot(r15120, r15121);
        double r15123 = y_re;
        double r15124 = pow(r15122, r15123);
        double r15125 = exp(r15124);
        double r15126 = atan2(r15121, r15120);
        double r15127 = y_im;
        double r15128 = r15126 * r15127;
        double r15129 = -r15128;
        double r15130 = exp(r15129);
        double r15131 = pow(r15125, r15130);
        double r15132 = cbrt(r15131);
        double r15133 = sqrt(r15132);
        double r15134 = r15133 * r15133;
        double r15135 = log(r15134);
        double r15136 = r15119 * r15135;
        double r15137 = log(r15132);
        double r15138 = r15136 + r15137;
        return r15138;
}

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 33.3

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

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

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

    \[\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-cbrt5.3

    \[\leadsto \log \color{blue}{\left(\left(\sqrt[3]{{\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)}} \cdot \sqrt[3]{{\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 \sqrt[3]{{\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\]
  8. Applied log-prod5.3

    \[\leadsto \color{blue}{\left(\log \left(\sqrt[3]{{\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)}} \cdot \sqrt[3]{{\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) + \log \left(\sqrt[3]{{\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)\right)} \cdot 1\]
  9. Simplified5.3

    \[\leadsto \left(\color{blue}{2 \cdot \log \left(\sqrt[3]{{\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)} + \log \left(\sqrt[3]{{\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)\right) \cdot 1\]
  10. Using strategy rm
  11. Applied add-sqr-sqrt5.2

    \[\leadsto \left(2 \cdot \log \color{blue}{\left(\sqrt{\sqrt[3]{{\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)}}} \cdot \sqrt{\sqrt[3]{{\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)} + \log \left(\sqrt[3]{{\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)\right) \cdot 1\]
  12. Final simplification5.2

    \[\leadsto 2 \cdot \log \left(\sqrt{\sqrt[3]{{\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)}}} \cdot \sqrt{\sqrt[3]{{\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) + \log \left(\sqrt[3]{{\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)\]

Reproduce

herbie shell --seed 2020100 +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)))))