Average Error: 32.8 → 7.4
Time: 28.9s
Precision: binary64
Cost: 110408
\[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} t_0 := e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ t_1 := e^{\tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{if}\;y.im \leq -5.2 \cdot 10^{+53}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq 2.8 \cdot 10^{+39}:\\ \;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left({\left(\sqrt[3]{t_1 \cdot 0.5}\right)}^{3} + \log \left(\sqrt{e^{t_1}}\right)\right)}^{y.im}} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \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
 (let* ((t_0 (exp (* y.im (- (atan2 x.im x.re)))))
        (t_1 (exp (atan2 x.im x.re))))
   (if (<= y.im -5.2e+53)
     t_0
     (if (<= y.im 2.8e+39)
       (*
        (/
         (pow (hypot x.re x.im) y.re)
         (pow (+ (pow (cbrt (* t_1 0.5)) 3.0) (log (sqrt (exp t_1)))) y.im))
        (cos (fma (log (hypot x.re x.im)) y.im (* (atan2 x.im x.re) y.re))))
       t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	return exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_im) + (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 t_0 = exp((y_46_im * -atan2(x_46_im, x_46_re)));
	double t_1 = exp(atan2(x_46_im, x_46_re));
	double tmp;
	if (y_46_im <= -5.2e+53) {
		tmp = t_0;
	} else if (y_46_im <= 2.8e+39) {
		tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / pow((pow(cbrt((t_1 * 0.5)), 3.0) + log(sqrt(exp(t_1)))), y_46_im)) * cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (atan2(x_46_im, x_46_re) * y_46_re)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	return Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re))))
end
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))
	t_1 = exp(atan(x_46_im, x_46_re))
	tmp = 0.0
	if (y_46_im <= -5.2e+53)
		tmp = t_0;
	elseif (y_46_im <= 2.8e+39)
		tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (Float64((cbrt(Float64(t_1 * 0.5)) ^ 3.0) + log(sqrt(exp(t_1)))) ^ y_46_im)) * cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(atan(x_46_im, x_46_re) * y_46_re))));
	else
		tmp = t_0;
	end
	return tmp
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -5.2e+53], t$95$0, If[LessEqual[y$46$im, 2.8e+39], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[(N[Power[N[Power[N[(t$95$1 * 0.5), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision] + N[Log[N[Sqrt[N[Exp[t$95$1], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], y$46$im], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
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}
t_0 := e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
t_1 := e^{\tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq -5.2 \cdot 10^{+53}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y.im \leq 2.8 \cdot 10^{+39}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left({\left(\sqrt[3]{t_1 \cdot 0.5}\right)}^{3} + \log \left(\sqrt{e^{t_1}}\right)\right)}^{y.im}} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}

Error

Derivation

  1. Split input into 2 regimes
  2. if y.im < -5.19999999999999996e53 or 2.80000000000000001e39 < y.im

    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 in y.im 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}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
    3. Taylor expanded in y.re 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} \]
    4. Taylor expanded in y.re around 0 16.9

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

    if -5.19999999999999996e53 < y.im < 2.80000000000000001e39

    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 \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. Simplified2.2

      \[\leadsto \color{blue}{\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{y.im}} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} \]
      Proof
      (*.f64 (/.f64 (pow.f64 (hypot.f64 x.re x.im) y.re) (pow.f64 (exp.f64 (atan2.f64 x.im x.re)) y.im)) (cos.f64 (fma.f64 (log.f64 (hypot.f64 x.re x.im)) y.im (*.f64 y.re (atan2.f64 x.im x.re))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (pow.f64 (Rewrite<= hypot-def_binary64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (pow.f64 (exp.f64 (atan2.f64 x.im x.re)) y.im)) (cos.f64 (fma.f64 (log.f64 (hypot.f64 x.re x.im)) y.im (*.f64 y.re (atan2.f64 x.im x.re))))): 52 points increase in error, 5 points decrease in error
      (*.f64 (/.f64 (Rewrite<= exp-to-pow_binary64 (exp.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re))) (pow.f64 (exp.f64 (atan2.f64 x.im x.re)) y.im)) (cos.f64 (fma.f64 (log.f64 (hypot.f64 x.re x.im)) y.im (*.f64 y.re (atan2.f64 x.im x.re))))): 1 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (exp.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re)) (Rewrite<= exp-prod_binary64 (exp.f64 (*.f64 (atan2.f64 x.im x.re) y.im)))) (cos.f64 (fma.f64 (log.f64 (hypot.f64 x.re x.im)) y.im (*.f64 y.re (atan2.f64 x.im x.re))))): 2 points increase in error, 2 points decrease in error
      (*.f64 (Rewrite<= exp-diff_binary64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im)))) (cos.f64 (fma.f64 (log.f64 (hypot.f64 x.re x.im)) y.im (*.f64 y.re (atan2.f64 x.im x.re))))): 1 points increase in error, 12 points decrease in error
      (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (fma.f64 (log.f64 (Rewrite<= hypot-def_binary64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im))))) y.im (*.f64 y.re (atan2.f64 x.im x.re))))): 72 points increase in error, 0 points decrease in error
      (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (fma.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im (Rewrite<= *-commutative_binary64 (*.f64 (atan2.f64 x.im x.re) y.re))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re))))): 0 points increase in error, 0 points decrease in error
    3. Applied egg-rr2.2

      \[\leadsto \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\color{blue}{\left(\log \left(\sqrt{e^{e^{\tan^{-1}_* \frac{x.im}{x.re}}}}\right) + \log \left(\sqrt{e^{e^{\tan^{-1}_* \frac{x.im}{x.re}}}}\right)\right)}}^{y.im}} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
    4. Applied egg-rr2.2

      \[\leadsto \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(\color{blue}{{\left(\sqrt[3]{e^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot 0.5}\right)}^{3}} + \log \left(\sqrt{e^{e^{\tan^{-1}_* \frac{x.im}{x.re}}}}\right)\right)}^{y.im}} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification7.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -5.2 \cdot 10^{+53}:\\ \;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{elif}\;y.im \leq 2.8 \cdot 10^{+39}:\\ \;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left({\left(\sqrt[3]{e^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot 0.5}\right)}^{3} + \log \left(\sqrt{e^{e^{\tan^{-1}_* \frac{x.im}{x.re}}}}\right)\right)}^{y.im}} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\\ \mathbf{else}:\\ \;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \end{array} \]

