Average Error: 33.8 → 3.6
Time: 27.6s
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 \sin \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(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \left(\left(\sqrt[3]{\sqrt[3]{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \left(\sqrt[3]{\sqrt[3]{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \sqrt[3]{\sqrt[3]{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\right)\right) \cdot \left(\sqrt[3]{\sqrt[3]{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \left(\sqrt[3]{\sqrt[3]{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \sqrt[3]{\sqrt[3]{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\right)\right)\right) \cdot \left(\sqrt[3]{\sqrt[3]{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \left(\sqrt[3]{\sqrt[3]{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \sqrt[3]{\sqrt[3]{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\right)\right)} \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\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 \sin \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(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \left(\left(\sqrt[3]{\sqrt[3]{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \left(\sqrt[3]{\sqrt[3]{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \sqrt[3]{\sqrt[3]{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\right)\right) \cdot \left(\sqrt[3]{\sqrt[3]{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \left(\sqrt[3]{\sqrt[3]{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \sqrt[3]{\sqrt[3]{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\right)\right)\right) \cdot \left(\sqrt[3]{\sqrt[3]{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \left(\sqrt[3]{\sqrt[3]{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \sqrt[3]{\sqrt[3]{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\right)\right)} \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
double f(double x_re, double x_im, double y_re, double y_im) {
        double r1185289 = x_re;
        double r1185290 = r1185289 * r1185289;
        double r1185291 = x_im;
        double r1185292 = r1185291 * r1185291;
        double r1185293 = r1185290 + r1185292;
        double r1185294 = sqrt(r1185293);
        double r1185295 = log(r1185294);
        double r1185296 = y_re;
        double r1185297 = r1185295 * r1185296;
        double r1185298 = atan2(r1185291, r1185289);
        double r1185299 = y_im;
        double r1185300 = r1185298 * r1185299;
        double r1185301 = r1185297 - r1185300;
        double r1185302 = exp(r1185301);
        double r1185303 = r1185295 * r1185299;
        double r1185304 = r1185298 * r1185296;
        double r1185305 = r1185303 + r1185304;
        double r1185306 = sin(r1185305);
        double r1185307 = r1185302 * r1185306;
        return r1185307;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r1185308 = x_re;
        double r1185309 = x_im;
        double r1185310 = hypot(r1185308, r1185309);
        double r1185311 = log(r1185310);
        double r1185312 = y_re;
        double r1185313 = r1185311 * r1185312;
        double r1185314 = y_im;
        double r1185315 = atan2(r1185309, r1185308);
        double r1185316 = r1185314 * r1185315;
        double r1185317 = cbrt(r1185316);
        double r1185318 = cbrt(r1185317);
        double r1185319 = r1185318 * r1185318;
        double r1185320 = r1185318 * r1185319;
        double r1185321 = r1185320 * r1185320;
        double r1185322 = r1185321 * r1185320;
        double r1185323 = r1185313 - r1185322;
        double r1185324 = exp(r1185323);
        double r1185325 = r1185312 * r1185315;
        double r1185326 = fma(r1185314, r1185311, r1185325);
        double r1185327 = sin(r1185326);
        double r1185328 = r1185324 * r1185327;
        return r1185328;
}

Error

Bits error versus x.re

Bits error versus x.im

Bits error versus y.re

Bits error versus y.im

Derivation

  1. Initial program 33.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 \sin \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. Simplified3.6

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

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

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

    \[\leadsto e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) - \left(\left(\left(\sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot \sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\right) \cdot \sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\right) \cdot \color{blue}{\left(\left(\sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot \sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\right) \cdot \sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\right)}\right) \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\]
  9. Using strategy rm
  10. Applied add-cube-cbrt3.6

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

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

Reproduce

herbie shell --seed 2019192 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
  :name "powComplex, imaginary part"
  (* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))