Average Error: 31.8 → 10.9
Time: 4.0m
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}\;y.re \le -29128794472578.918:\\ \;\;\;\;e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\left(\sqrt[3]{y.im \cdot \log \left(-x.re\right)} \cdot \left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{y.im}\right)\right) \cdot \left(\sqrt[3]{\sqrt[3]{y.im \cdot \log \left(-x.re\right)}} \cdot \left(\sqrt[3]{\sqrt[3]{y.im \cdot \log \left(-x.re\right)}} \cdot \sqrt[3]{\sqrt[3]{y.im \cdot \log \left(-x.re\right)}}\right)\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.im \cdot \log \left(-x.re\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\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}\;y.re \le -29128794472578.918:\\
\;\;\;\;e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\left(\sqrt[3]{y.im \cdot \log \left(-x.re\right)} \cdot \left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{y.im}\right)\right) \cdot \left(\sqrt[3]{\sqrt[3]{y.im \cdot \log \left(-x.re\right)}} \cdot \left(\sqrt[3]{\sqrt[3]{y.im \cdot \log \left(-x.re\right)}} \cdot \sqrt[3]{\sqrt[3]{y.im \cdot \log \left(-x.re\right)}}\right)\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\

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

\end{array}
double f(double x_re, double x_im, double y_re, double y_im) {
        double r975381 = x_re;
        double r975382 = r975381 * r975381;
        double r975383 = x_im;
        double r975384 = r975383 * r975383;
        double r975385 = r975382 + r975384;
        double r975386 = sqrt(r975385);
        double r975387 = log(r975386);
        double r975388 = y_re;
        double r975389 = r975387 * r975388;
        double r975390 = atan2(r975383, r975381);
        double r975391 = y_im;
        double r975392 = r975390 * r975391;
        double r975393 = r975389 - r975392;
        double r975394 = exp(r975393);
        double r975395 = r975387 * r975391;
        double r975396 = r975390 * r975388;
        double r975397 = r975395 + r975396;
        double r975398 = sin(r975397);
        double r975399 = r975394 * r975398;
        return r975399;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r975400 = y_re;
        double r975401 = -29128794472578.918;
        bool r975402 = r975400 <= r975401;
        double r975403 = x_im;
        double r975404 = r975403 * r975403;
        double r975405 = x_re;
        double r975406 = r975405 * r975405;
        double r975407 = r975404 + r975406;
        double r975408 = sqrt(r975407);
        double r975409 = log(r975408);
        double r975410 = r975409 * r975400;
        double r975411 = atan2(r975403, r975405);
        double r975412 = y_im;
        double r975413 = r975411 * r975412;
        double r975414 = r975410 - r975413;
        double r975415 = exp(r975414);
        double r975416 = -r975405;
        double r975417 = log(r975416);
        double r975418 = r975412 * r975417;
        double r975419 = cbrt(r975418);
        double r975420 = cbrt(r975417);
        double r975421 = cbrt(r975412);
        double r975422 = r975420 * r975421;
        double r975423 = r975419 * r975422;
        double r975424 = cbrt(r975419);
        double r975425 = r975424 * r975424;
        double r975426 = r975424 * r975425;
        double r975427 = r975423 * r975426;
        double r975428 = r975411 * r975400;
        double r975429 = r975427 + r975428;
        double r975430 = sin(r975429);
        double r975431 = r975415 * r975430;
        double r975432 = r975400 * r975417;
        double r975433 = r975432 - r975413;
        double r975434 = exp(r975433);
        double r975435 = r975418 + r975428;
        double r975436 = sin(r975435);
        double r975437 = r975434 * r975436;
        double r975438 = r975402 ? r975431 : r975437;
        return r975438;
}

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 y.re < -29128794472578.918

    1. Initial program 37.5

      \[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 0.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}{\left(-1 \cdot x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    3. Simplified0.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}{\left(-x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    4. Using strategy rm
    5. Applied add-cube-cbrt0.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(\color{blue}{\left(\sqrt[3]{\log \left(-x.re\right) \cdot y.im} \cdot \sqrt[3]{\log \left(-x.re\right) \cdot y.im}\right) \cdot \sqrt[3]{\log \left(-x.re\right) \cdot y.im}} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    6. Using strategy rm
    7. Applied cbrt-prod0.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(\left(\sqrt[3]{\log \left(-x.re\right) \cdot y.im} \cdot \color{blue}{\left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{y.im}\right)}\right) \cdot \sqrt[3]{\log \left(-x.re\right) \cdot y.im} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    8. Using strategy rm
    9. Applied add-cube-cbrt0.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(\left(\sqrt[3]{\log \left(-x.re\right) \cdot y.im} \cdot \left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{y.im}\right)\right) \cdot \color{blue}{\left(\left(\sqrt[3]{\sqrt[3]{\log \left(-x.re\right) \cdot y.im}} \cdot \sqrt[3]{\sqrt[3]{\log \left(-x.re\right) \cdot y.im}}\right) \cdot \sqrt[3]{\sqrt[3]{\log \left(-x.re\right) \cdot y.im}}\right)} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]

    if -29128794472578.918 < y.re

    1. Initial program 26.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 30.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 \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. Simplified30.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 \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 20.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. Simplified20.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)\]
  3. Recombined 2 regimes into one program.
  4. Final simplification10.9

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

Reproduce

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