Average Error: 32.5 → 3.9
Time: 37.7s
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)\]
\[\frac{\left(\sin \left(\log \left(\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)} \cdot \sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right) + \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)\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 \log \left(e^{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)}\right)}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re} - \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 \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)
\frac{\left(\sin \left(\log \left(\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)} \cdot \sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right) + \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)\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 \log \left(e^{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)}\right)}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re} - \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 r1116855 = x_re;
        double r1116856 = r1116855 * r1116855;
        double r1116857 = x_im;
        double r1116858 = r1116857 * r1116857;
        double r1116859 = r1116856 + r1116858;
        double r1116860 = sqrt(r1116859);
        double r1116861 = log(r1116860);
        double r1116862 = y_re;
        double r1116863 = r1116861 * r1116862;
        double r1116864 = atan2(r1116857, r1116855);
        double r1116865 = y_im;
        double r1116866 = r1116864 * r1116865;
        double r1116867 = r1116863 - r1116866;
        double r1116868 = exp(r1116867);
        double r1116869 = r1116861 * r1116865;
        double r1116870 = r1116864 * r1116862;
        double r1116871 = r1116869 + r1116870;
        double r1116872 = sin(r1116871);
        double r1116873 = r1116868 * r1116872;
        return r1116873;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r1116874 = x_re;
        double r1116875 = x_im;
        double r1116876 = hypot(r1116874, r1116875);
        double r1116877 = cbrt(r1116876);
        double r1116878 = log(r1116877);
        double r1116879 = y_im;
        double r1116880 = r1116878 * r1116879;
        double r1116881 = sin(r1116880);
        double r1116882 = r1116877 * r1116877;
        double r1116883 = log(r1116882);
        double r1116884 = r1116883 * r1116879;
        double r1116885 = cos(r1116884);
        double r1116886 = r1116881 * r1116885;
        double r1116887 = sin(r1116884);
        double r1116888 = r1116886 + r1116887;
        double r1116889 = y_re;
        double r1116890 = atan2(r1116875, r1116874);
        double r1116891 = r1116889 * r1116890;
        double r1116892 = cos(r1116891);
        double r1116893 = r1116888 * r1116892;
        double r1116894 = sin(r1116891);
        double r1116895 = log(r1116876);
        double r1116896 = r1116879 * r1116895;
        double r1116897 = cos(r1116896);
        double r1116898 = exp(r1116897);
        double r1116899 = log(r1116898);
        double r1116900 = r1116894 * r1116899;
        double r1116901 = r1116893 + r1116900;
        double r1116902 = r1116879 * r1116890;
        double r1116903 = r1116895 * r1116889;
        double r1116904 = r1116902 - r1116903;
        double r1116905 = exp(r1116904);
        double r1116906 = r1116901 / r1116905;
        return r1116906;
}

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

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

    \[\leadsto \color{blue}{\frac{\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)}{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{\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)}}{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 sin-sum3.4

    \[\leadsto \frac{\color{blue}{\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)}}{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.3

    \[\leadsto \frac{\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)}{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{\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)}{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-rgt-in3.4

    \[\leadsto \frac{\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)}{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 sin-sum3.4

    \[\leadsto \frac{\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)}{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. Taylor expanded around 0 3.9

    \[\leadsto \frac{\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}{1} + \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)}{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)}}\]
  12. Using strategy rm
  13. Applied add-log-exp3.9

    \[\leadsto \frac{\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 1 + \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) + \color{blue}{\log \left(e^{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\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. Final simplification3.9

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

Reproduce

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