Average Error: 33.0 → 17.6
Time: 30.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 -4.000236435680563415231517513561000379886 \cdot 10^{-43}:\\ \;\;\;\;e^{\log \left(-x.re\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\left|x.im\right|\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;x.re \le 1.405848435471205693683660544267189981616 \cdot 10^{-293} \lor \neg \left(x.re \le 2.698797435107739892751313988383445168574 \cdot 10^{-254}\right) \land x.re \le 6.089823661559195862886324010710708065133 \cdot 10^{-145}:\\ \;\;\;\;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(\left|x.im\right|\right) \cdot y.im + \left(\left(\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \sqrt[3]{y.re}\right) \cdot \sqrt[3]{\sqrt[3]{y.re} \cdot \sqrt[3]{y.re}}\right) \cdot \sqrt[3]{\sqrt[3]{y.re}}\right) \cdot \sqrt[3]{y.re}\right)\\ \mathbf{else}:\\ \;\;\;\;e^{\log x.re \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\left|x.im\right|\right) \cdot y.im + \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.000236435680563415231517513561000379886 \cdot 10^{-43}:\\
\;\;\;\;e^{\log \left(-x.re\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\left|x.im\right|\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\

\mathbf{elif}\;x.re \le 1.405848435471205693683660544267189981616 \cdot 10^{-293} \lor \neg \left(x.re \le 2.698797435107739892751313988383445168574 \cdot 10^{-254}\right) \land x.re \le 6.089823661559195862886324010710708065133 \cdot 10^{-145}:\\
\;\;\;\;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(\left|x.im\right|\right) \cdot y.im + \left(\left(\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \sqrt[3]{y.re}\right) \cdot \sqrt[3]{\sqrt[3]{y.re} \cdot \sqrt[3]{y.re}}\right) \cdot \sqrt[3]{\sqrt[3]{y.re}}\right) \cdot \sqrt[3]{y.re}\right)\\

