Average Error: 33.0 → 12.2
Time: 16.9s
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 -1.27605207452321821 \cdot 10^{103}:\\ \;\;\;\;e^{\left(0 - \log \left({\left(\frac{-1}{x.re}\right)}^{y.re}\right)\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\\ \mathbf{elif}\;x.re \le -6.72056962232334222 \cdot 10^{-215}:\\ \;\;\;\;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 -1.5775093623743453 \cdot 10^{-281}:\\ \;\;\;\;\frac{\frac{1}{\sqrt[3]{{\left(\frac{-1}{x.re}\right)}^{y.re}} \cdot \sqrt[3]{{\left(\frac{-1}{x.re}\right)}^{y.re}}}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{{\left(\frac{-1}{x.re}\right)}^{y.re}}} \cdot 1\\ \mathbf{elif}\;x.re \le 4.8354379173450772 \cdot 10^{-73}:\\ \;\;\;\;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{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 -1.27605207452321821 \cdot 10^{103}:\\
\;\;\;\;e^{\left(0 - \log \left({\left(\frac{-1}{x.re}\right)}^{y.re}\right)\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\\

\mathbf{elif}\;x.re \le -6.72056962232334222 \cdot 10^{-215}:\\
\;\;\;\;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 -1.5775093623743453 \cdot 10^{-281}:\\
\;\;\;\;\frac{\frac{1}{\sqrt[3]{{\left(\frac{-1}{x.re}\right)}^{y.re}} \cdot \sqrt[3]{{\left(\frac{-1}{x.re}\right)}^{y.re}}}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{{\left(\frac{-1}{x.re}\right)}^{y.re}}} \cdot 1\\

\mathbf{elif}\;x.re \le 4.8354379173450772 \cdot 10^{-73}:\\
\;\;\;\;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{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 <= -1.2760520745232182e+103)) {
		VAR = ((double) (((double) exp(((double) (((double) (0.0 - ((double) log(((double) pow(((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 <= -6.720569622323342e-215)) {
			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 <= -1.5775093623743453e-281)) {
				VAR_2 = ((double) (((double) (((double) (1.0 / ((double) (((double) cbrt(((double) pow(((double) (-1.0 / x_46_re)), y_46_re)))) * ((double) cbrt(((double) pow(((double) (-1.0 / x_46_re)), y_46_re)))))))) / ((double) (((double) exp(((double) (((double) atan2(x_46_im, x_46_re)) * y_46_im)))) * ((double) cbrt(((double) pow(((double) (-1.0 / x_46_re)), y_46_re)))))))) * 1.0));
			} else {
				double VAR_3;
				if ((x_46_re <= 4.835437917345077e-73)) {
					VAR_3 = ((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 {
					VAR_3 = ((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_2 = VAR_3;
			}
			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 4 regimes
  2. if x.re < -1.27605207452321821e103

    1. Initial program 51.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 \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 28.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 1.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. Simplified6.9

      \[\leadsto \color{blue}{\frac{\frac{1}{{\left(\frac{-1}{x.re}\right)}^{y.re}}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}} \cdot 1\]
    5. Using strategy rm
    6. Applied add-exp-log64.0

      \[\leadsto \frac{\frac{1}{{\left(\frac{-1}{\color{blue}{e^{\log x.re}}}\right)}^{y.re}}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot 1\]
    7. Applied add-exp-log64.0

      \[\leadsto \frac{\frac{1}{{\left(\frac{\color{blue}{e^{\log -1}}}{e^{\log x.re}}\right)}^{y.re}}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot 1\]
    8. Applied div-exp64.0

      \[\leadsto \frac{\frac{1}{{\color{blue}{\left(e^{\log -1 - \log x.re}\right)}}^{y.re}}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot 1\]
    9. Applied pow-exp64.0

      \[\leadsto \frac{\frac{1}{\color{blue}{e^{\left(\log -1 - \log x.re\right) \cdot y.re}}}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot 1\]
    10. Applied rec-exp64.0

      \[\leadsto \frac{\color{blue}{e^{-\left(\log -1 - \log x.re\right) \cdot y.re}}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot 1\]
    11. Applied div-exp64.0

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

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

    if -1.27605207452321821e103 < x.re < -6.72056962232334222e-215 or -1.5775093623743453e-281 < x.re < 4.8354379173450772e-73

    1. Initial program 21.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 13.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 \color{blue}{1}\]

    if -6.72056962232334222e-215 < x.re < -1.5775093623743453e-281

    1. Initial program 30.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 \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 17.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 \color{blue}{1}\]
    3. Taylor expanded around -inf 9.9

      \[\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. Simplified13.1

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

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

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

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

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

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

    if 4.8354379173450772e-73 < x.re

    1. Initial program 39.6

      \[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 25.9

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.re \le -1.27605207452321821 \cdot 10^{103}:\\ \;\;\;\;e^{\left(0 - \log \left({\left(\frac{-1}{x.re}\right)}^{y.re}\right)\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\\ \mathbf{elif}\;x.re \le -6.72056962232334222 \cdot 10^{-215}:\\ \;\;\;\;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 -1.5775093623743453 \cdot 10^{-281}:\\ \;\;\;\;\frac{\frac{1}{\sqrt[3]{{\left(\frac{-1}{x.re}\right)}^{y.re}} \cdot \sqrt[3]{{\left(\frac{-1}{x.re}\right)}^{y.re}}}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{{\left(\frac{-1}{x.re}\right)}^{y.re}}} \cdot 1\\ \mathbf{elif}\;x.re \le 4.8354379173450772 \cdot 10^{-73}:\\ \;\;\;\;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{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 2020168 
(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)))))