Average Error: 33.5 → 18.7
Time: 34.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 6.491700755562396959330084849596640570741 \cdot 10^{-311}:\\ \;\;\;\;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{elif}\;x.re \le 3.311854826363890934372578038946963601694 \cdot 10^{-168}:\\ \;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log x.re\right) \cdot e^{\log x.re \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{elif}\;x.re \le 6.385759705628923576207076949625877094635 \cdot 10^{-120}:\\ \;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(\sqrt[3]{\sqrt{x.re \cdot x.re + x.im \cdot x.im}} \cdot \left(\sqrt[3]{\sqrt{x.re \cdot x.re + x.im \cdot x.im}} \cdot \sqrt[3]{\sqrt{x.re \cdot x.re + x.im \cdot x.im}}\right)\right)\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}\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log x.re\right) \cdot e^{\log x.re \cdot y.re - \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.491700755562396959330084849596640570741 \cdot 10^{-311}:\\
\;\;\;\;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{elif}\;x.re \le 3.311854826363890934372578038946963601694 \cdot 10^{-168}:\\
\;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log x.re\right) \cdot e^{\log x.re \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\

\mathbf{elif}\;x.re \le 6.385759705628923576207076949625877094635 \cdot 10^{-120}:\\
\;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(\sqrt[3]{\sqrt{x.re \cdot x.re + x.im \cdot x.im}} \cdot \left(\sqrt[3]{\sqrt{x.re \cdot x.re + x.im \cdot x.im}} \cdot \sqrt[3]{\sqrt{x.re \cdot x.re + x.im \cdot x.im}}\right)\right)\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}\\

\mathbf{else}:\\
\;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log x.re\right) \cdot e^{\log x.re \cdot y.re - \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 r1363383 = x_re;
        double r1363384 = r1363383 * r1363383;
        double r1363385 = x_im;
        double r1363386 = r1363385 * r1363385;
        double r1363387 = r1363384 + r1363386;
        double r1363388 = sqrt(r1363387);
        double r1363389 = log(r1363388);
        double r1363390 = y_re;
        double r1363391 = r1363389 * r1363390;
        double r1363392 = atan2(r1363385, r1363383);
        double r1363393 = y_im;
        double r1363394 = r1363392 * r1363393;
        double r1363395 = r1363391 - r1363394;
        double r1363396 = exp(r1363395);
        double r1363397 = r1363389 * r1363393;
        double r1363398 = r1363392 * r1363390;
        double r1363399 = r1363397 + r1363398;
        double r1363400 = sin(r1363399);
        double r1363401 = r1363396 * r1363400;
        return r1363401;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r1363402 = x_re;
        double r1363403 = 6.4917007555624e-311;
        bool r1363404 = r1363402 <= r1363403;
        double r1363405 = y_re;
        double r1363406 = r1363402 * r1363402;
        double r1363407 = x_im;
        double r1363408 = r1363407 * r1363407;
        double r1363409 = r1363406 + r1363408;
        double r1363410 = sqrt(r1363409);
        double r1363411 = log(r1363410);
        double r1363412 = r1363405 * r1363411;
        double r1363413 = atan2(r1363407, r1363402);
        double r1363414 = y_im;
        double r1363415 = r1363413 * r1363414;
        double r1363416 = r1363412 - r1363415;
        double r1363417 = exp(r1363416);
        double r1363418 = r1363413 * r1363405;
        double r1363419 = -r1363402;
        double r1363420 = log(r1363419);
        double r1363421 = r1363414 * r1363420;
        double r1363422 = r1363418 + r1363421;
        double r1363423 = sin(r1363422);
        double r1363424 = r1363417 * r1363423;
        double r1363425 = 3.311854826363891e-168;
        bool r1363426 = r1363402 <= r1363425;
        double r1363427 = log(r1363402);
        double r1363428 = r1363414 * r1363427;
        double r1363429 = r1363418 + r1363428;
        double r1363430 = sin(r1363429);
        double r1363431 = r1363427 * r1363405;
        double r1363432 = r1363431 - r1363415;
        double r1363433 = exp(r1363432);
        double r1363434 = r1363430 * r1363433;
        double r1363435 = 6.385759705628924e-120;
        bool r1363436 = r1363402 <= r1363435;
        double r1363437 = cbrt(r1363410);
        double r1363438 = r1363437 * r1363437;
        double r1363439 = r1363437 * r1363438;
        double r1363440 = log(r1363439);
        double r1363441 = r1363414 * r1363440;
        double r1363442 = r1363418 + r1363441;
        double r1363443 = sin(r1363442);
        double r1363444 = r1363443 * r1363417;
        double r1363445 = r1363436 ? r1363444 : r1363434;
        double r1363446 = r1363426 ? r1363434 : r1363445;
        double r1363447 = r1363404 ? r1363424 : r1363446;
        return r1363447;
}

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 < 6.4917007555624e-311

    1. Initial program 31.6

      \[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.4917007555624e-311 < x.re < 3.311854826363891e-168 or 6.385759705628924e-120 < x.re

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

      \[\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. Taylor expanded around inf 17.2

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

    if 3.311854826363891e-168 < x.re < 6.385759705628924e-120

    1. Initial program 19.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. Using strategy rm
    3. Applied add-cube-cbrt19.4

      \[\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(\sqrt[3]{\sqrt{x.re \cdot x.re + x.im \cdot x.im}} \cdot \sqrt[3]{\sqrt{x.re \cdot x.re + x.im \cdot x.im}}\right) \cdot \sqrt[3]{\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)\]
  3. Recombined 3 regimes into one program.
  4. Final simplification18.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.re \le 6.491700755562396959330084849596640570741 \cdot 10^{-311}:\\ \;\;\;\;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{elif}\;x.re \le 3.311854826363890934372578038946963601694 \cdot 10^{-168}:\\ \;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log x.re\right) \cdot e^{\log x.re \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{elif}\;x.re \le 6.385759705628923576207076949625877094635 \cdot 10^{-120}:\\ \;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(\sqrt[3]{\sqrt{x.re \cdot x.re + x.im \cdot x.im}} \cdot \left(\sqrt[3]{\sqrt{x.re \cdot x.re + x.im \cdot x.im}} \cdot \sqrt[3]{\sqrt{x.re \cdot x.re + x.im \cdot x.im}}\right)\right)\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}\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log x.re\right) \cdot e^{\log x.re \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \end{array}\]

Reproduce

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