Average Error: 32.9 → 22.4
Time: 25.6s
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 -3.298643782090418428302671103416792007017 \cdot 10^{-310}:\\ \;\;\;\;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(-1 \cdot x.re\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{else}:\\ \;\;\;\;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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re - y.im \cdot \log \left(\frac{1}{x.re}\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 -3.298643782090418428302671103416792007017 \cdot 10^{-310}:\\
\;\;\;\;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(-1 \cdot x.re\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\

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

\end{array}
double f(double x_re, double x_im, double y_re, double y_im) {
        double r27046 = x_re;
        double r27047 = r27046 * r27046;
        double r27048 = x_im;
        double r27049 = r27048 * r27048;
        double r27050 = r27047 + r27049;
        double r27051 = sqrt(r27050);
        double r27052 = log(r27051);
        double r27053 = y_re;
        double r27054 = r27052 * r27053;
        double r27055 = atan2(r27048, r27046);
        double r27056 = y_im;
        double r27057 = r27055 * r27056;
        double r27058 = r27054 - r27057;
        double r27059 = exp(r27058);
        double r27060 = r27052 * r27056;
        double r27061 = r27055 * r27053;
        double r27062 = r27060 + r27061;
        double r27063 = sin(r27062);
        double r27064 = r27059 * r27063;
        return r27064;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r27065 = x_re;
        double r27066 = -3.2986437820904e-310;
        bool r27067 = r27065 <= r27066;
        double r27068 = r27065 * r27065;
        double r27069 = x_im;
        double r27070 = r27069 * r27069;
        double r27071 = r27068 + r27070;
        double r27072 = sqrt(r27071);
        double r27073 = log(r27072);
        double r27074 = y_re;
        double r27075 = r27073 * r27074;
        double r27076 = atan2(r27069, r27065);
        double r27077 = y_im;
        double r27078 = r27076 * r27077;
        double r27079 = r27075 - r27078;
        double r27080 = exp(r27079);
        double r27081 = -1.0;
        double r27082 = r27081 * r27065;
        double r27083 = log(r27082);
        double r27084 = r27083 * r27077;
        double r27085 = r27076 * r27074;
        double r27086 = r27084 + r27085;
        double r27087 = sin(r27086);
        double r27088 = r27080 * r27087;
        double r27089 = 1.0;
        double r27090 = r27089 / r27065;
        double r27091 = log(r27090);
        double r27092 = r27077 * r27091;
        double r27093 = r27085 - r27092;
        double r27094 = sin(r27093);
        double r27095 = r27080 * r27094;
        double r27096 = r27067 ? r27088 : r27095;
        return r27096;
}

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 2 regimes
  2. if x.re < -3.2986437820904e-310

    1. Initial program 31.8

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

    if -3.2986437820904e-310 < 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 24.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}{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re - y.im \cdot \log \left(\frac{1}{x.re}\right)\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification22.4

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

Reproduce

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