Alternatives

Alternative 1
Error7.4
Cost78024
\[\begin{array}{l} t_0 := e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{if}\;y.im \leq -5.2 \cdot 10^{+53}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq 2.8 \cdot 10^{+39}:\\ \;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\log \left(e^{e^{\tan^{-1}_* \frac{x.im}{x.re}}}\right)}^{y.im}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error7.4
Cost65224
\[\begin{array}{l} t_0 := e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{if}\;y.im \leq -5.2 \cdot 10^{+53}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq 2.8 \cdot 10^{+39}:\\ \;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{y.im}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error6.4
Cost46280
\[\begin{array}{l} t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0}\\ t_2 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{if}\;y.re \leq -2.8 \cdot 10^{+17}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.re \leq 2.763460352325629 \cdot 10^{-35}:\\ \;\;\;\;\frac{1}{e^{t_0}} \cdot t_2\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot t_2\\ \end{array} \]
Alternative 4
Error6.3
Cost32968
\[\begin{array}{l} t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0}\\ \mathbf{if}\;y.re \leq -2.8 \cdot 10^{+17}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.re \leq 2.763460352325629 \cdot 10^{-35}:\\ \;\;\;\;\frac{1}{e^{t_0}} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error6.8
Cost26760
\[\begin{array}{l} t_0 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{if}\;y.re \leq -2.8 \cdot 10^{+17}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.re \leq 2.763460352325629 \cdot 10^{-35}:\\ \;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error6.6
Cost13384
\[\begin{array}{l} \mathbf{if}\;y.re \leq -2.8 \cdot 10^{+17}:\\ \;\;\;\;{\left(\left(x.re \cdot x.re\right) \cdot \frac{-0.5}{x.im} - x.im\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq 1660000000:\\ \;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(-x.re\right)}^{y.re}\\ \end{array} \]
Alternative 7
Error17.1
Cost12992
\[{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \]
Alternative 8
Error23.3
Cost7252
\[\begin{array}{l} t_0 := {\left(-x.im\right)}^{y.re}\\ t_1 := {\left(-x.re\right)}^{y.re}\\ \mathbf{if}\;x.im \leq -1.62 \cdot 10^{-130}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x.im \leq -1.9 \cdot 10^{-248}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x.im \leq -3 \cdot 10^{-303}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x.im \leq 1.48 \cdot 10^{-155}:\\ \;\;\;\;{x.im}^{y.re}\\ \mathbf{elif}\;x.im \leq 1.15 \cdot 10^{-85}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;{x.im}^{y.re}\\ \end{array} \]
Alternative 9
Error17.5
Cost7172
\[\begin{array}{l} \mathbf{if}\;y.re \leq -1.3869224618993921 \cdot 10^{-27}:\\ \;\;\;\;{\left(\left(x.re \cdot x.re\right) \cdot \frac{-0.5}{x.im} - x.im\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq 1660000000:\\ \;\;\;\;1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{else}:\\ \;\;\;\;{\left(-x.re\right)}^{y.re}\\ \end{array} \]
Alternative 10
Error23.1
Cost6988
\[\begin{array}{l} t_0 := {\left(-x.im\right)}^{y.re}\\ \mathbf{if}\;x.im \leq -3.3 \cdot 10^{-115}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x.im \leq -1.8 \cdot 10^{-184}:\\ \;\;\;\;{x.re}^{y.re}\\ \mathbf{elif}\;x.im \leq -3 \cdot 10^{-303}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;{x.im}^{y.re}\\ \end{array} \]
Alternative 11
Error28.3
Cost6924
\[\begin{array}{l} \mathbf{if}\;x.re \leq -2.8 \cdot 10^{+63}:\\ \;\;\;\;{x.im}^{y.re}\\ \mathbf{elif}\;x.re \leq -9.4 \cdot 10^{+22}:\\ \;\;\;\;{x.re}^{y.re}\\ \mathbf{elif}\;x.re \leq 1.22 \cdot 10^{-292}:\\ \;\;\;\;{x.im}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;{x.re}^{y.re}\\ \end{array} \]
Alternative 12
Error34.3
Cost6528
\[{x.re}^{y.re} \]

Error

Reproduce

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