Average Error: 32.2 → 3.5
Time: 32.4s
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)\]
\[\frac{\left(\cos \left(\log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right) \cdot \cos \left(y.im \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right) - \sin \left(y.im \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right) \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt[3]{\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}}\right)\right) \cdot \cos \left(y.im \cdot \log \left(\sqrt[3]{\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}}\right)\right) + \sin \left(y.im \cdot \log \left(\sqrt[3]{\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}}\right)\right) \cdot \cos \left(y.im \cdot \log \left(\sqrt[3]{\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}}\right)\right)\right)\right) \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) - \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right) \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im - \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re}}\]
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)
\frac{\left(\cos \left(\log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right) \cdot \cos \left(y.im \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right) - \sin \left(y.im \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right) \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt[3]{\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}}\right)\right) \cdot \cos \left(y.im \cdot \log \left(\sqrt[3]{\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}}\right)\right) + \sin \left(y.im \cdot \log \left(\sqrt[3]{\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}}\right)\right) \cdot \cos \left(y.im \cdot \log \left(\sqrt[3]{\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}}\right)\right)\right)\right) \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) - \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right) \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im - \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re}}
double f(double x_re, double x_im, double y_re, double y_im) {
        double r1200578 = x_re;
        double r1200579 = r1200578 * r1200578;
        double r1200580 = x_im;
        double r1200581 = r1200580 * r1200580;
        double r1200582 = r1200579 + r1200581;
        double r1200583 = sqrt(r1200582);
        double r1200584 = log(r1200583);
        double r1200585 = y_re;
        double r1200586 = r1200584 * r1200585;
        double r1200587 = atan2(r1200580, r1200578);
        double r1200588 = y_im;
        double r1200589 = r1200587 * r1200588;
        double r1200590 = r1200586 - r1200589;
        double r1200591 = exp(r1200590);
        double r1200592 = r1200584 * r1200588;
        double r1200593 = r1200587 * r1200585;
        double r1200594 = r1200592 + r1200593;
        double r1200595 = cos(r1200594);
        double r1200596 = r1200591 * r1200595;
        return r1200596;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r1200597 = x_re;
        double r1200598 = x_im;
        double r1200599 = hypot(r1200597, r1200598);
        double r1200600 = cbrt(r1200599);
        double r1200601 = log(r1200600);
        double r1200602 = y_im;
        double r1200603 = r1200601 * r1200602;
        double r1200604 = cos(r1200603);
        double r1200605 = r1200600 * r1200600;
        double r1200606 = log(r1200605);
        double r1200607 = r1200602 * r1200606;
        double r1200608 = cos(r1200607);
        double r1200609 = r1200604 * r1200608;
        double r1200610 = sin(r1200607);
        double r1200611 = cbrt(r1200600);
        double r1200612 = log(r1200611);
        double r1200613 = r1200602 * r1200612;
        double r1200614 = sin(r1200613);
        double r1200615 = r1200611 * r1200611;
        double r1200616 = log(r1200615);
        double r1200617 = r1200602 * r1200616;
        double r1200618 = cos(r1200617);
        double r1200619 = r1200614 * r1200618;
        double r1200620 = sin(r1200617);
        double r1200621 = cos(r1200613);
        double r1200622 = r1200620 * r1200621;
        double r1200623 = r1200619 + r1200622;
        double r1200624 = r1200610 * r1200623;
        double r1200625 = r1200609 - r1200624;
        double r1200626 = y_re;
        double r1200627 = atan2(r1200598, r1200597);
        double r1200628 = r1200626 * r1200627;
        double r1200629 = cos(r1200628);
        double r1200630 = r1200625 * r1200629;
        double r1200631 = log(r1200599);
        double r1200632 = r1200602 * r1200631;
        double r1200633 = sin(r1200632);
        double r1200634 = sin(r1200628);
        double r1200635 = r1200633 * r1200634;
        double r1200636 = r1200630 - r1200635;
        double r1200637 = r1200627 * r1200602;
        double r1200638 = r1200631 * r1200626;
        double r1200639 = r1200637 - r1200638;
        double r1200640 = exp(r1200639);
        double r1200641 = r1200636 / r1200640;
        return r1200641;
}

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.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. Simplified3.4

    \[\leadsto \color{blue}{\frac{\cos \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)}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im - y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}}}\]
  3. Using strategy rm
  4. Applied fma-udef3.4

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

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

    \[\leadsto \frac{\cos \left(y.im \cdot \log \color{blue}{\left(\left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot \sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)}\right) \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) - \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right) \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im - y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}}\]
  8. Applied log-prod3.4

    \[\leadsto \frac{\cos \left(y.im \cdot \color{blue}{\left(\log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right) + \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)}\right) \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) - \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right) \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im - y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}}\]
  9. Applied distribute-lft-in3.4

    \[\leadsto \frac{\cos \color{blue}{\left(y.im \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right) + y.im \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) - \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right) \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im - y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}}\]
  10. Applied cos-sum3.4

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

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

    \[\leadsto \frac{\left(\cos \left(y.im \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right) \cdot \cos \left(y.im \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right) - \sin \left(y.im \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right) \cdot \sin \left(y.im \cdot \color{blue}{\left(\log \left(\sqrt[3]{\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}}\right) + \log \left(\sqrt[3]{\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}}\right)\right)}\right)\right) \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) - \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right) \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im - y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}}\]
  14. Applied distribute-rgt-in3.4

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

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

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

Reproduce

herbie shell --seed 2019162 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
  :name "powComplex, real part"
  (* (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)))))