Average Error: 33.2 → 20.7
Time: 29.5s
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 -2.8995865521776026 \cdot 10^{-105}:\\ \;\;\;\;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 3.7259888111147467 \cdot 10^{-302}:\\ \;\;\;\;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 \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;x.re \le 3.9300468248158223 \cdot 10^{-82}:\\ \;\;\;\;\sqrt[3]{\left(\sin \left(y.im \cdot \log x.re + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot \sin \left(y.im \cdot \log x.re + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) \cdot \sin \left(y.im \cdot \log x.re + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \cdot 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}\\ \mathbf{elif}\;x.re \le 9416.095709505209:\\ \;\;\;\;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 \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\left(\sqrt[3]{y.im \cdot \log x.re} \cdot \sqrt[3]{y.im \cdot \log x.re}\right) \cdot \sqrt[3]{y.im \cdot \log x.re} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log x.re \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \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 -2.8995865521776026 \cdot 10^{-105}:\\
\;\;\;\;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 3.7259888111147467 \cdot 10^{-302}:\\
\;\;\;\;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 \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\

\mathbf{elif}\;x.re \le 3.9300468248158223 \cdot 10^{-82}:\\
\;\;\;\;\sqrt[3]{\left(\sin \left(y.im \cdot \log x.re + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot \sin \left(y.im \cdot \log x.re + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) \cdot \sin \left(y.im \cdot \log x.re + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \cdot 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}\\

\mathbf{elif}\;x.re \le 9416.095709505209:\\
\;\;\;\;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 \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\

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

\end{array}
double f(double x_re, double x_im, double y_re, double y_im) {
        double r586140 = x_re;
        double r586141 = r586140 * r586140;
        double r586142 = x_im;
        double r586143 = r586142 * r586142;
        double r586144 = r586141 + r586143;
        double r586145 = sqrt(r586144);
        double r586146 = log(r586145);
        double r586147 = y_re;
        double r586148 = r586146 * r586147;
        double r586149 = atan2(r586142, r586140);
        double r586150 = y_im;
        double r586151 = r586149 * r586150;
        double r586152 = r586148 - r586151;
        double r586153 = exp(r586152);
        double r586154 = r586146 * r586150;
        double r586155 = r586149 * r586147;
        double r586156 = r586154 + r586155;
        double r586157 = sin(r586156);
        double r586158 = r586153 * r586157;
        return r586158;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r586159 = x_re;
        double r586160 = -2.8995865521776026e-105;
        bool r586161 = r586159 <= r586160;
        double r586162 = y_re;
        double r586163 = r586159 * r586159;
        double r586164 = x_im;
        double r586165 = r586164 * r586164;
        double r586166 = r586163 + r586165;
        double r586167 = sqrt(r586166);
        double r586168 = log(r586167);
        double r586169 = r586162 * r586168;
        double r586170 = atan2(r586164, r586159);
        double r586171 = y_im;
        double r586172 = r586170 * r586171;
        double r586173 = r586169 - r586172;
        double r586174 = exp(r586173);
        double r586175 = r586170 * r586162;
        double r586176 = -r586159;
        double r586177 = log(r586176);
        double r586178 = r586171 * r586177;
        double r586179 = r586175 + r586178;
        double r586180 = sin(r586179);
        double r586181 = r586174 * r586180;
        double r586182 = 3.7259888111147467e-302;
        bool r586183 = r586159 <= r586182;
        double r586184 = r586171 * r586168;
        double r586185 = r586184 + r586175;
        double r586186 = sin(r586185);
        double r586187 = r586174 * r586186;
        double r586188 = 3.9300468248158223e-82;
        bool r586189 = r586159 <= r586188;
        double r586190 = log(r586159);
        double r586191 = r586171 * r586190;
        double r586192 = r586191 + r586175;
        double r586193 = sin(r586192);
        double r586194 = r586193 * r586193;
        double r586195 = r586194 * r586193;
        double r586196 = cbrt(r586195);
        double r586197 = r586196 * r586174;
        double r586198 = 9416.095709505209;
        bool r586199 = r586159 <= r586198;
        double r586200 = cbrt(r586191);
        double r586201 = r586200 * r586200;
        double r586202 = r586201 * r586200;
        double r586203 = r586202 + r586175;
        double r586204 = sin(r586203);
        double r586205 = r586190 * r586162;
        double r586206 = r586205 - r586172;
        double r586207 = exp(r586206);
        double r586208 = r586204 * r586207;
        double r586209 = r586199 ? r586187 : r586208;
        double r586210 = r586189 ? r586197 : r586209;
        double r586211 = r586183 ? r586187 : r586210;
        double r586212 = r586161 ? r586181 : r586211;
        return r586212;
}

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 < -2.8995865521776026e-105

    1. Initial program 33.7

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

    if -2.8995865521776026e-105 < x.re < 3.7259888111147467e-302 or 3.9300468248158223e-82 < x.re < 9416.095709505209

    1. Initial program 25.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)\]

    if 3.7259888111147467e-302 < x.re < 3.9300468248158223e-82

    1. Initial program 26.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 22.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}{x.re} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    3. Using strategy rm
    4. Applied add-cbrt-cube27.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 \color{blue}{\sqrt[3]{\left(\sin \left(\log x.re \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot \sin \left(\log x.re \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) \cdot \sin \left(\log x.re \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)}}\]

    if 9416.095709505209 < x.re

    1. Initial program 44.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. Taylor expanded around inf 28.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 \color{blue}{x.re} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    3. Taylor expanded around inf 13.0

      \[\leadsto e^{\log \color{blue}{x.re} \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log x.re \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    4. Using strategy rm
    5. Applied add-cube-cbrt13.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.re \le -2.8995865521776026 \cdot 10^{-105}:\\ \;\;\;\;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 3.7259888111147467 \cdot 10^{-302}:\\ \;\;\;\;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 \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;x.re \le 3.9300468248158223 \cdot 10^{-82}:\\ \;\;\;\;\sqrt[3]{\left(\sin \left(y.im \cdot \log x.re + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot \sin \left(y.im \cdot \log x.re + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) \cdot \sin \left(y.im \cdot \log x.re + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \cdot 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}\\ \mathbf{elif}\;x.re \le 9416.095709505209:\\ \;\;\;\;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 \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\left(\sqrt[3]{y.im \cdot \log x.re} \cdot \sqrt[3]{y.im \cdot \log x.re}\right) \cdot \sqrt[3]{y.im \cdot \log x.re} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log x.re \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \end{array}\]

Reproduce

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