Average Error: 32.8 → 4.5
Time: 8.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({\left(e^{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}\right)}^{\left({\left(\sqrt[3]{e^{-y.im}} \cdot \sqrt[3]{e^{-y.im}}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)}\right)}^{\left({\left(\sqrt[3]{e^{-y.im}}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}\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({\left(e^{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}\right)}^{\left({\left(\sqrt[3]{e^{-y.im}} \cdot \sqrt[3]{e^{-y.im}}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)}\right)}^{\left({\left(\sqrt[3]{e^{-y.im}}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)}\right)
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	return ((double) (((double) exp(((double) (((double) (((double) log(((double) sqrt(((double) (((double) (x_46_re * x_46_re)) + ((double) (x_46_im * x_46_im)))))))) * y_46_re)) - ((double) (((double) atan2(x_46_im, x_46_re)) * y_46_im)))))) * ((double) cos(((double) (((double) (((double) log(((double) sqrt(((double) (((double) (x_46_re * x_46_re)) + ((double) (x_46_im * x_46_im)))))))) * y_46_im)) + ((double) (((double) atan2(x_46_im, x_46_re)) * y_46_re))))))));
}
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	return ((double) log(((double) pow(((double) pow(((double) exp(((double) pow(((double) hypot(x_46_re, x_46_im)), y_46_re)))), ((double) pow(((double) (((double) cbrt(((double) exp(((double) -(y_46_im)))))) * ((double) cbrt(((double) exp(((double) -(y_46_im)))))))), ((double) atan2(x_46_im, x_46_re)))))), ((double) pow(((double) cbrt(((double) exp(((double) -(y_46_im)))))), ((double) atan2(x_46_im, x_46_re))))))));
}

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.8

    \[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.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-log-exp19.1

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

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

    \[\leadsto \log \left({\left(e^{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}\right)}^{\left(e^{-\color{blue}{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\right)}\right) \cdot 1\]
  8. Applied distribute-lft-neg-in4.3

    \[\leadsto \log \left({\left(e^{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}\right)}^{\left(e^{\color{blue}{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\right)}\right) \cdot 1\]
  9. Applied exp-prod4.5

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

    \[\leadsto \log \left({\left(e^{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}\right)}^{\left({\color{blue}{\left(\left(\sqrt[3]{e^{-y.im}} \cdot \sqrt[3]{e^{-y.im}}\right) \cdot \sqrt[3]{e^{-y.im}}\right)}}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)}\right) \cdot 1\]
  12. Applied unpow-prod-down4.5

    \[\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^{-y.im}} \cdot \sqrt[3]{e^{-y.im}}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot {\left(\sqrt[3]{e^{-y.im}}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)}}\right) \cdot 1\]
  13. Applied pow-unpow4.5

    \[\leadsto \log \color{blue}{\left({\left({\left(e^{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}\right)}^{\left({\left(\sqrt[3]{e^{-y.im}} \cdot \sqrt[3]{e^{-y.im}}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)}\right)}^{\left({\left(\sqrt[3]{e^{-y.im}}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)}\right)} \cdot 1\]
  14. Final simplification4.5

    \[\leadsto \log \left({\left({\left(e^{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}\right)}^{\left({\left(\sqrt[3]{e^{-y.im}} \cdot \sqrt[3]{e^{-y.im}}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)}\right)}^{\left({\left(\sqrt[3]{e^{-y.im}}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)}\right)\]

Reproduce

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