Average Error: 33.1 → 24.1
Time: 25.9s
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 r27481 = x_re;
        double r27482 = r27481 * r27481;
        double r27483 = x_im;
        double r27484 = r27483 * r27483;
        double r27485 = r27482 + r27484;
        double r27486 = sqrt(r27485);
        double r27487 = log(r27486);
        double r27488 = y_re;
        double r27489 = r27487 * r27488;
        double r27490 = atan2(r27483, r27481);
        double r27491 = y_im;
        double r27492 = r27490 * r27491;
        double r27493 = r27489 - r27492;
        double r27494 = exp(r27493);
        double r27495 = r27487 * r27491;
        double r27496 = r27490 * r27488;
        double r27497 = r27495 + r27496;
        double r27498 = sin(r27497);
        double r27499 = r27494 * r27498;
        return r27499;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r27500 = x_re;
        double r27501 = -4.946097345847493e-09;
        bool r27502 = r27500 <= r27501;
        double r27503 = y_re;
        double r27504 = r27500 * r27500;
        double r27505 = x_im;
        double r27506 = r27505 * r27505;
        double r27507 = r27504 + r27506;
        double r27508 = sqrt(r27507);
        double r27509 = log(r27508);
        double r27510 = r27503 * r27509;
        double r27511 = atan2(r27505, r27500);
        double r27512 = y_im;
        double r27513 = r27511 * r27512;
        double r27514 = r27510 - r27513;
        double r27515 = exp(r27514);
        double r27516 = r27511 * r27503;
        double r27517 = -r27500;
        double r27518 = log(r27517);
        double r27519 = r27512 * r27518;
        double r27520 = r27516 + r27519;
        double r27521 = sin(r27520);
        double r27522 = r27515 * r27521;
        double r27523 = 1.13533427586206e-248;
        bool r27524 = r27500 <= r27523;
        double r27525 = cbrt(r27503);
        double r27526 = r27525 * r27511;
        double r27527 = r27526 * r27525;
        double r27528 = r27527 * r27525;
        double r27529 = r27512 * r27509;
        double r27530 = r27528 + r27529;
        double r27531 = sin(r27530);
        double r27532 = r27515 * r27531;
        double r27533 = log(r27500);
        double r27534 = r27512 * r27533;
        double r27535 = r27534 + r27516;
        double r27536 = sin(r27535);
        double r27537 = r27515 * r27536;
        double r27538 = r27524 ? r27532 : r27537;
        double r27539 = r27502 ? r27522 : r27538;
        return r27539;
}

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. 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 \sin \left(\log \color{blue}{x.re} \cdot y.im + \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)))))