Average Error: 33.5 → 10.2
Time: 13.1s
Precision: binary64
\[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 \cos \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 -27302.8460117604009:\\ \;\;\;\;e^{\left(\sqrt[3]{\log \left(-1 \cdot x.re\right) \cdot y.re} \cdot \sqrt[3]{\log \left(-1 \cdot x.re\right) \cdot y.re}\right) \cdot \sqrt[3]{\log \left(-1 \cdot x.re\right) \cdot y.re} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\\ \mathbf{elif}\;x.re \le -1.05684963771204182 \cdot 10^{-111}:\\ \;\;\;\;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 1\\ \mathbf{elif}\;x.re \le 2.844085785500679 \cdot 10^{-310}:\\ \;\;\;\;e^{\left(\sqrt[3]{\log \left(-1 \cdot x.re\right) \cdot y.re} \cdot \sqrt[3]{\log \left(-1 \cdot x.re\right) \cdot y.re}\right) \cdot \sqrt[3]{\log \left(-1 \cdot x.re\right) \cdot y.re} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\frac{{x.re}^{y.re}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot 1\\ \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 \cos \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 -27302.8460117604009:\\
\;\;\;\;e^{\left(\sqrt[3]{\log \left(-1 \cdot x.re\right) \cdot y.re} \cdot \sqrt[3]{\log \left(-1 \cdot x.re\right) \cdot y.re}\right) \cdot \sqrt[3]{\log \left(-1 \cdot x.re\right) \cdot y.re} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\\

\mathbf{elif}\;x.re \le -1.05684963771204182 \cdot 10^{-111}:\\
\;\;\;\;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 1\\

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

\mathbf{else}:\\
\;\;\;\;\frac{{x.re}^{y.re}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot 1\\

\end{array}
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	return ((double) (((double) exp(((double) (((double) (((double) log(((double) sqrt(((double) (((double) (x_46_re * x_46_re)) + ((double) (x_46_im * x_46_im)))))))) * y_46_re)) - ((double) (((double) atan2(x_46_im, x_46_re)) * y_46_im)))))) * ((double) cos(((double) (((double) (((double) log(((double) sqrt(((double) (((double) (x_46_re * x_46_re)) + ((double) (x_46_im * x_46_im)))))))) * y_46_im)) + ((double) (((double) atan2(x_46_im, x_46_re)) * y_46_re))))))));
}
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double VAR;
	if ((x_46_re <= -27302.8460117604)) {
		VAR = ((double) (((double) exp(((double) (((double) (((double) (((double) cbrt(((double) (((double) log(((double) (-1.0 * x_46_re)))) * y_46_re)))) * ((double) cbrt(((double) (((double) log(((double) (-1.0 * x_46_re)))) * y_46_re)))))) * ((double) cbrt(((double) (((double) log(((double) (-1.0 * x_46_re)))) * y_46_re)))))) - ((double) (((double) atan2(x_46_im, x_46_re)) * y_46_im)))))) * 1.0));
	} else {
		double VAR_1;
		if ((x_46_re <= -1.0568496377120418e-111)) {
			VAR_1 = ((double) (((double) exp(((double) (((double) (((double) log(((double) sqrt(((double) (((double) (x_46_re * x_46_re)) + ((double) (x_46_im * x_46_im)))))))) * y_46_re)) - ((double) (((double) atan2(x_46_im, x_46_re)) * y_46_im)))))) * 1.0));
		} else {
			double VAR_2;
			if ((x_46_re <= 2.8440857855007e-310)) {
				VAR_2 = ((double) (((double) exp(((double) (((double) (((double) (((double) cbrt(((double) (((double) log(((double) (-1.0 * x_46_re)))) * y_46_re)))) * ((double) cbrt(((double) (((double) log(((double) (-1.0 * x_46_re)))) * y_46_re)))))) * ((double) cbrt(((double) (((double) log(((double) (-1.0 * x_46_re)))) * y_46_re)))))) - ((double) (((double) atan2(x_46_im, x_46_re)) * y_46_im)))))) * 1.0));
			} else {
				VAR_2 = ((double) (((double) (((double) pow(x_46_re, y_46_re)) / ((double) exp(((double) (((double) atan2(x_46_im, x_46_re)) * y_46_im)))))) * 1.0));
			}
			VAR_1 = VAR_2;
		}
		VAR = VAR_1;
	}
	return VAR;
}

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 < -27302.8460117604009 or -1.05684963771204182e-111 < x.re < 2.844085785500679e-310

    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 \cos \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 0 20.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}{1}\]
    3. Taylor expanded around -inf 4.5

      \[\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 1\]
    4. Using strategy rm
    5. Applied add-cube-cbrt4.5

      \[\leadsto e^{\color{blue}{\left(\sqrt[3]{\log \left(-1 \cdot x.re\right) \cdot y.re} \cdot \sqrt[3]{\log \left(-1 \cdot x.re\right) \cdot y.re}\right) \cdot \sqrt[3]{\log \left(-1 \cdot x.re\right) \cdot y.re}} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\]

    if -27302.8460117604009 < x.re < -1.05684963771204182e-111

    1. Initial program 17.2

      \[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 \cos \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 0 9.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}{1}\]

    if 2.844085785500679e-310 < x.re

    1. Initial program 34.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 \cos \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 0 21.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 \color{blue}{1}\]
    3. Taylor expanded around inf 11.0

      \[\leadsto \color{blue}{e^{\log 1 \cdot y.re - \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + y.re \cdot \log \left(\frac{1}{x.re}\right)\right)}} \cdot 1\]
    4. Simplified14.7

      \[\leadsto \color{blue}{\frac{{x.re}^{y.re}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}} \cdot 1\]
  3. Recombined 3 regimes into one program.
  4. Final simplification10.2

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

Reproduce

herbie shell --seed 2020173 
(FPCore (x.re x.im y.re y.im)
  :name "powComplex, real part"
  :precision binary64
  (* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (cos (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))