Average Error: 33.5 → 10.3
Time: 8.4s
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 \leq -9.571765797869584 \cdot 10^{-306}:\\ \;\;\;\;e^{\log \left(-x.re\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{elif}\;x.re \leq 2.432862549184466 \cdot 10^{-179} \lor \neg \left(x.re \leq 7.691521858662134 \cdot 10^{-35}\right):\\ \;\;\;\;{\left(\sqrt[3]{x.re} \cdot \sqrt[3]{x.re}\right)}^{y.re} \cdot \frac{{\left(\sqrt[3]{x.re}\right)}^{y.re}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\ \mathbf{else}:\\ \;\;\;\;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}\\ \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 \leq -9.571765797869584 \cdot 10^{-306}:\\
\;\;\;\;e^{\log \left(-x.re\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\

\mathbf{elif}\;x.re \leq 2.432862549184466 \cdot 10^{-179} \lor \neg \left(x.re \leq 7.691521858662134 \cdot 10^{-35}\right):\\
\;\;\;\;{\left(\sqrt[3]{x.re} \cdot \sqrt[3]{x.re}\right)}^{y.re} \cdot \frac{{\left(\sqrt[3]{x.re}\right)}^{y.re}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\

\mathbf{else}:\\
\;\;\;\;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}\\

\end{array}
(FPCore (x.re x.im y.re y.im)
 :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)))))
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (if (<= x.re -9.571765797869584e-306)
   (exp (- (* (log (- x.re)) y.re) (* (atan2 x.im x.re) y.im)))
   (if (or (<= x.re 2.432862549184466e-179)
           (not (<= x.re 7.691521858662134e-35)))
     (*
      (pow (* (cbrt x.re) (cbrt x.re)) y.re)
      (/ (pow (cbrt x.re) y.re) (exp (* (atan2 x.im x.re) y.im))))
     (exp
      (-
       (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
       (* (atan2 x.im x.re) y.im))))))
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 tmp;
	if ((x_46_re <= -9.571765797869584e-306)) {
		tmp = ((double) exp(((double) (((double) (((double) log(((double) -(x_46_re)))) * y_46_re)) - ((double) (((double) atan2(x_46_im, x_46_re)) * y_46_im))))));
	} else {
		double tmp_1;
		if (((x_46_re <= 2.432862549184466e-179) || !(x_46_re <= 7.691521858662134e-35))) {
			tmp_1 = ((double) (((double) pow(((double) (((double) cbrt(x_46_re)) * ((double) cbrt(x_46_re)))), y_46_re)) * (((double) pow(((double) cbrt(x_46_re)), y_46_re)) / ((double) exp(((double) (((double) atan2(x_46_im, x_46_re)) * y_46_im)))))));
		} else {
			tmp_1 = ((double) exp(((double) (((double) (y_46_re * ((double) log(((double) sqrt(((double) (((double) (x_46_re * x_46_re)) + ((double) (x_46_im * x_46_im)))))))))) - ((double) (((double) atan2(x_46_im, x_46_re)) * y_46_im))))));
		}
		tmp = tmp_1;
	}
	return tmp;
}

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 < -9.5717657978695839e-306

    1. Initial program 31.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 \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 6.0

      \[\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. Simplified6.0

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

    if -9.5717657978695839e-306 < x.re < 2.43286254918446588e-179 or 7.69152185866213439e-35 < x.re

    1. Initial program 39.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 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}{1}\]
    3. Taylor expanded around inf 11.3

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

      \[\leadsto \color{blue}{\frac{{x.re}^{y.re}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}} \cdot 1\]
    5. Using strategy rm
    6. Applied *-un-lft-identity_binary6414.4

      \[\leadsto \frac{{x.re}^{y.re}}{\color{blue}{1 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}} \cdot 1\]
    7. Applied add-cube-cbrt_binary6414.4

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

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

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

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

    if 2.43286254918446588e-179 < x.re < 7.69152185866213439e-35

    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 \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 12.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 \color{blue}{1}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification10.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.re \leq -9.571765797869584 \cdot 10^{-306}:\\ \;\;\;\;e^{\log \left(-x.re\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{elif}\;x.re \leq 2.432862549184466 \cdot 10^{-179} \lor \neg \left(x.re \leq 7.691521858662134 \cdot 10^{-35}\right):\\ \;\;\;\;{\left(\sqrt[3]{x.re} \cdot \sqrt[3]{x.re}\right)}^{y.re} \cdot \frac{{\left(\sqrt[3]{x.re}\right)}^{y.re}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\ \mathbf{else}:\\ \;\;\;\;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}\\ \end{array}\]

Reproduce

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