Average Error: 33.2 → 3.4
Time: 30.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 \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)\]
\[\left(\left(\sin \left(y.im \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right) \cdot \left(\sqrt[3]{\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 \left(\sqrt[3]{\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 \sqrt[3]{\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)}\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(\sqrt[3]{\cos \left(y.im \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)} \cdot \left(\sqrt[3]{\cos \left(y.im \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)} \cdot \sqrt[3]{\cos \left(y.im \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)}\right)\right)\right) \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\right) \cdot e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.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 \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)
\left(\left(\sin \left(y.im \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right) \cdot \left(\sqrt[3]{\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 \left(\sqrt[3]{\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 \sqrt[3]{\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)}\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(\sqrt[3]{\cos \left(y.im \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)} \cdot \left(\sqrt[3]{\cos \left(y.im \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)} \cdot \sqrt[3]{\cos \left(y.im \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)}\right)\right)\right) \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\right) \cdot e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}
double f(double x_re, double x_im, double y_re, double y_im) {
        double r1117804 = x_re;
        double r1117805 = r1117804 * r1117804;
        double r1117806 = x_im;
        double r1117807 = r1117806 * r1117806;
        double r1117808 = r1117805 + r1117807;
        double r1117809 = sqrt(r1117808);
        double r1117810 = log(r1117809);
        double r1117811 = y_re;
        double r1117812 = r1117810 * r1117811;
        double r1117813 = atan2(r1117806, r1117804);
        double r1117814 = y_im;
        double r1117815 = r1117813 * r1117814;
        double r1117816 = r1117812 - r1117815;
        double r1117817 = exp(r1117816);
        double r1117818 = r1117810 * r1117814;
        double r1117819 = r1117813 * r1117811;
        double r1117820 = r1117818 + r1117819;
        double r1117821 = sin(r1117820);
        double r1117822 = r1117817 * r1117821;
        return r1117822;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r1117823 = y_im;
        double r1117824 = x_re;
        double r1117825 = x_im;
        double r1117826 = hypot(r1117824, r1117825);
        double r1117827 = cbrt(r1117826);
        double r1117828 = log(r1117827);
        double r1117829 = r1117823 * r1117828;
        double r1117830 = sin(r1117829);
        double r1117831 = r1117827 * r1117827;
        double r1117832 = log(r1117831);
        double r1117833 = r1117823 * r1117832;
        double r1117834 = cos(r1117833);
        double r1117835 = cbrt(r1117834);
        double r1117836 = r1117835 * r1117835;
        double r1117837 = r1117835 * r1117836;
        double r1117838 = r1117830 * r1117837;
        double r1117839 = sin(r1117833);
        double r1117840 = cos(r1117829);
        double r1117841 = cbrt(r1117840);
        double r1117842 = r1117841 * r1117841;
        double r1117843 = r1117841 * r1117842;
        double r1117844 = r1117839 * r1117843;
        double r1117845 = r1117838 + r1117844;
        double r1117846 = y_re;
        double r1117847 = atan2(r1117825, r1117824);
        double r1117848 = r1117846 * r1117847;
        double r1117849 = cos(r1117848);
        double r1117850 = r1117845 * r1117849;
        double r1117851 = sin(r1117848);
        double r1117852 = log(r1117826);
        double r1117853 = r1117823 * r1117852;
        double r1117854 = cos(r1117853);
        double r1117855 = r1117851 * r1117854;
        double r1117856 = r1117850 + r1117855;
        double r1117857 = r1117852 * r1117846;
        double r1117858 = r1117823 * r1117847;
        double r1117859 = r1117857 - r1117858;
        double r1117860 = exp(r1117859);
        double r1117861 = r1117856 * r1117860;
        return r1117861;
}

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

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

    \[\leadsto 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 \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)}\]
  5. Applied sin-sum3.4

    \[\leadsto 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 \color{blue}{\left(\sin \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) + \cos \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)\right)}\]
  6. Using strategy rm
  7. Applied add-cube-cbrt3.4

    \[\leadsto 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 \left(\sin \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) + \cos \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)\right)\]
  8. Applied log-prod3.4

    \[\leadsto 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 \left(\sin \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) + \cos \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)\right)\]
  9. Applied distribute-rgt-in3.4

    \[\leadsto 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 \left(\sin \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) \cdot y.im + \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right)} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) + \cos \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)\right)\]
  10. Applied sin-sum3.4

    \[\leadsto 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 \left(\color{blue}{\left(\sin \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) \cdot y.im\right) \cdot \cos \left(\log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right) + \cos \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) \cdot y.im\right) \cdot \sin \left(\log \left(\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) + \cos \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)\right)\]
  11. Using strategy rm
  12. Applied add-cube-cbrt3.4

    \[\leadsto 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 \left(\left(\sin \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) \cdot y.im\right) \cdot \cos \left(\log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right) + \color{blue}{\left(\left(\sqrt[3]{\cos \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) \cdot y.im\right)} \cdot \sqrt[3]{\cos \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) \cdot y.im\right)}\right) \cdot \sqrt[3]{\cos \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) \cdot y.im\right)}\right)} \cdot \sin \left(\log \left(\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) + \cos \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)\right)\]
  13. Using strategy rm
  14. Applied add-cube-cbrt3.4

    \[\leadsto 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 \left(\left(\sin \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) \cdot y.im\right) \cdot \color{blue}{\left(\left(\sqrt[3]{\cos \left(\log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right)} \cdot \sqrt[3]{\cos \left(\log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right)}\right) \cdot \sqrt[3]{\cos \left(\log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right)}\right)} + \left(\left(\sqrt[3]{\cos \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) \cdot y.im\right)} \cdot \sqrt[3]{\cos \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) \cdot y.im\right)}\right) \cdot \sqrt[3]{\cos \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) \cdot y.im\right)}\right) \cdot \sin \left(\log \left(\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) + \cos \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)\right)\]
  15. Final simplification3.4

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

Reproduce

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