Average Error: 33.0 → 7.4
Time: 42.4s
Precision: binary64
Cost: 97804
\[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^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{if}\;y.im \leq -7.4 \cdot 10^{+229}:\\ \;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{elif}\;y.im \leq -4.2 \cdot 10^{+84}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq 7700000:\\ \;\;\;\;\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 \sqrt{{\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot {\left(\sqrt[3]{y.im}\right)}^{2}, {\left(y.im \cdot y.im\right)}^{0.16666666666666666}, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)}^{2}}\\ \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
          (-
           (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
           (* y.im (atan2 x.im x.re))))))
   (if (<= y.im -7.4e+229)
     (exp (* y.im (- (atan2 x.im x.re))))
     (if (<= y.im -4.2e+84)
       t_0
       (if (<= y.im 7700000.0)
         (*
          (/ (pow (hypot x.re x.im) y.re) (pow (exp (atan2 x.im x.re)) y.im))
          (sqrt
           (pow
            (cos
             (fma
              (* (log (hypot x.im x.re)) (pow (cbrt y.im) 2.0))
              (pow (* y.im y.im) 0.16666666666666666)
              (* (atan2 x.im x.re) y.re)))
            2.0)))
         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(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
	double tmp;
	if (y_46_im <= -7.4e+229) {
		tmp = exp((y_46_im * -atan2(x_46_im, x_46_re)));
	} else if (y_46_im <= -4.2e+84) {
		tmp = t_0;
	} else if (y_46_im <= 7700000.0) {
		tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(atan2(x_46_im, x_46_re)), y_46_im)) * sqrt(pow(cos(fma((log(hypot(x_46_im, x_46_re)) * pow(cbrt(y_46_im), 2.0)), pow((y_46_im * y_46_im), 0.16666666666666666), (atan2(x_46_im, x_46_re) * y_46_re))), 2.0));
	} 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(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re))))
	tmp = 0.0
	if (y_46_im <= -7.4e+229)
		tmp = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))));
	elseif (y_46_im <= -4.2e+84)
		tmp = t_0;
	elseif (y_46_im <= 7700000.0)
		tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(atan(x_46_im, x_46_re)) ^ y_46_im)) * sqrt((cos(fma(Float64(log(hypot(x_46_im, x_46_re)) * (cbrt(y_46_im) ^ 2.0)), (Float64(y_46_im * y_46_im) ^ 0.16666666666666666), Float64(atan(x_46_im, x_46_re) * y_46_re))) ^ 2.0)));
	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[(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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -7.4e+229], N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$im, -4.2e+84], t$95$0, If[LessEqual[y$46$im, 7700000.0], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision], y$46$im], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[Power[N[Cos[N[(N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * N[Power[N[Power[y$46$im, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[(y$46$im * y$46$im), $MachinePrecision], 0.16666666666666666], $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $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^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq -7.4 \cdot 10^{+229}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\

\mathbf{elif}\;y.im \leq -4.2 \cdot 10^{+84}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y.im \leq 7700000:\\
\;\;\;\;\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 \sqrt{{\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot {\left(\sqrt[3]{y.im}\right)}^{2}, {\left(y.im \cdot y.im\right)}^{0.16666666666666666}, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)}^{2}}\\

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


\end{array}

Error

Derivation

  1. Split input into 3 regimes
  2. if y.im < -7.40000000000000005e229

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

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

      \[\leadsto e^{\color{blue}{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}} \cdot 1 \]
      Proof
      (*.f64 y.im (neg.f64 (atan2.f64 x.im x.re))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 y.im (atan2.f64 x.im x.re)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (*.f64 y.im (atan2.f64 x.im x.re)))): 0 points increase in error, 0 points decrease in error

    if -7.40000000000000005e229 < y.im < -4.20000000000000037e84 or 7.7e6 < y.im

    1. Initial program 36.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) \]
    2. Taylor expanded in y.im around 0 17.2

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

      \[\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 -4.20000000000000037e84 < y.im < 7.7e6

    1. Initial program 31.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. 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))))): 71 points increase in error, 2 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, 1 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))))): 0 points increase in error, 22 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))))): 85 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.6

      \[\leadsto \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 \color{blue}{\sqrt{{\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\right)}^{2}}} \]
    4. Applied egg-rr34.0

      \[\leadsto \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 \sqrt{{\cos \color{blue}{\left(e^{\left(3 \cdot \log \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\right)\right) \cdot 0.3333333333333333}\right)}}^{2}} \]
    5. Applied egg-rr2.6

      \[\leadsto \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 \sqrt{{\cos \color{blue}{\left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot {\left(\sqrt[3]{y.im}\right)}^{2}, \sqrt[3]{y.im}, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}}^{2}} \]
    6. Applied egg-rr2.7

      \[\leadsto \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 \sqrt{{\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot {\left(\sqrt[3]{y.im}\right)}^{2}, \color{blue}{{\left(y.im \cdot y.im\right)}^{0.16666666666666666}}, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}^{2}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification7.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -7.4 \cdot 10^{+229}:\\ \;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{elif}\;y.im \leq -4.2 \cdot 10^{+84}:\\ \;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{elif}\;y.im \leq 7700000:\\ \;\;\;\;\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 \sqrt{{\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot {\left(\sqrt[3]{y.im}\right)}^{2}, {\left(y.im \cdot y.im\right)}^{0.16666666666666666}, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \end{array} \]

Alternatives

Alternative 1
Error7.4
Cost97804
\[\begin{array}{l} t_0 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{if}\;y.im \leq -7.4 \cdot 10^{+229}:\\ \;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{elif}\;y.im \leq -4.2 \cdot 10^{+84}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq 7700000:\\ \;\;\;\;\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 \sqrt{{\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot {\left({\left(y.im \cdot y.im\right)}^{0.16666666666666666}\right)}^{2}, \sqrt[3]{y.im}, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error7.4
Cost97612
\[\begin{array}{l} t_0 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ t_2 := \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{if}\;y.im \leq -7.4 \cdot 10^{+229}:\\ \;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{elif}\;y.im \leq -4.2 \cdot 10^{+84}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq -7.8 \cdot 10^{+59}:\\ \;\;\;\;t_2 \cdot \sqrt{{\cos \left(\mathsf{fma}\left(t_1 \cdot {\left(\sqrt[3]{y.im}\right)}^{2}, \sqrt[3]{y.im}, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)}^{2}}\\ \mathbf{elif}\;y.im \leq 7700000:\\ \;\;\;\;t_2 \cdot \sqrt{0.5 + 0.5 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(2 \cdot \mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot t_1\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error7.3
Cost85072
\[\begin{array}{l} t_0 := e^{\tan^{-1}_* \frac{x.im}{x.re}}\\ t_1 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{if}\;y.im \leq -7.4 \cdot 10^{+229}:\\ \;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{elif}\;y.im \leq -8.8 \cdot 10^{+63}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq -8 \cdot 10^{+63}:\\ \;\;\;\;{t_0}^{\left(-y.im\right)} \cdot \cos \left({\left(\sqrt{y.im \cdot \log x.im}\right)}^{2}\right)\\ \mathbf{elif}\;y.im \leq 7700000:\\ \;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{t_0}^{y.im}} \cdot \sqrt{0.5 + 0.5 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(2 \cdot \mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error7.3
Cost72272
\[\begin{array}{l} t_0 := e^{\tan^{-1}_* \frac{x.im}{x.re}}\\ t_1 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{if}\;y.im \leq -7.4 \cdot 10^{+229}:\\ \;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{elif}\;y.im \leq -8.8 \cdot 10^{+63}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq -8 \cdot 10^{+63}:\\ \;\;\;\;{t_0}^{\left(-y.im\right)} \cdot \cos \left({\left(\sqrt{y.im \cdot \log x.im}\right)}^{2}\right)\\ \mathbf{elif}\;y.im \leq 7700000:\\ \;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{t_0}^{y.im}} \cdot \sqrt{0.5 + 0.5 \cdot \cos \left(2 \cdot \mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error7.0
Cost65488
\[\begin{array}{l} t_0 := e^{\tan^{-1}_* \frac{x.im}{x.re}}\\ t_1 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{if}\;y.im \leq -7.4 \cdot 10^{+229}:\\ \;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{elif}\;y.im \leq -8.8 \cdot 10^{+63}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq -4 \cdot 10^{+63}:\\ \;\;\;\;{t_0}^{\left(-y.im\right)} \cdot \cos \left({\left(\sqrt{y.im \cdot \log x.im}\right)}^{2}\right)\\ \mathbf{elif}\;y.im \leq 7700000:\\ \;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{t_0}^{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_1\\ \end{array} \]
Alternative 6
Error7.6
Cost59144
\[\begin{array}{l} t_0 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ t_1 := e^{\tan^{-1}_* \frac{x.im}{x.re}}\\ t_2 := {\left(\sqrt[3]{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}\right)}^{3}\\ \mathbf{if}\;y.im \leq -2.3 \cdot 10^{+219}:\\ \;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{elif}\;y.im \leq -0.00040227882250791697:\\ \;\;\;\;t_0 \cdot t_2\\ \mathbf{elif}\;y.im \leq 1.8525839484859087 \cdot 10^{-27}:\\ \;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{t_1}^{y.im}} \cdot \sqrt{0.5 + 0.5 \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(y.re \cdot 2\right)\right)}\\ \mathbf{elif}\;y.im \leq 7700000:\\ \;\;\;\;{t_1}^{\left(-y.im\right)} \cdot t_2\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 7
Error8.1
Cost52748
\[\begin{array}{l} t_0 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ t_1 := e^{\tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{if}\;y.im \leq -7.4 \cdot 10^{+229}:\\ \;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{elif}\;y.im \leq -4.2 \cdot 10^{+84}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq 1.8525839484859087 \cdot 10^{-27}:\\ \;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{t_1}^{y.im}} \cdot \sqrt{0.5 + 0.5 \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(y.re \cdot 2\right)\right)}\\ \mathbf{elif}\;y.im \leq 7700000:\\ \;\;\;\;{t_1}^{\left(-y.im\right)} \cdot {\left(\sqrt[3]{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}\right)}^{3}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 8
Error5.7
Cost45960
\[\begin{array}{l} t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t_0}\\ t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ \mathbf{if}\;y.re \leq -7.195175365582101 \cdot 10^{-13}:\\ \;\;\;\;t_1 \cdot \left(\left(1 + \cos t_2\right) + -1\right)\\ \mathbf{elif}\;y.re \leq 1.0975686458326274 \cdot 10^{-17}:\\ \;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_2\right)\right) \cdot \frac{1}{e^{t_0}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error6.2
Cost40004
\[\begin{array}{l} t_0 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{if}\;y.re \leq -7.195175365582101 \cdot 10^{-13}:\\ \;\;\;\;t_0 \cdot \left(\left(1 + \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) + -1\right)\\ \mathbf{elif}\;y.re \leq 1.0975686458326274 \cdot 10^{-17}:\\ \;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 10
Error6.2
Cost39748
\[\begin{array}{l} t_0 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{if}\;y.re \leq -7.195175365582101 \cdot 10^{-13}:\\ \;\;\;\;t_0 \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;y.re \leq 1.0975686458326274 \cdot 10^{-17}:\\ \;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 11
Error6.2
Cost26760
\[\begin{array}{l} t_0 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{if}\;y.re \leq -7.195175365582101 \cdot 10^{-13}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.re \leq 1.0975686458326274 \cdot 10^{-17}:\\ \;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 12
Error9.8
Cost20172
\[\begin{array}{l} t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := e^{y.re \cdot \log \left(-x.re\right) - t_0}\\ \mathbf{if}\;x.re \leq -5 \cdot 10^{-33}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x.re \leq -1 \cdot 10^{-75}:\\ \;\;\;\;e^{y.re \cdot \log x.im - t_0}\\ \mathbf{elif}\;x.re \leq 0:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log x.re - t_0}\\ \end{array} \]
Alternative 13
Error16.8
Cost20108
\[\begin{array}{l} t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{if}\;x.re \leq -1.55 \cdot 10^{-33}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x.re \leq -9.6 \cdot 10^{-215}:\\ \;\;\;\;e^{y.re \cdot \log x.im - t_0}\\ \mathbf{elif}\;x.re \leq 6.4 \cdot 10^{-305}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log x.re - t_0}\\ \end{array} \]
Alternative 14
Error15.6
Cost19844
\[\begin{array}{l} \mathbf{if}\;x.im \leq 1.25 \cdot 10^{-276}:\\ \;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log x.im - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \end{array} \]
Alternative 15
Error21.2
Cost13120
\[e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)} \]
Alternative 16
Error38.7
Cost64
\[1 \]

Error

Reproduce

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