Average Error: 33.5 → 22.5
Time: 12.3s
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.27117767117017284598520649232754447364 \cdot 10^{-309}:\\ \;\;\;\;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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re - y.im \cdot \log \left(\frac{-1}{x.re}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;e^{\log \left({\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\frac{1}{2}}\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 - y.im \cdot \log \left(\frac{1}{x.re}\right)\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.27117767117017284598520649232754447364 \cdot 10^{-309}:\\
\;\;\;\;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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re - y.im \cdot \log \left(\frac{-1}{x.re}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;e^{\log \left({\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\frac{1}{2}}\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 - y.im \cdot \log \left(\frac{1}{x.re}\right)\right)\\

\end{array}
double f(double x_re, double x_im, double y_re, double y_im) {
        double r26545 = x_re;
        double r26546 = r26545 * r26545;
        double r26547 = x_im;
        double r26548 = r26547 * r26547;
        double r26549 = r26546 + r26548;
        double r26550 = sqrt(r26549);
        double r26551 = log(r26550);
        double r26552 = y_re;
        double r26553 = r26551 * r26552;
        double r26554 = atan2(r26547, r26545);
        double r26555 = y_im;
        double r26556 = r26554 * r26555;
        double r26557 = r26553 - r26556;
        double r26558 = exp(r26557);
        double r26559 = r26551 * r26555;
        double r26560 = r26554 * r26552;
        double r26561 = r26559 + r26560;
        double r26562 = sin(r26561);
        double r26563 = r26558 * r26562;
        return r26563;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r26564 = x_re;
        double r26565 = -5.271177671170173e-309;
        bool r26566 = r26564 <= r26565;
        double r26567 = r26564 * r26564;
        double r26568 = x_im;
        double r26569 = r26568 * r26568;
        double r26570 = r26567 + r26569;
        double r26571 = sqrt(r26570);
        double r26572 = log(r26571);
        double r26573 = y_re;
        double r26574 = r26572 * r26573;
        double r26575 = atan2(r26568, r26564);
        double r26576 = y_im;
        double r26577 = r26575 * r26576;
        double r26578 = r26574 - r26577;
        double r26579 = exp(r26578);
        double r26580 = r26575 * r26573;
        double r26581 = -1.0;
        double r26582 = r26581 / r26564;
        double r26583 = log(r26582);
        double r26584 = r26576 * r26583;
        double r26585 = r26580 - r26584;
        double r26586 = sin(r26585);
        double r26587 = r26579 * r26586;
        double r26588 = 0.5;
        double r26589 = pow(r26570, r26588);
        double r26590 = log(r26589);
        double r26591 = r26590 * r26573;
        double r26592 = r26591 - r26577;
        double r26593 = exp(r26592);
        double r26594 = 1.0;
        double r26595 = r26594 / r26564;
        double r26596 = log(r26595);
        double r26597 = r26576 * r26596;
        double r26598 = r26580 - r26597;
        double r26599 = sin(r26598);
        double r26600 = r26593 * r26599;
        double r26601 = r26566 ? r26587 : r26600;
        return r26601;
}

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 < -5.271177671170173e-309

    1. Initial program 32.0

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

    if -5.271177671170173e-309 < x.re

    1. Initial program 35.0

      \[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 pow1/235.0

      \[\leadsto e^{\log \color{blue}{\left({\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\frac{1}{2}}\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)\]
    4. Using strategy rm
    5. Applied add-cbrt-cube41.3

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

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

      \[\leadsto e^{\log \left({\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\frac{1}{2}}\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. Recombined 2 regimes into one program.
  4. Final simplification22.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.re \le -5.27117767117017284598520649232754447364 \cdot 10^{-309}:\\ \;\;\;\;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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re - y.im \cdot \log \left(\frac{-1}{x.re}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;e^{\log \left({\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\frac{1}{2}}\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 - y.im \cdot \log \left(\frac{1}{x.re}\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019318 
(FPCore (x.re x.im y.re y.im)
  :name "powComplex, imaginary part"
  :precision binary64
  (* (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)))))