\mathbf{else}:\\
\;\;\;\;e^{\log x.re \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\left|x.im\right|\right) \cdot y.im + \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 r23605 = x_re;
        double r23606 = r23605 * r23605;
        double r23607 = x_im;
        double r23608 = r23607 * r23607;
        double r23609 = r23606 + r23608;
        double r23610 = sqrt(r23609);
        double r23611 = log(r23610);
        double r23612 = y_re;
        double r23613 = r23611 * r23612;
        double r23614 = atan2(r23607, r23605);
        double r23615 = y_im;
        double r23616 = r23614 * r23615;
        double r23617 = r23613 - r23616;
        double r23618 = exp(r23617);
        double r23619 = r23611 * r23615;
        double r23620 = r23614 * r23612;
        double r23621 = r23619 + r23620;
        double r23622 = sin(r23621);
        double r23623 = r23618 * r23622;
        return r23623;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r23624 = x_re;
        double r23625 = -4.0002364356805634e-43;
        bool r23626 = r23624 <= r23625;
        double r23627 = -r23624;
        double r23628 = log(r23627);
        double r23629 = y_re;
        double r23630 = r23628 * r23629;
        double r23631 = x_im;
        double r23632 = atan2(r23631, r23624);
        double r23633 = y_im;
        double r23634 = r23632 * r23633;
        double r23635 = r23630 - r23634;
        double r23636 = exp(r23635);
        double r23637 = fabs(r23631);
        double r23638 = log(r23637);
        double r23639 = r23638 * r23633;
        double r23640 = r23632 * r23629;
        double r23641 = r23639 + r23640;
        double r23642 = sin(r23641);
        double r23643 = r23636 * r23642;
        double r23644 = 1.4058484354712057e-293;
        bool r23645 = r23624 <= r23644;
        double r23646 = 2.69879743510774e-254;
        bool r23647 = r23624 <= r23646;
        double r23648 = !r23647;
        double r23649 = 6.089823661559196e-145;
        bool r23650 = r23624 <= r23649;
        bool r23651 = r23648 && r23650;
        bool r23652 = r23645 || r23651;
        double r23653 = r23624 * r23624;
        double r23654 = r23631 * r23631;
        double r23655 = r23653 + r23654;
        double r23656 = sqrt(r23655);
        double r23657 = log(r23656);
        double r23658 = r23657 * r23629;
        double r23659 = r23658 - r23634;
        double r23660 = exp(r23659);
        double r23661 = cbrt(r23629);
        double r23662 = r23632 * r23661;
        double r23663 = r23661 * r23661;
        double r23664 = cbrt(r23663);
        double r23665 = r23662 * r23664;
        double r23666 = cbrt(r23661);
        double r23667 = r23665 * r23666;
        double r23668 = r23667 * r23661;
        double r23669 = r23639 + r23668;
        double r23670 = sin(r23669);
        double r23671 = r23660 * r23670;
        double r23672 = log(r23624);
        double r23673 = r23672 * r23629;
        double r23674 = r23673 - r23634;
        double r23675 = exp(r23674);
        double r23676 = r23675 * r23642;
        double r23677 = r23652 ? r23671 : r23676;
        double r23678 = r23626 ? r23643 : r23677;
        return r23678;
}

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.0002364356805634e-43

    1. Initial program 38.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-sqr-sqrt38.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 \left(\sqrt{\color{blue}{\sqrt{x.re \cdot x.re + x.im \cdot x.im} \cdot \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)\]
    4. Applied rem-sqrt-square38.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{x.re \cdot x.re + x.im \cdot x.im}\right|\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    5. Taylor expanded around 0 25.1

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

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

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

    if -4.0002364356805634e-43 < x.re < 1.4058484354712057e-293 or 2.69879743510774e-254 < x.re < 6.089823661559196e-145

    1. Initial program 25.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. Using strategy rm
    3. Applied add-sqr-sqrt25.1

      \[\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{\color{blue}{\sqrt{x.re \cdot x.re + x.im \cdot x.im} \cdot \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)\]
    4. Applied rem-sqrt-square25.1

      \[\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{x.re \cdot x.re + x.im \cdot x.im}\right|\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    5. Taylor expanded around 0 15.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(\left|\color{blue}{x.im}\right|\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    6. Using strategy rm
    7. Applied add-cube-cbrt15.5

      \[\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(\left|x.im\right|\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)\]
    8. Applied associate-*r*15.5

      \[\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(\left|x.im\right|\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)\]
    9. Simplified15.5

      \[\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(\left|x.im\right|\right) \cdot y.im + \color{blue}{\left(\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \sqrt[3]{y.re}\right) \cdot \sqrt[3]{y.re}\right)} \cdot \sqrt[3]{y.re}\right)\]
    10. Using strategy rm
    11. Applied add-cube-cbrt15.5

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

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

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

    if 1.4058484354712057e-293 < x.re < 2.69879743510774e-254 or 6.089823661559196e-145 < x.re

    1. Initial program 35.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-sqr-sqrt35.5

      \[\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{\color{blue}{\sqrt{x.re \cdot x.re + x.im \cdot x.im} \cdot \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)\]
    4. Applied rem-sqrt-square35.5

      \[\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{x.re \cdot x.re + x.im \cdot x.im}\right|\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    5. Taylor expanded around 0 29.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 \left(\left|\color{blue}{x.im}\right|\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    6. Taylor expanded around inf 23.5

      \[\leadsto e^{\log \color{blue}{x.re} \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\left|x.im\right|\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
  3. Recombined 3 regimes into one program.
  4. Final simplification17.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.re \le -4.000236435680563415231517513561000379886 \cdot 10^{-43}:\\ \;\;\;\;e^{\log \left(-x.re\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\left|x.im\right|\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;x.re \le 1.405848435471205693683660544267189981616 \cdot 10^{-293} \lor \neg \left(x.re \le 2.698797435107739892751313988383445168574 \cdot 10^{-254}\right) \land x.re \le 6.089823661559195862886324010710708065133 \cdot 10^{-145}:\\ \;\;\;\;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(\left|x.im\right|\right) \cdot y.im + \left(\left(\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \sqrt[3]{y.re}\right) \cdot \sqrt[3]{\sqrt[3]{y.re} \cdot \sqrt[3]{y.re}}\right) \cdot \sqrt[3]{\sqrt[3]{y.re}}\right) \cdot \sqrt[3]{y.re}\right)\\ \mathbf{else}:\\ \;\;\;\;e^{\log x.re \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\left|x.im\right|\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019208 
(FPCore (x.re x.im y.re y.im)
  :name "powComplex, imaginary part"
  :precision binary64
  (* (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)))))