Average Error: 33.1 → 3.8
Time: 7.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)\]
\[\left(\sqrt[3]{\mathsf{log1p}\left(\mathsf{expm1}\left(e^{{\left(y.re \cdot \left(1 \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\right)}^{1} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right)\right)} \cdot \sqrt[3]{\mathsf{log1p}\left(\mathsf{expm1}\left(e^{{\left(y.re \cdot \left(1 \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\right)}^{1} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right)\right)}\right) \cdot \sqrt[3]{\mathsf{log1p}\left(\mathsf{expm1}\left(e^{{\left(y.re \cdot \left(1 \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\right)}^{1} - \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)
\left(\sqrt[3]{\mathsf{log1p}\left(\mathsf{expm1}\left(e^{{\left(y.re \cdot \left(1 \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\right)}^{1} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right)\right)} \cdot \sqrt[3]{\mathsf{log1p}\left(\mathsf{expm1}\left(e^{{\left(y.re \cdot \left(1 \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\right)}^{1} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right)\right)}\right) \cdot \sqrt[3]{\mathsf{log1p}\left(\mathsf{expm1}\left(e^{{\left(y.re \cdot \left(1 \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\right)}^{1} - \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 r14288 = x_re;
        double r14289 = r14288 * r14288;
        double r14290 = x_im;
        double r14291 = r14290 * r14290;
        double r14292 = r14289 + r14291;
        double r14293 = sqrt(r14292);
        double r14294 = log(r14293);
        double r14295 = y_re;
        double r14296 = r14294 * r14295;
        double r14297 = atan2(r14290, r14288);
        double r14298 = y_im;
        double r14299 = r14297 * r14298;
        double r14300 = r14296 - r14299;
        double r14301 = exp(r14300);
        double r14302 = r14294 * r14298;
        double r14303 = r14297 * r14295;
        double r14304 = r14302 + r14303;
        double r14305 = cos(r14304);
        double r14306 = r14301 * r14305;
        return r14306;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r14307 = y_re;
        double r14308 = 1.0;
        double r14309 = x_re;
        double r14310 = x_im;
        double r14311 = hypot(r14309, r14310);
        double r14312 = log(r14311);
        double r14313 = r14308 * r14312;
        double r14314 = r14307 * r14313;
        double r14315 = pow(r14314, r14308);
        double r14316 = atan2(r14310, r14309);
        double r14317 = y_im;
        double r14318 = r14316 * r14317;
        double r14319 = r14315 - r14318;
        double r14320 = exp(r14319);
        double r14321 = expm1(r14320);
        double r14322 = log1p(r14321);
        double r14323 = cbrt(r14322);
        double r14324 = r14323 * r14323;
        double r14325 = r14324 * r14323;
        return r14325;
}

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

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

    \[\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 pow119.4

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

    \[\leadsto e^{\color{blue}{{\left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\right)}^{1}} \cdot {y.re}^{1} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\]
  6. Applied pow-prod-down19.4

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

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

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

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

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

Reproduce

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