Average Error: 33.2 → 4.2
Time: 8.9s
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)\]
\[e^{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\frac{1}{2}} \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\frac{1}{2}}\right) \cdot y.re - \left({\left(\sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}}\right)}^{5} \cdot \sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}}\right) \cdot \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.im\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)
e^{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\frac{1}{2}} \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\frac{1}{2}}\right) \cdot y.re - \left({\left(\sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}}\right)}^{5} \cdot \sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}}\right) \cdot \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.im\right)}
double f(double x_re, double x_im, double y_re, double y_im) {
        double r14017 = x_re;
        double r14018 = r14017 * r14017;
        double r14019 = x_im;
        double r14020 = r14019 * r14019;
        double r14021 = r14018 + r14020;
        double r14022 = sqrt(r14021);
        double r14023 = log(r14022);
        double r14024 = y_re;
        double r14025 = r14023 * r14024;
        double r14026 = atan2(r14019, r14017);
        double r14027 = y_im;
        double r14028 = r14026 * r14027;
        double r14029 = r14025 - r14028;
        double r14030 = exp(r14029);
        double r14031 = r14023 * r14027;
        double r14032 = r14026 * r14024;
        double r14033 = r14031 + r14032;
        double r14034 = cos(r14033);
        double r14035 = r14030 * r14034;
        return r14035;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r14036 = x_re;
        double r14037 = x_im;
        double r14038 = hypot(r14036, r14037);
        double r14039 = 0.5;
        double r14040 = pow(r14038, r14039);
        double r14041 = r14040 * r14040;
        double r14042 = log(r14041);
        double r14043 = y_re;
        double r14044 = r14042 * r14043;
        double r14045 = atan2(r14037, r14036);
        double r14046 = cbrt(r14045);
        double r14047 = cbrt(r14046);
        double r14048 = 5.0;
        double r14049 = pow(r14047, r14048);
        double r14050 = r14049 * r14047;
        double r14051 = y_im;
        double r14052 = r14046 * r14051;
        double r14053 = r14050 * r14052;
        double r14054 = r14044 - r14053;
        double r14055 = exp(r14054);
        return r14055;
}

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.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 19.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. Using strategy rm
  4. Applied add-sqr-sqrt19.9

    \[\leadsto e^{\log \left(\sqrt{\color{blue}{\sqrt{x.re \cdot x.re + x.im \cdot x.im} \cdot \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. Applied sqrt-prod19.9

    \[\leadsto e^{\log \color{blue}{\left(\sqrt{\sqrt{x.re \cdot x.re + x.im \cdot x.im}} \cdot \sqrt{\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\]
  6. Simplified19.9

    \[\leadsto e^{\log \left(\color{blue}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\frac{1}{2}}} \cdot \sqrt{\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\]
  7. Simplified4.2

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

    \[\leadsto e^{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\frac{1}{2}} \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\frac{1}{2}}\right) \cdot y.re - \color{blue}{\left(\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}\right) \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}\right)} \cdot y.im} \cdot 1\]
  10. Applied associate-*l*4.2

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

    \[\leadsto e^{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\frac{1}{2}} \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\frac{1}{2}}\right) \cdot y.re - \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \color{blue}{\left(\left(\sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}}\right) \cdot \sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}}\right)}\right) \cdot \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.im\right)} \cdot 1\]
  13. Applied associate-*r*4.2

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

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

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

Reproduce

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