Average Error: 33.1 → 24.1
Time: 26.1s
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 -4.946097345847492624611856386254021833437 \cdot 10^{-9}:\\ \;\;\;\;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 1.135334275862060002640682897982534201427 \cdot 10^{-248}:\\ \;\;\;\;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(\left(\left(\sqrt[3]{y.re} \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \sqrt[3]{y.re}\right) \cdot \sqrt[3]{y.re} + y.im \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;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(y.im \cdot \log x.re + \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}\;x.re \le -4.946097345847492624611856386254021833437 \cdot 10^{-9}:\\
\;\;\;\;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 1.135334275862060002640682897982534201427 \cdot 10^{-248}:\\
\;\;\;\;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(\left(\left(\sqrt[3]{y.re} \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \sqrt[3]{y.re}\right) \cdot \sqrt[3]{y.re} + y.im \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;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(y.im \cdot \log x.re + \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 r27497 = x_re;
        double r27498 = r27497 * r27497;
        double r27499 = x_im;
        double r27500 = r27499 * r27499;
        double r27501 = r27498 + r27500;
        double r27502 = sqrt(r27501);
        double r27503 = log(r27502);
        double r27504 = y_re;
        double r27505 = r27503 * r27504;
        double r27506 = atan2(r27499, r27497);
        double r27507 = y_im;
        double r27508 = r27506 * r27507;
        double r27509 = r27505 - r27508;
        double r27510 = exp(r27509);
        double r27511 = r27503 * r27507;
        double r27512 = r27506 * r27504;
        double r27513 = r27511 + r27512;
        double r27514 = sin(r27513);
        double r27515 = r27510 * r27514;
        return r27515;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r27516 = x_re;
        double r27517 = -4.946097345847493e-09;
        bool r27518 = r27516 <= r27517;
        double r27519 = y_re;
        double r27520 = r27516 * r27516;
        double r27521 = x_im;
        double r27522 = r27521 * r27521;
        double r27523 = r27520 + r27522;
        double r27524 = sqrt(r27523);
        double r27525 = log(r27524);
        double r27526 = r27519 * r27525;
        double r27527 = atan2(r27521, r27516);
        double r27528 = y_im;
        double r27529 = r27527 * r27528;
        double r27530 = r27526 - r27529;
        double r27531 = exp(r27530);
        double r27532 = r27527 * r27519;
        double r27533 = -r27516;
        double r27534 = log(r27533);
        double r27535 = r27528 * r27534;
        double r27536 = r27532 + r27535;
        double r27537 = sin(r27536);
        double r27538 = r27531 * r27537;
        double r27539 = 1.13533427586206e-248;
        bool r27540 = r27516 <= r27539;
        double r27541 = cbrt(r27519);
        double r27542 = r27541 * r27527;
        double r27543 = r27542 * r27541;
        double r27544 = r27543 * r27541;
        double r27545 = r27528 * r27525;
        double r27546 = r27544 + r27545;
        double r27547 = sin(r27546);
        double r27548 = r27531 * r27547;
        double r27549 = log(r27516);
        double r27550 = r27528 * r27549;
        double r27551 = r27550 + r27532;
        double r27552 = sin(r27551);
        double r27553 = r27531 * r27552;
        double r27554 = r27540 ? r27548 : r27553;
        double r27555 = r27518 ? r27538 : r27554;
        return r27555;
}

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 < -4.946097345847493e-09

    1. Initial program 38.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 22.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(-1 \cdot x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    3. Simplified22.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(-x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]

    if -4.946097345847493e-09 < x.re < 1.13533427586206e-248

    1. Initial program 24.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. Using strategy rm
    3. Applied add-cube-cbrt24.7

      \[\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 \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot \color{blue}{\left(\left(\sqrt[3]{y.re} \cdot \sqrt[3]{y.re}\right) \cdot \sqrt[3]{y.re}\right)}\right)\]
    4. Applied associate-*r*24.7

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

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

    if 1.13533427586206e-248 < 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. Using strategy rm
    3. Applied add-cube-cbrt35.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 \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot \color{blue}{\left(\left(\sqrt[3]{y.re} \cdot \sqrt[3]{y.re}\right) \cdot \sqrt[3]{y.re}\right)}\right)\]
    4. Applied associate-*r*35.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 \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(\sqrt[3]{y.re} \cdot \sqrt[3]{y.re}\right)\right) \cdot \sqrt[3]{y.re}}\right)\]
    5. Simplified35.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 \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \color{blue}{\left(\sqrt[3]{y.re} \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \sqrt[3]{y.re}\right)\right)} \cdot \sqrt[3]{y.re}\right)\]
    6. Taylor expanded around inf 24.6

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

      \[\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(y.im \cdot \log x.re + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification24.1

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

Reproduce

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