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

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

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

\end{array}
double f(double x_re, double x_im, double y_re, double y_im) {
        double r1351651 = x_re;
        double r1351652 = r1351651 * r1351651;
        double r1351653 = x_im;
        double r1351654 = r1351653 * r1351653;
        double r1351655 = r1351652 + r1351654;
        double r1351656 = sqrt(r1351655);
        double r1351657 = log(r1351656);
        double r1351658 = y_re;
        double r1351659 = r1351657 * r1351658;
        double r1351660 = atan2(r1351653, r1351651);
        double r1351661 = y_im;
        double r1351662 = r1351660 * r1351661;
        double r1351663 = r1351659 - r1351662;
        double r1351664 = exp(r1351663);
        double r1351665 = r1351657 * r1351661;
        double r1351666 = r1351660 * r1351658;
        double r1351667 = r1351665 + r1351666;
        double r1351668 = sin(r1351667);
        double r1351669 = r1351664 * r1351668;
        return r1351669;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r1351670 = x_re;
        double r1351671 = -5.4708088011940997e-216;
        bool r1351672 = r1351670 <= r1351671;
        double r1351673 = -r1351670;
        double r1351674 = log(r1351673);
        double r1351675 = y_re;
        double r1351676 = r1351674 * r1351675;
        double r1351677 = y_im;
        double r1351678 = x_im;
        double r1351679 = atan2(r1351678, r1351670);
        double r1351680 = r1351677 * r1351679;
        double r1351681 = r1351676 - r1351680;
        double r1351682 = exp(r1351681);
        double r1351683 = r1351674 * r1351677;
        double r1351684 = r1351679 * r1351675;
        double r1351685 = r1351683 + r1351684;
        double r1351686 = sin(r1351685);
        double r1351687 = r1351682 * r1351686;
        double r1351688 = 3.1386120183459e-310;
        bool r1351689 = r1351670 <= r1351688;
        double r1351690 = r1351670 * r1351670;
        double r1351691 = r1351678 * r1351678;
        double r1351692 = r1351690 + r1351691;
        double r1351693 = sqrt(r1351692);
        double r1351694 = log(r1351693);
        double r1351695 = r1351694 * r1351675;
        double r1351696 = r1351695 - r1351680;
        double r1351697 = exp(r1351696);
        double r1351698 = r1351686 * r1351697;
        double r1351699 = log(r1351670);
        double r1351700 = r1351699 * r1351677;
        double r1351701 = r1351684 + r1351700;
        double r1351702 = sin(r1351701);
        double r1351703 = r1351697 * r1351702;
        double r1351704 = r1351689 ? r1351698 : r1351703;
        double r1351705 = r1351672 ? r1351687 : r1351704;
        return r1351705;
}

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 x.re < -5.4708088011940997e-216

    1. Initial program 32.1

      \[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.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. Simplified20.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 9.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. Simplified9.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)\]

    if -5.4708088011940997e-216 < x.re < 3.1386120183459e-310

    1. Initial program 33.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 25.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. Simplified25.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)\]

    if 3.1386120183459e-310 < x.re

    1. Initial program 35.3

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

      \[\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)}\]
    3. Simplified24.9

      \[\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 3 regimes into one program.
  4. Final simplification18.4

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

Reproduce

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