Average Error: 30.8 → 11.3
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}\;x.re \le -8.008752982451583 \cdot 10^{+27}:\\ \;\;\;\;e^{\log \left(-x.re\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\log \left(-x.re\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;x.re \le -4.094520758958395 \cdot 10^{-273}:\\ \;\;\;\;\sin \left(\sqrt[3]{\log \left(-x.re\right) \cdot \log \left(-x.re\right)} \cdot \left(y.im \cdot \sqrt[3]{\log \left(-x.re\right)}\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{elif}\;x.re \le -7.38905381868575 \cdot 10^{-286}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{else}:\\ \;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \left(\sqrt[3]{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{\log \left(-x.re\right)}\right) \cdot \left(y.im \cdot \sqrt[3]{\log \left(-x.re\right)}\right)\right)} \cdot \left(\sqrt[3]{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{\log \left(-x.re\right)}\right) \cdot \left(y.im \cdot \sqrt[3]{\log \left(-x.re\right)}\right)\right)} \cdot \sqrt[3]{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{\log \left(-x.re\right)}\right) \cdot \left(y.im \cdot \sqrt[3]{\log \left(-x.re\right)}\right)\right)}\right)\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 -8.008752982451583 \cdot 10^{+27}:\\
\;\;\;\;e^{\log \left(-x.re\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\log \left(-x.re\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\

\mathbf{elif}\;x.re \le -4.094520758958395 \cdot 10^{-273}:\\
\;\;\;\;\sin \left(\sqrt[3]{\log \left(-x.re\right) \cdot \log \left(-x.re\right)} \cdot \left(y.im \cdot \sqrt[3]{\log \left(-x.re\right)}\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\

\mathbf{elif}\;x.re \le -7.38905381868575 \cdot 10^{-286}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\

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

\end{array}
double f(double x_re, double x_im, double y_re, double y_im) {
        double r1098090 = x_re;
        double r1098091 = r1098090 * r1098090;
        double r1098092 = x_im;
        double r1098093 = r1098092 * r1098092;
        double r1098094 = r1098091 + r1098093;
        double r1098095 = sqrt(r1098094);
        double r1098096 = log(r1098095);
        double r1098097 = y_re;
        double r1098098 = r1098096 * r1098097;
        double r1098099 = atan2(r1098092, r1098090);
        double r1098100 = y_im;
        double r1098101 = r1098099 * r1098100;
        double r1098102 = r1098098 - r1098101;
        double r1098103 = exp(r1098102);
        double r1098104 = r1098096 * r1098100;
        double r1098105 = r1098099 * r1098097;
        double r1098106 = r1098104 + r1098105;
        double r1098107 = sin(r1098106);
        double r1098108 = r1098103 * r1098107;
        return r1098108;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r1098109 = x_re;
        double r1098110 = -8.008752982451583e+27;
        bool r1098111 = r1098109 <= r1098110;
        double r1098112 = -r1098109;
        double r1098113 = log(r1098112);
        double r1098114 = y_re;
        double r1098115 = r1098113 * r1098114;
        double r1098116 = y_im;
        double r1098117 = x_im;
        double r1098118 = atan2(r1098117, r1098109);
        double r1098119 = r1098116 * r1098118;
        double r1098120 = r1098115 - r1098119;
        double r1098121 = exp(r1098120);
        double r1098122 = r1098113 * r1098116;
        double r1098123 = r1098118 * r1098114;
        double r1098124 = r1098122 + r1098123;
        double r1098125 = sin(r1098124);
        double r1098126 = r1098121 * r1098125;
        double r1098127 = -4.094520758958395e-273;
        bool r1098128 = r1098109 <= r1098127;
        double r1098129 = r1098113 * r1098113;
        double r1098130 = cbrt(r1098129);
        double r1098131 = cbrt(r1098113);
        double r1098132 = r1098116 * r1098131;
        double r1098133 = r1098130 * r1098132;
        double r1098134 = r1098133 + r1098123;
        double r1098135 = sin(r1098134);
        double r1098136 = r1098109 * r1098109;
        double r1098137 = r1098117 * r1098117;
        double r1098138 = r1098136 + r1098137;
        double r1098139 = sqrt(r1098138);
        double r1098140 = log(r1098139);
        double r1098141 = r1098140 * r1098114;
        double r1098142 = r1098141 - r1098119;
        double r1098143 = exp(r1098142);
        double r1098144 = r1098135 * r1098143;
        double r1098145 = -7.38905381868575e-286;
        bool r1098146 = r1098109 <= r1098145;
        double r1098147 = r1098116 * r1098140;
        double r1098148 = r1098147 + r1098123;
        double r1098149 = sin(r1098148);
        double r1098150 = r1098149 * r1098143;
        double r1098151 = r1098131 * r1098131;
        double r1098152 = r1098151 * r1098132;
        double r1098153 = r1098123 + r1098152;
        double r1098154 = sin(r1098153);
        double r1098155 = cbrt(r1098154);
        double r1098156 = r1098155 * r1098155;
        double r1098157 = r1098155 * r1098156;
        double r1098158 = r1098143 * r1098157;
        double r1098159 = r1098146 ? r1098150 : r1098158;
        double r1098160 = r1098128 ? r1098144 : r1098159;
        double r1098161 = r1098111 ? r1098126 : r1098160;
        return r1098161;
}

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 4 regimes
  2. if x.re < -8.008752982451583e+27

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

      \[\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. Simplified4.4

      \[\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)\]

    if -8.008752982451583e+27 < x.re < -4.094520758958395e-273

    1. Initial program 21.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. Taylor expanded around -inf 15.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}{\left(-1 \cdot x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    3. Simplified15.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}{\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-cbrt15.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(\color{blue}{\left(\left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{\log \left(-x.re\right)}\right) \cdot \sqrt[3]{\log \left(-x.re\right)}\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    6. Applied associate-*l*15.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(\color{blue}{\left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{\log \left(-x.re\right)}\right) \cdot \left(\sqrt[3]{\log \left(-x.re\right)} \cdot y.im\right)} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    7. Using strategy rm
    8. Applied cbrt-unprod15.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(\color{blue}{\sqrt[3]{\log \left(-x.re\right) \cdot \log \left(-x.re\right)}} \cdot \left(\sqrt[3]{\log \left(-x.re\right)} \cdot y.im\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]

    if -4.094520758958395e-273 < x.re < -7.38905381868575e-286

    1. Initial program 32.0

      \[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)\]

    if -7.38905381868575e-286 < x.re

    1. Initial program 33.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.8

      \[\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.8

      \[\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-cbrt22.8

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

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

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

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

Reproduce

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