Average Error: 32.5 → 22.2
Time: 33.0s
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 -1.39623527537587 \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 -1.39623527537587 \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 r1421484 = x_re;
        double r1421485 = r1421484 * r1421484;
        double r1421486 = x_im;
        double r1421487 = r1421486 * r1421486;
        double r1421488 = r1421485 + r1421487;
        double r1421489 = sqrt(r1421488);
        double r1421490 = log(r1421489);
        double r1421491 = y_re;
        double r1421492 = r1421490 * r1421491;
        double r1421493 = atan2(r1421486, r1421484);
        double r1421494 = y_im;
        double r1421495 = r1421493 * r1421494;
        double r1421496 = r1421492 - r1421495;
        double r1421497 = exp(r1421496);
        double r1421498 = r1421490 * r1421494;
        double r1421499 = r1421493 * r1421491;
        double r1421500 = r1421498 + r1421499;
        double r1421501 = sin(r1421500);
        double r1421502 = r1421497 * r1421501;
        return r1421502;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r1421503 = x_re;
        double r1421504 = -1.39623527537587e-310;
        bool r1421505 = r1421503 <= r1421504;
        double r1421506 = y_re;
        double r1421507 = r1421503 * r1421503;
        double r1421508 = x_im;
        double r1421509 = r1421508 * r1421508;
        double r1421510 = r1421507 + r1421509;
        double r1421511 = sqrt(r1421510);
        double r1421512 = log(r1421511);
        double r1421513 = r1421506 * r1421512;
        double r1421514 = atan2(r1421508, r1421503);
        double r1421515 = y_im;
        double r1421516 = r1421514 * r1421515;
        double r1421517 = r1421513 - r1421516;
        double r1421518 = exp(r1421517);
        double r1421519 = r1421514 * r1421506;
        double r1421520 = -r1421503;
        double r1421521 = log(r1421520);
        double r1421522 = r1421515 * r1421521;
        double r1421523 = r1421519 + r1421522;
        double r1421524 = sin(r1421523);
        double r1421525 = r1421518 * r1421524;
        double r1421526 = log(r1421503);
        double r1421527 = r1421515 * r1421526;
        double r1421528 = r1421519 + r1421527;
        double r1421529 = sin(r1421528);
        double r1421530 = r1421529 * r1421518;
        double r1421531 = r1421505 ? r1421525 : r1421530;
        return r1421531;
}

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 < -1.39623527537587e-310

    1. Initial program 31.9

      \[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 \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. Simplified21.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 -1.39623527537587e-310 < x.re

    1. Initial program 33.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 23.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}{x.re} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
  3. Recombined 2 regimes into one program.
  4. Final simplification22.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.re \le -1.39623527537587 \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 2019158 
(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)))))