Average Error: 31.1 → 11.3
Time: 4.0m
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)\]
\[\begin{array}{l} \mathbf{if}\;y.re \le -6700130532588.583:\\ \;\;\;\;e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \left(\sqrt[3]{\log \left(-x.re\right)} \cdot y.im\right) \cdot \left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{\sqrt[3]{\log \left(-x.re\right)} \cdot \left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{\log \left(-x.re\right)}\right)}\right)\right)\\ \mathbf{elif}\;y.re \le -5.469308494101399 \cdot 10^{-269}:\\ \;\;\;\;e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\left|\sqrt[3]{x.im \cdot x.im + x.re \cdot x.re}\right| \cdot \sqrt{\sqrt[3]{x.im \cdot x.im + x.re \cdot x.re}}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.im \cdot \log \left(-x.re\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \end{array}\]
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)
\begin{array}{l}
\mathbf{if}\;y.re \le -6700130532588.583:\\
\;\;\;\;e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \left(\sqrt[3]{\log \left(-x.re\right)} \cdot y.im\right) \cdot \left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{\sqrt[3]{\log \left(-x.re\right)} \cdot \left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{\log \left(-x.re\right)}\right)}\right)\right)\\

\mathbf{elif}\;y.re \le -5.469308494101399 \cdot 10^{-269}:\\
\;\;\;\;e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\left|\sqrt[3]{x.im \cdot x.im + x.re \cdot x.re}\right| \cdot \sqrt{\sqrt[3]{x.im \cdot x.im + x.re \cdot x.re}}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\

\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.im \cdot \log \left(-x.re\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\

\end{array}
double f(double x_re, double x_im, double y_re, double y_im) {
        double r552936 = x_re;
        double r552937 = r552936 * r552936;
        double r552938 = x_im;
        double r552939 = r552938 * r552938;
        double r552940 = r552937 + r552939;
        double r552941 = sqrt(r552940);
        double r552942 = log(r552941);
        double r552943 = y_re;
        double r552944 = r552942 * r552943;
        double r552945 = atan2(r552938, r552936);
        double r552946 = y_im;
        double r552947 = r552945 * r552946;
        double r552948 = r552944 - r552947;
        double r552949 = exp(r552948);
        double r552950 = r552942 * r552946;
        double r552951 = r552945 * r552943;
        double r552952 = r552950 + r552951;
        double r552953 = sin(r552952);
        double r552954 = r552949 * r552953;
        return r552954;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r552955 = y_re;
        double r552956 = -6700130532588.583;
        bool r552957 = r552955 <= r552956;
        double r552958 = x_im;
        double r552959 = r552958 * r552958;
        double r552960 = x_re;
        double r552961 = r552960 * r552960;
        double r552962 = r552959 + r552961;
        double r552963 = sqrt(r552962);
        double r552964 = log(r552963);
        double r552965 = r552964 * r552955;
        double r552966 = atan2(r552958, r552960);
        double r552967 = y_im;
        double r552968 = r552966 * r552967;
        double r552969 = r552965 - r552968;
        double r552970 = exp(r552969);
        double r552971 = r552966 * r552955;
        double r552972 = -r552960;
        double r552973 = log(r552972);
        double r552974 = cbrt(r552973);
        double r552975 = r552974 * r552967;
        double r552976 = r552974 * r552974;
        double r552977 = r552974 * r552976;
        double r552978 = cbrt(r552977);
        double r552979 = r552974 * r552978;
        double r552980 = r552975 * r552979;
        double r552981 = r552971 + r552980;
        double r552982 = sin(r552981);
        double r552983 = r552970 * r552982;
        double r552984 = -5.469308494101399e-269;
        bool r552985 = r552955 <= r552984;
        double r552986 = cbrt(r552962);
        double r552987 = fabs(r552986);
        double r552988 = sqrt(r552986);
        double r552989 = r552987 * r552988;
        double r552990 = log(r552989);
        double r552991 = r552990 * r552967;
        double r552992 = r552991 + r552971;
        double r552993 = sin(r552992);
        double r552994 = r552970 * r552993;
        double r552995 = r552955 * r552973;
        double r552996 = r552995 - r552968;
        double r552997 = exp(r552996);
        double r552998 = r552967 * r552973;
        double r552999 = r552998 + r552971;
        double r553000 = sin(r552999);
        double r553001 = r552997 * r553000;
        double r553002 = r552985 ? r552994 : r553001;
        double r553003 = r552957 ? r552983 : r553002;
        return r553003;
}

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. Split input into 3 regimes
  2. if y.re < -6700130532588.583

    1. Initial program 36.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. Taylor expanded around -inf 0.1

      \[\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 \sin \left(\log \color{blue}{\left(-1 \cdot x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    3. Simplified0.1

      \[\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 \sin \left(\log \color{blue}{\left(-x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    4. Using strategy rm
    5. Applied add-cube-cbrt0.1

      \[\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 \sin \left(\color{blue}{\left(\left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{\log \left(-x.re\right)}\right) \cdot \sqrt[3]{\log \left(-x.re\right)}\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    6. Applied associate-*l*0.1

      \[\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 \sin \left(\color{blue}{\left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{\log \left(-x.re\right)}\right) \cdot \left(\sqrt[3]{\log \left(-x.re\right)} \cdot y.im\right)} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    7. Using strategy rm
    8. Applied add-cbrt-cube0.1

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

    if -6700130532588.583 < y.re < -5.469308494101399e-269

    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. Using strategy rm
    3. Applied add-cube-cbrt32.5

      \[\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 \sin \left(\log \left(\sqrt{\color{blue}{\left(\sqrt[3]{x.re \cdot x.re + x.im \cdot x.im} \cdot \sqrt[3]{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot \sqrt[3]{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)\]
    4. Applied sqrt-prod32.5

      \[\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 \sin \left(\log \color{blue}{\left(\sqrt{\sqrt[3]{x.re \cdot x.re + x.im \cdot x.im} \cdot \sqrt[3]{x.re \cdot x.re + x.im \cdot x.im}} \cdot \sqrt{\sqrt[3]{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)\]
    5. Simplified32.5

      \[\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 \sin \left(\log \left(\color{blue}{\left|\sqrt[3]{x.re \cdot x.re + x.im \cdot x.im}\right|} \cdot \sqrt{\sqrt[3]{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)\]

    if -5.469308494101399e-269 < y.re

    1. Initial program 24.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. Taylor expanded around -inf 26.8

      \[\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 \sin \left(\log \color{blue}{\left(-1 \cdot x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    3. Simplified26.8

      \[\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 \sin \left(\log \color{blue}{\left(-x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    4. Taylor expanded around -inf 17.2

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

      \[\leadsto e^{\log \color{blue}{\left(-x.re\right)} \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(-x.re\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
  3. Recombined 3 regimes into one program.
  4. Final simplification11.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \le -6700130532588.583:\\ \;\;\;\;e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \left(\sqrt[3]{\log \left(-x.re\right)} \cdot y.im\right) \cdot \left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{\sqrt[3]{\log \left(-x.re\right)} \cdot \left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{\log \left(-x.re\right)}\right)}\right)\right)\\ \mathbf{elif}\;y.re \le -5.469308494101399 \cdot 10^{-269}:\\ \;\;\;\;e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\left|\sqrt[3]{x.im \cdot x.im + x.re \cdot x.re}\right| \cdot \sqrt{\sqrt[3]{x.im \cdot x.im + x.re \cdot x.re}}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.im \cdot \log \left(-x.re\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019104 
(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)))))