Average Error: 32.6 → 21.9
Time: 34.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)\]
\[\begin{array}{l} \mathbf{if}\;x.re \le -6.88206465884127 \cdot 10^{-310}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(-x.re\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log x.re\right) \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \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}\;x.re \le -6.88206465884127 \cdot 10^{-310}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(-x.re\right)\right)\\

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

\end{array}
double f(double x_re, double x_im, double y_re, double y_im) {
        double r1400951 = x_re;
        double r1400952 = r1400951 * r1400951;
        double r1400953 = x_im;
        double r1400954 = r1400953 * r1400953;
        double r1400955 = r1400952 + r1400954;
        double r1400956 = sqrt(r1400955);
        double r1400957 = log(r1400956);
        double r1400958 = y_re;
        double r1400959 = r1400957 * r1400958;
        double r1400960 = atan2(r1400953, r1400951);
        double r1400961 = y_im;
        double r1400962 = r1400960 * r1400961;
        double r1400963 = r1400959 - r1400962;
        double r1400964 = exp(r1400963);
        double r1400965 = r1400957 * r1400961;
        double r1400966 = r1400960 * r1400958;
        double r1400967 = r1400965 + r1400966;
        double r1400968 = sin(r1400967);
        double r1400969 = r1400964 * r1400968;
        return r1400969;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r1400970 = x_re;
        double r1400971 = -6.88206465884127e-310;
        bool r1400972 = r1400970 <= r1400971;
        double r1400973 = y_re;
        double r1400974 = r1400970 * r1400970;
        double r1400975 = x_im;
        double r1400976 = r1400975 * r1400975;
        double r1400977 = r1400974 + r1400976;
        double r1400978 = sqrt(r1400977);
        double r1400979 = log(r1400978);
        double r1400980 = r1400973 * r1400979;
        double r1400981 = atan2(r1400975, r1400970);
        double r1400982 = y_im;
        double r1400983 = r1400981 * r1400982;
        double r1400984 = r1400980 - r1400983;
        double r1400985 = exp(r1400984);
        double r1400986 = r1400981 * r1400973;
        double r1400987 = -r1400970;
        double r1400988 = log(r1400987);
        double r1400989 = r1400982 * r1400988;
        double r1400990 = r1400986 + r1400989;
        double r1400991 = sin(r1400990);
        double r1400992 = r1400985 * r1400991;
        double r1400993 = log(r1400970);
        double r1400994 = r1400982 * r1400993;
        double r1400995 = r1400986 + r1400994;
        double r1400996 = sin(r1400995);
        double r1400997 = r1400996 * r1400985;
        double r1400998 = r1400972 ? r1400992 : r1400997;
        return r1400998;
}

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 2 regimes
  2. if x.re < -6.88206465884127e-310

    1. Initial program 31.4

      \[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 20.0

      \[\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. Simplified20.0

      \[\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)\]

    if -6.88206465884127e-310 < x.re

    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. Using strategy rm
    3. Applied insert-posit1641.3

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

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

      \[\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 \color{blue}{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log x.re\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification21.9

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

Reproduce

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