powComplex, real part

Percentage Accurate: 40.4% → 77.0%
Time: 15.4s
Alternatives: 11
Speedup: 5.7×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\ e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
   (*
    (exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
    (cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
	return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
    real(8), intent (in) :: x_46re
    real(8), intent (in) :: x_46im
    real(8), intent (in) :: y_46re
    real(8), intent (in) :: y_46im
    real(8) :: t_0
    t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
    code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
	return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))
	return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))
	return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re))))
end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
	tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 40.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\ e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
   (*
    (exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
    (cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
	return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
    real(8), intent (in) :: x_46re
    real(8), intent (in) :: x_46im
    real(8), intent (in) :: y_46re
    real(8), intent (in) :: y_46im
    real(8) :: t_0
    t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
    code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
	return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))
	return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))
	return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re))))
end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
	tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}

Alternative 1: 77.0% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(0.5 \cdot y.re\right)}\\ \mathbf{if}\;y.re \leq -1.8 \cdot 10^{-7}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 320000000000:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (* 1.0 (pow (fma x.re x.re (* x.im x.im)) (* 0.5 y.re)))))
   (if (<= y.re -1.8e-7)
     t_0
     (if (<= y.re 320000000000.0)
       (*
        (cos (* (atan2 x.im x.re) y.re))
        (exp (* (atan2 x.im x.re) (- y.im))))
       t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = 1.0 * pow(fma(x_46_re, x_46_re, (x_46_im * x_46_im)), (0.5 * y_46_re));
	double tmp;
	if (y_46_re <= -1.8e-7) {
		tmp = t_0;
	} else if (y_46_re <= 320000000000.0) {
		tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = Float64(1.0 * (fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)) ^ Float64(0.5 * y_46_re)))
	tmp = 0.0
	if (y_46_re <= -1.8e-7)
		tmp = t_0;
	elseif (y_46_re <= 320000000000.0)
		tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))));
	else
		tmp = t_0;
	end
	return tmp
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(1.0 * N[Power[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.8e-7], t$95$0, If[LessEqual[y$46$re, 320000000000.0], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 1 \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(0.5 \cdot y.re\right)}\\
\mathbf{if}\;y.re \leq -1.8 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y.re \leq 320000000000:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y.re < -1.79999999999999997e-7 or 3.2e11 < y.re

    1. Initial program 31.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. Add Preprocessing
    3. Taylor expanded in y.im around 0

      \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
      3. lower-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
      4. lower-sqrt.f64N/A

        \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
      5. +-commutativeN/A

        \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
      6. unpow2N/A

        \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
      7. lower-fma.f64N/A

        \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
      8. unpow2N/A

        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
      9. lower-*.f64N/A

        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
      10. lower-cos.f64N/A

        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
      11. *-commutativeN/A

        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
      12. lower-*.f64N/A

        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
      13. lower-atan2.f6466.0

        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
    5. Applied rewrites66.0%

      \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
    6. Taylor expanded in y.re around 0

      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
    7. Step-by-step derivation
      1. Applied rewrites75.7%

        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
      2. Step-by-step derivation
        1. Applied rewrites75.7%

          \[\leadsto {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)} \cdot 1 \]

        if -1.79999999999999997e-7 < y.re < 3.2e11

        1. Initial program 46.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. Add Preprocessing
        3. Taylor expanded in y.im around 0

          \[\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 \cos \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\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 \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
          2. lower-*.f64N/A

            \[\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 \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
          3. lower-atan2.f6451.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 \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
        5. Applied rewrites51.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 \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
        6. Taylor expanded in y.im around inf

          \[\leadsto e^{\color{blue}{-1 \cdot \left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
        7. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto e^{\color{blue}{\left(-1 \cdot y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
          2. lower-*.f64N/A

            \[\leadsto e^{\color{blue}{\left(-1 \cdot y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
          3. neg-mul-1N/A

            \[\leadsto e^{\color{blue}{\left(\mathsf{neg}\left(y.im\right)\right)} \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
          4. lower-neg.f64N/A

            \[\leadsto e^{\color{blue}{\left(\mathsf{neg}\left(y.im\right)\right)} \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
          5. lower-atan2.f6478.9

            \[\leadsto e^{\left(-y.im\right) \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
        8. Applied rewrites78.9%

          \[\leadsto e^{\color{blue}{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
      3. Recombined 2 regimes into one program.
      4. Final simplification77.2%

        \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -1.8 \cdot 10^{-7}:\\ \;\;\;\;1 \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(0.5 \cdot y.re\right)}\\ \mathbf{elif}\;y.re \leq 320000000000:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(0.5 \cdot y.re\right)}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 2: 77.0% accurate, 3.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(0.5 \cdot y.re\right)}\\ \mathbf{if}\;y.re \leq -1.8 \cdot 10^{-7}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 350000000000:\\ \;\;\;\;1 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (x.re x.im y.re y.im)
       :precision binary64
       (let* ((t_0 (* 1.0 (pow (fma x.re x.re (* x.im x.im)) (* 0.5 y.re)))))
         (if (<= y.re -1.8e-7)
           t_0
           (if (<= y.re 350000000000.0)
             (* 1.0 (exp (* (atan2 x.im x.re) (- y.im))))
             t_0))))
      double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
      	double t_0 = 1.0 * pow(fma(x_46_re, x_46_re, (x_46_im * x_46_im)), (0.5 * y_46_re));
      	double tmp;
      	if (y_46_re <= -1.8e-7) {
      		tmp = t_0;
      	} else if (y_46_re <= 350000000000.0) {
      		tmp = 1.0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      function code(x_46_re, x_46_im, y_46_re, y_46_im)
      	t_0 = Float64(1.0 * (fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)) ^ Float64(0.5 * y_46_re)))
      	tmp = 0.0
      	if (y_46_re <= -1.8e-7)
      		tmp = t_0;
      	elseif (y_46_re <= 350000000000.0)
      		tmp = Float64(1.0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(1.0 * N[Power[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.8e-7], t$95$0, If[LessEqual[y$46$re, 350000000000.0], N[(1.0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := 1 \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(0.5 \cdot y.re\right)}\\
      \mathbf{if}\;y.re \leq -1.8 \cdot 10^{-7}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;y.re \leq 350000000000:\\
      \;\;\;\;1 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y.re < -1.79999999999999997e-7 or 3.5e11 < y.re

        1. Initial program 31.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. Add Preprocessing
        3. Taylor expanded in y.im around 0

          \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
          3. lower-pow.f64N/A

            \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
          4. lower-sqrt.f64N/A

            \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
          5. +-commutativeN/A

            \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
          6. unpow2N/A

            \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
          7. lower-fma.f64N/A

            \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
          8. unpow2N/A

            \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
          9. lower-*.f64N/A

            \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
          10. lower-cos.f64N/A

            \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
          11. *-commutativeN/A

            \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
          12. lower-*.f64N/A

            \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
          13. lower-atan2.f6466.0

            \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
        5. Applied rewrites66.0%

          \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
        6. Taylor expanded in y.re around 0

          \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
        7. Step-by-step derivation
          1. Applied rewrites75.7%

            \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
          2. Step-by-step derivation
            1. Applied rewrites75.7%

              \[\leadsto {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)} \cdot 1 \]

            if -1.79999999999999997e-7 < y.re < 3.5e11

            1. Initial program 46.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. Add Preprocessing
            3. Taylor expanded in y.re around 0

              \[\leadsto \color{blue}{\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot e^{\mathsf{neg}\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{e^{\mathsf{neg}\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)} \]
              2. lower-*.f64N/A

                \[\leadsto \color{blue}{e^{\mathsf{neg}\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)} \]
              3. lower-exp.f64N/A

                \[\leadsto \color{blue}{e^{\mathsf{neg}\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \cdot \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \]
              4. distribute-lft-neg-inN/A

                \[\leadsto e^{\color{blue}{\left(\mathsf{neg}\left(y.im\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \]
              5. neg-mul-1N/A

                \[\leadsto e^{\color{blue}{\left(-1 \cdot y.im\right)} \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \]
              6. lower-*.f64N/A

                \[\leadsto e^{\color{blue}{\left(-1 \cdot y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \]
              7. neg-mul-1N/A

                \[\leadsto e^{\color{blue}{\left(\mathsf{neg}\left(y.im\right)\right)} \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \]
              8. lower-neg.f64N/A

                \[\leadsto e^{\color{blue}{\left(\mathsf{neg}\left(y.im\right)\right)} \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \]
              9. lower-atan2.f64N/A

                \[\leadsto e^{\left(\mathsf{neg}\left(y.im\right)\right) \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \]
              10. lower-cos.f64N/A

                \[\leadsto e^{\left(\mathsf{neg}\left(y.im\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \color{blue}{\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)} \]
              11. *-commutativeN/A

                \[\leadsto e^{\left(\mathsf{neg}\left(y.im\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
              12. lower-*.f64N/A

                \[\leadsto e^{\left(\mathsf{neg}\left(y.im\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
            5. Applied rewrites45.8%

              \[\leadsto \color{blue}{e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\log \left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right) \cdot y.im\right)} \]
            6. Taylor expanded in y.im around 0

              \[\leadsto e^{\left(\mathsf{neg}\left(y.im\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot 1 \]
            7. Step-by-step derivation
              1. Applied rewrites78.9%

                \[\leadsto e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot 1 \]
            8. Recombined 2 regimes into one program.
            9. Final simplification77.2%

              \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -1.8 \cdot 10^{-7}:\\ \;\;\;\;1 \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(0.5 \cdot y.re\right)}\\ \mathbf{elif}\;y.re \leq 350000000000:\\ \;\;\;\;1 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(0.5 \cdot y.re\right)}\\ \end{array} \]
            10. Add Preprocessing

            Alternative 3: 61.9% accurate, 4.5× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\\ \mathbf{if}\;y.re \leq -2.1 \cdot 10^{-6}:\\ \;\;\;\;1 \cdot {t\_0}^{\left(0.5 \cdot y.re\right)}\\ \mathbf{elif}\;y.re \leq 3.1 \cdot 10^{-5}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;{\left(t\_0 \cdot t\_0\right)}^{\left(0.25 \cdot y.re\right)} \cdot 1\\ \end{array} \end{array} \]
            (FPCore (x.re x.im y.re y.im)
             :precision binary64
             (let* ((t_0 (fma x.re x.re (* x.im x.im))))
               (if (<= y.re -2.1e-6)
                 (* 1.0 (pow t_0 (* 0.5 y.re)))
                 (if (<= y.re 3.1e-5) 1.0 (* (pow (* t_0 t_0) (* 0.25 y.re)) 1.0)))))
            double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
            	double t_0 = fma(x_46_re, x_46_re, (x_46_im * x_46_im));
            	double tmp;
            	if (y_46_re <= -2.1e-6) {
            		tmp = 1.0 * pow(t_0, (0.5 * y_46_re));
            	} else if (y_46_re <= 3.1e-5) {
            		tmp = 1.0;
            	} else {
            		tmp = pow((t_0 * t_0), (0.25 * y_46_re)) * 1.0;
            	}
            	return tmp;
            }
            
            function code(x_46_re, x_46_im, y_46_re, y_46_im)
            	t_0 = fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im))
            	tmp = 0.0
            	if (y_46_re <= -2.1e-6)
            		tmp = Float64(1.0 * (t_0 ^ Float64(0.5 * y_46_re)));
            	elseif (y_46_re <= 3.1e-5)
            		tmp = 1.0;
            	else
            		tmp = Float64((Float64(t_0 * t_0) ^ Float64(0.25 * y_46_re)) * 1.0);
            	end
            	return tmp
            end
            
            code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.1e-6], N[(1.0 * N[Power[t$95$0, N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.1e-5], 1.0, N[(N[Power[N[(t$95$0 * t$95$0), $MachinePrecision], N[(0.25 * y$46$re), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\\
            \mathbf{if}\;y.re \leq -2.1 \cdot 10^{-6}:\\
            \;\;\;\;1 \cdot {t\_0}^{\left(0.5 \cdot y.re\right)}\\
            
            \mathbf{elif}\;y.re \leq 3.1 \cdot 10^{-5}:\\
            \;\;\;\;1\\
            
            \mathbf{else}:\\
            \;\;\;\;{\left(t\_0 \cdot t\_0\right)}^{\left(0.25 \cdot y.re\right)} \cdot 1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if y.re < -2.0999999999999998e-6

              1. Initial program 32.3%

                \[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. Add Preprocessing
              3. Taylor expanded in y.im around 0

                \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                2. lower-*.f64N/A

                  \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                3. lower-pow.f64N/A

                  \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                4. lower-sqrt.f64N/A

                  \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                5. +-commutativeN/A

                  \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                6. unpow2N/A

                  \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                7. lower-fma.f64N/A

                  \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                8. unpow2N/A

                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                9. lower-*.f64N/A

                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                10. lower-cos.f64N/A

                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                11. *-commutativeN/A

                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                12. lower-*.f64N/A

                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                13. lower-atan2.f6476.0

                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
              5. Applied rewrites76.0%

                \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
              6. Taylor expanded in y.re around 0

                \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
              7. Step-by-step derivation
                1. Applied rewrites79.2%

                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                2. Step-by-step derivation
                  1. Applied rewrites79.2%

                    \[\leadsto {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)} \cdot 1 \]

                  if -2.0999999999999998e-6 < y.re < 3.10000000000000014e-5

                  1. Initial program 45.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. Add Preprocessing
                  3. Taylor expanded in y.im around 0

                    \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                  4. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                    2. lower-*.f64N/A

                      \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                    3. lower-pow.f64N/A

                      \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    4. lower-sqrt.f64N/A

                      \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    5. +-commutativeN/A

                      \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    6. unpow2N/A

                      \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    7. lower-fma.f64N/A

                      \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    8. unpow2N/A

                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    9. lower-*.f64N/A

                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    10. lower-cos.f64N/A

                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                    11. *-commutativeN/A

                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                    12. lower-*.f64N/A

                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                    13. lower-atan2.f6437.1

                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                  5. Applied rewrites37.1%

                    \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                  6. Taylor expanded in y.re around 0

                    \[\leadsto 1 \]
                  7. Step-by-step derivation
                    1. Applied rewrites48.5%

                      \[\leadsto 1 \]

                    if 3.10000000000000014e-5 < y.re

                    1. Initial program 31.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. Add Preprocessing
                    3. Taylor expanded in y.im around 0

                      \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                    4. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                      2. lower-*.f64N/A

                        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                      3. lower-pow.f64N/A

                        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                      4. lower-sqrt.f64N/A

                        \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                      5. +-commutativeN/A

                        \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                      6. unpow2N/A

                        \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                      7. lower-fma.f64N/A

                        \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                      8. unpow2N/A

                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                      9. lower-*.f64N/A

                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                      10. lower-cos.f64N/A

                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                      11. *-commutativeN/A

                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                      12. lower-*.f64N/A

                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                      13. lower-atan2.f6457.4

                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                    5. Applied rewrites57.4%

                      \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                    6. Taylor expanded in y.re around 0

                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                    7. Step-by-step derivation
                      1. Applied rewrites70.8%

                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                      2. Step-by-step derivation
                        1. Applied rewrites70.8%

                          \[\leadsto {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)} \cdot 1 \]
                        2. Step-by-step derivation
                          1. Applied rewrites72.1%

                            \[\leadsto {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right) \cdot \mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.25\right)} \cdot 1 \]
                        3. Recombined 3 regimes into one program.
                        4. Final simplification62.8%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -2.1 \cdot 10^{-6}:\\ \;\;\;\;1 \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(0.5 \cdot y.re\right)}\\ \mathbf{elif}\;y.re \leq 3.1 \cdot 10^{-5}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right) \cdot \mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(0.25 \cdot y.re\right)} \cdot 1\\ \end{array} \]
                        5. Add Preprocessing

                        Alternative 4: 61.9% accurate, 5.0× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(0.5 \cdot y.re\right)}\\ \mathbf{if}\;y.re \leq -2.1 \cdot 10^{-6}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 4 \cdot 10^{-14}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                        (FPCore (x.re x.im y.re y.im)
                         :precision binary64
                         (let* ((t_0 (* 1.0 (pow (fma x.re x.re (* x.im x.im)) (* 0.5 y.re)))))
                           (if (<= y.re -2.1e-6) t_0 (if (<= y.re 4e-14) 1.0 t_0))))
                        double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                        	double t_0 = 1.0 * pow(fma(x_46_re, x_46_re, (x_46_im * x_46_im)), (0.5 * y_46_re));
                        	double tmp;
                        	if (y_46_re <= -2.1e-6) {
                        		tmp = t_0;
                        	} else if (y_46_re <= 4e-14) {
                        		tmp = 1.0;
                        	} else {
                        		tmp = t_0;
                        	}
                        	return tmp;
                        }
                        
                        function code(x_46_re, x_46_im, y_46_re, y_46_im)
                        	t_0 = Float64(1.0 * (fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)) ^ Float64(0.5 * y_46_re)))
                        	tmp = 0.0
                        	if (y_46_re <= -2.1e-6)
                        		tmp = t_0;
                        	elseif (y_46_re <= 4e-14)
                        		tmp = 1.0;
                        	else
                        		tmp = t_0;
                        	end
                        	return tmp
                        end
                        
                        code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(1.0 * N[Power[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.1e-6], t$95$0, If[LessEqual[y$46$re, 4e-14], 1.0, t$95$0]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_0 := 1 \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(0.5 \cdot y.re\right)}\\
                        \mathbf{if}\;y.re \leq -2.1 \cdot 10^{-6}:\\
                        \;\;\;\;t\_0\\
                        
                        \mathbf{elif}\;y.re \leq 4 \cdot 10^{-14}:\\
                        \;\;\;\;1\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;t\_0\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if y.re < -2.0999999999999998e-6 or 4e-14 < y.re

                          1. Initial program 32.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. Add Preprocessing
                          3. Taylor expanded in y.im around 0

                            \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                          4. Step-by-step derivation
                            1. *-commutativeN/A

                              \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                            2. lower-*.f64N/A

                              \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                            3. lower-pow.f64N/A

                              \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                            4. lower-sqrt.f64N/A

                              \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                            5. +-commutativeN/A

                              \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                            6. unpow2N/A

                              \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                            7. lower-fma.f64N/A

                              \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                            8. unpow2N/A

                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                            9. lower-*.f64N/A

                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                            10. lower-cos.f64N/A

                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                            11. *-commutativeN/A

                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                            12. lower-*.f64N/A

                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                            13. lower-atan2.f6466.1

                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                          5. Applied rewrites66.1%

                            \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                          6. Taylor expanded in y.re around 0

                            \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                          7. Step-by-step derivation
                            1. Applied rewrites74.8%

                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                            2. Step-by-step derivation
                              1. Applied rewrites74.8%

                                \[\leadsto {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)} \cdot 1 \]

                              if -2.0999999999999998e-6 < y.re < 4e-14

                              1. Initial program 45.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. Add Preprocessing
                              3. Taylor expanded in y.im around 0

                                \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                              4. Step-by-step derivation
                                1. *-commutativeN/A

                                  \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                2. lower-*.f64N/A

                                  \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                3. lower-pow.f64N/A

                                  \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                4. lower-sqrt.f64N/A

                                  \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                5. +-commutativeN/A

                                  \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                6. unpow2N/A

                                  \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                7. lower-fma.f64N/A

                                  \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                8. unpow2N/A

                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                9. lower-*.f64N/A

                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                10. lower-cos.f64N/A

                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                11. *-commutativeN/A

                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                12. lower-*.f64N/A

                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                13. lower-atan2.f6436.5

                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                              5. Applied rewrites36.5%

                                \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                              6. Taylor expanded in y.re around 0

                                \[\leadsto 1 \]
                              7. Step-by-step derivation
                                1. Applied rewrites48.3%

                                  \[\leadsto 1 \]
                              8. Recombined 2 regimes into one program.
                              9. Final simplification62.6%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -2.1 \cdot 10^{-6}:\\ \;\;\;\;1 \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(0.5 \cdot y.re\right)}\\ \mathbf{elif}\;y.re \leq 4 \cdot 10^{-14}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;1 \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(0.5 \cdot y.re\right)}\\ \end{array} \]
                              10. Add Preprocessing

                              Alternative 5: 54.5% accurate, 5.3× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x.im \leq -2.35 \cdot 10^{-119}:\\ \;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\ \mathbf{elif}\;x.im \leq 2.55 \cdot 10^{-9}:\\ \;\;\;\;{\left(x.re \cdot x.re\right)}^{\left(0.5 \cdot y.re\right)} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(0.5 \cdot y.re\right)} \cdot 1\\ \end{array} \end{array} \]
                              (FPCore (x.re x.im y.re y.im)
                               :precision binary64
                               (if (<= x.im -2.35e-119)
                                 (* (pow (- x.im) y.re) 1.0)
                                 (if (<= x.im 2.55e-9)
                                   (* (pow (* x.re x.re) (* 0.5 y.re)) 1.0)
                                   (* (pow (* x.im x.im) (* 0.5 y.re)) 1.0))))
                              double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                              	double tmp;
                              	if (x_46_im <= -2.35e-119) {
                              		tmp = pow(-x_46_im, y_46_re) * 1.0;
                              	} else if (x_46_im <= 2.55e-9) {
                              		tmp = pow((x_46_re * x_46_re), (0.5 * y_46_re)) * 1.0;
                              	} else {
                              		tmp = pow((x_46_im * x_46_im), (0.5 * y_46_re)) * 1.0;
                              	}
                              	return tmp;
                              }
                              
                              real(8) function code(x_46re, x_46im, y_46re, y_46im)
                                  real(8), intent (in) :: x_46re
                                  real(8), intent (in) :: x_46im
                                  real(8), intent (in) :: y_46re
                                  real(8), intent (in) :: y_46im
                                  real(8) :: tmp
                                  if (x_46im <= (-2.35d-119)) then
                                      tmp = (-x_46im ** y_46re) * 1.0d0
                                  else if (x_46im <= 2.55d-9) then
                                      tmp = ((x_46re * x_46re) ** (0.5d0 * y_46re)) * 1.0d0
                                  else
                                      tmp = ((x_46im * x_46im) ** (0.5d0 * y_46re)) * 1.0d0
                                  end if
                                  code = tmp
                              end function
                              
                              public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                              	double tmp;
                              	if (x_46_im <= -2.35e-119) {
                              		tmp = Math.pow(-x_46_im, y_46_re) * 1.0;
                              	} else if (x_46_im <= 2.55e-9) {
                              		tmp = Math.pow((x_46_re * x_46_re), (0.5 * y_46_re)) * 1.0;
                              	} else {
                              		tmp = Math.pow((x_46_im * x_46_im), (0.5 * y_46_re)) * 1.0;
                              	}
                              	return tmp;
                              }
                              
                              def code(x_46_re, x_46_im, y_46_re, y_46_im):
                              	tmp = 0
                              	if x_46_im <= -2.35e-119:
                              		tmp = math.pow(-x_46_im, y_46_re) * 1.0
                              	elif x_46_im <= 2.55e-9:
                              		tmp = math.pow((x_46_re * x_46_re), (0.5 * y_46_re)) * 1.0
                              	else:
                              		tmp = math.pow((x_46_im * x_46_im), (0.5 * y_46_re)) * 1.0
                              	return tmp
                              
                              function code(x_46_re, x_46_im, y_46_re, y_46_im)
                              	tmp = 0.0
                              	if (x_46_im <= -2.35e-119)
                              		tmp = Float64((Float64(-x_46_im) ^ y_46_re) * 1.0);
                              	elseif (x_46_im <= 2.55e-9)
                              		tmp = Float64((Float64(x_46_re * x_46_re) ^ Float64(0.5 * y_46_re)) * 1.0);
                              	else
                              		tmp = Float64((Float64(x_46_im * x_46_im) ^ Float64(0.5 * y_46_re)) * 1.0);
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                              	tmp = 0.0;
                              	if (x_46_im <= -2.35e-119)
                              		tmp = (-x_46_im ^ y_46_re) * 1.0;
                              	elseif (x_46_im <= 2.55e-9)
                              		tmp = ((x_46_re * x_46_re) ^ (0.5 * y_46_re)) * 1.0;
                              	else
                              		tmp = ((x_46_im * x_46_im) ^ (0.5 * y_46_re)) * 1.0;
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, -2.35e-119], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$im, 2.55e-9], N[(N[Power[N[(x$46$re * x$46$re), $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[N[(x$46$im * x$46$im), $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;x.im \leq -2.35 \cdot 10^{-119}:\\
                              \;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\
                              
                              \mathbf{elif}\;x.im \leq 2.55 \cdot 10^{-9}:\\
                              \;\;\;\;{\left(x.re \cdot x.re\right)}^{\left(0.5 \cdot y.re\right)} \cdot 1\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(0.5 \cdot y.re\right)} \cdot 1\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 3 regimes
                              2. if x.im < -2.35000000000000001e-119

                                1. Initial program 32.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. Add Preprocessing
                                3. Taylor expanded in y.im around 0

                                  \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                4. Step-by-step derivation
                                  1. *-commutativeN/A

                                    \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                  2. lower-*.f64N/A

                                    \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                  3. lower-pow.f64N/A

                                    \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                  4. lower-sqrt.f64N/A

                                    \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                  5. +-commutativeN/A

                                    \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                  6. unpow2N/A

                                    \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                  7. lower-fma.f64N/A

                                    \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                  8. unpow2N/A

                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                  9. lower-*.f64N/A

                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                  10. lower-cos.f64N/A

                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                  11. *-commutativeN/A

                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                  12. lower-*.f64N/A

                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                  13. lower-atan2.f6450.8

                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                5. Applied rewrites50.8%

                                  \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                6. Taylor expanded in y.re around 0

                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                7. Step-by-step derivation
                                  1. Applied rewrites55.3%

                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                  2. Taylor expanded in x.im around -inf

                                    \[\leadsto {\left(-1 \cdot x.im\right)}^{y.re} \cdot 1 \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites63.2%

                                      \[\leadsto {\left(-x.im\right)}^{y.re} \cdot 1 \]

                                    if -2.35000000000000001e-119 < x.im < 2.55000000000000009e-9

                                    1. Initial program 48.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. Add Preprocessing
                                    3. Taylor expanded in y.im around 0

                                      \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                    4. Step-by-step derivation
                                      1. *-commutativeN/A

                                        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                      2. lower-*.f64N/A

                                        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                      3. lower-pow.f64N/A

                                        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                      4. lower-sqrt.f64N/A

                                        \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                      5. +-commutativeN/A

                                        \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                      6. unpow2N/A

                                        \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                      7. lower-fma.f64N/A

                                        \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                      8. unpow2N/A

                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                      9. lower-*.f64N/A

                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                      10. lower-cos.f64N/A

                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                      11. *-commutativeN/A

                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                      12. lower-*.f64N/A

                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                      13. lower-atan2.f6451.1

                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                    5. Applied rewrites51.1%

                                      \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                    6. Taylor expanded in y.re around 0

                                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites56.9%

                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                      2. Step-by-step derivation
                                        1. Applied rewrites56.9%

                                          \[\leadsto {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)} \cdot 1 \]
                                        2. Taylor expanded in x.im around 0

                                          \[\leadsto {\left({x.re}^{2}\right)}^{\left(y.re \cdot \frac{1}{2}\right)} \cdot 1 \]
                                        3. Step-by-step derivation
                                          1. Applied rewrites58.8%

                                            \[\leadsto {\left(x.re \cdot x.re\right)}^{\left(y.re \cdot 0.5\right)} \cdot 1 \]

                                          if 2.55000000000000009e-9 < x.im

                                          1. Initial program 29.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. Add Preprocessing
                                          3. Taylor expanded in y.im around 0

                                            \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                          4. Step-by-step derivation
                                            1. *-commutativeN/A

                                              \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                            2. lower-*.f64N/A

                                              \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                            3. lower-pow.f64N/A

                                              \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                            4. lower-sqrt.f64N/A

                                              \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                            5. +-commutativeN/A

                                              \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                            6. unpow2N/A

                                              \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                            7. lower-fma.f64N/A

                                              \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                            8. unpow2N/A

                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                            9. lower-*.f64N/A

                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                            10. lower-cos.f64N/A

                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                            11. *-commutativeN/A

                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                            12. lower-*.f64N/A

                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                            13. lower-atan2.f6457.1

                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                          5. Applied rewrites57.1%

                                            \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                          6. Taylor expanded in y.re around 0

                                            \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                          7. Step-by-step derivation
                                            1. Applied rewrites60.3%

                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                            2. Step-by-step derivation
                                              1. Applied rewrites60.3%

                                                \[\leadsto {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)} \cdot 1 \]
                                              2. Taylor expanded in x.im around inf

                                                \[\leadsto {\left({x.im}^{2}\right)}^{\left(y.re \cdot \frac{1}{2}\right)} \cdot 1 \]
                                              3. Step-by-step derivation
                                                1. Applied rewrites65.0%

                                                  \[\leadsto {\left(x.im \cdot x.im\right)}^{\left(y.re \cdot 0.5\right)} \cdot 1 \]
                                              4. Recombined 3 regimes into one program.
                                              5. Final simplification61.8%

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;x.im \leq -2.35 \cdot 10^{-119}:\\ \;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\ \mathbf{elif}\;x.im \leq 2.55 \cdot 10^{-9}:\\ \;\;\;\;{\left(x.re \cdot x.re\right)}^{\left(0.5 \cdot y.re\right)} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(0.5 \cdot y.re\right)} \cdot 1\\ \end{array} \]
                                              6. Add Preprocessing

                                              Alternative 6: 57.7% accurate, 5.3× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x.re \leq -185000:\\ \;\;\;\;{\left(-x.re\right)}^{y.re} \cdot 1\\ \mathbf{elif}\;x.re \leq 1.75 \cdot 10^{+27}:\\ \;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(0.5 \cdot y.re\right)} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;{x.re}^{y.re} \cdot 1\\ \end{array} \end{array} \]
                                              (FPCore (x.re x.im y.re y.im)
                                               :precision binary64
                                               (if (<= x.re -185000.0)
                                                 (* (pow (- x.re) y.re) 1.0)
                                                 (if (<= x.re 1.75e+27)
                                                   (* (pow (* x.im x.im) (* 0.5 y.re)) 1.0)
                                                   (* (pow x.re y.re) 1.0))))
                                              double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                              	double tmp;
                                              	if (x_46_re <= -185000.0) {
                                              		tmp = pow(-x_46_re, y_46_re) * 1.0;
                                              	} else if (x_46_re <= 1.75e+27) {
                                              		tmp = pow((x_46_im * x_46_im), (0.5 * y_46_re)) * 1.0;
                                              	} else {
                                              		tmp = pow(x_46_re, y_46_re) * 1.0;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              real(8) function code(x_46re, x_46im, y_46re, y_46im)
                                                  real(8), intent (in) :: x_46re
                                                  real(8), intent (in) :: x_46im
                                                  real(8), intent (in) :: y_46re
                                                  real(8), intent (in) :: y_46im
                                                  real(8) :: tmp
                                                  if (x_46re <= (-185000.0d0)) then
                                                      tmp = (-x_46re ** y_46re) * 1.0d0
                                                  else if (x_46re <= 1.75d+27) then
                                                      tmp = ((x_46im * x_46im) ** (0.5d0 * y_46re)) * 1.0d0
                                                  else
                                                      tmp = (x_46re ** y_46re) * 1.0d0
                                                  end if
                                                  code = tmp
                                              end function
                                              
                                              public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                              	double tmp;
                                              	if (x_46_re <= -185000.0) {
                                              		tmp = Math.pow(-x_46_re, y_46_re) * 1.0;
                                              	} else if (x_46_re <= 1.75e+27) {
                                              		tmp = Math.pow((x_46_im * x_46_im), (0.5 * y_46_re)) * 1.0;
                                              	} else {
                                              		tmp = Math.pow(x_46_re, y_46_re) * 1.0;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                              	tmp = 0
                                              	if x_46_re <= -185000.0:
                                              		tmp = math.pow(-x_46_re, y_46_re) * 1.0
                                              	elif x_46_re <= 1.75e+27:
                                              		tmp = math.pow((x_46_im * x_46_im), (0.5 * y_46_re)) * 1.0
                                              	else:
                                              		tmp = math.pow(x_46_re, y_46_re) * 1.0
                                              	return tmp
                                              
                                              function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                              	tmp = 0.0
                                              	if (x_46_re <= -185000.0)
                                              		tmp = Float64((Float64(-x_46_re) ^ y_46_re) * 1.0);
                                              	elseif (x_46_re <= 1.75e+27)
                                              		tmp = Float64((Float64(x_46_im * x_46_im) ^ Float64(0.5 * y_46_re)) * 1.0);
                                              	else
                                              		tmp = Float64((x_46_re ^ y_46_re) * 1.0);
                                              	end
                                              	return tmp
                                              end
                                              
                                              function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                              	tmp = 0.0;
                                              	if (x_46_re <= -185000.0)
                                              		tmp = (-x_46_re ^ y_46_re) * 1.0;
                                              	elseif (x_46_re <= 1.75e+27)
                                              		tmp = ((x_46_im * x_46_im) ^ (0.5 * y_46_re)) * 1.0;
                                              	else
                                              		tmp = (x_46_re ^ y_46_re) * 1.0;
                                              	end
                                              	tmp_2 = tmp;
                                              end
                                              
                                              code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, -185000.0], N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$re, 1.75e+27], N[(N[Power[N[(x$46$im * x$46$im), $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              \mathbf{if}\;x.re \leq -185000:\\
                                              \;\;\;\;{\left(-x.re\right)}^{y.re} \cdot 1\\
                                              
                                              \mathbf{elif}\;x.re \leq 1.75 \cdot 10^{+27}:\\
                                              \;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(0.5 \cdot y.re\right)} \cdot 1\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;{x.re}^{y.re} \cdot 1\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 3 regimes
                                              2. if x.re < -185000

                                                1. Initial program 23.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. Add Preprocessing
                                                3. Taylor expanded in y.im around 0

                                                  \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                4. Step-by-step derivation
                                                  1. *-commutativeN/A

                                                    \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                  2. lower-*.f64N/A

                                                    \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                  3. lower-pow.f64N/A

                                                    \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                  4. lower-sqrt.f64N/A

                                                    \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                  5. +-commutativeN/A

                                                    \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                  6. unpow2N/A

                                                    \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                  7. lower-fma.f64N/A

                                                    \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                  8. unpow2N/A

                                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                  9. lower-*.f64N/A

                                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                  10. lower-cos.f64N/A

                                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                  11. *-commutativeN/A

                                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                  12. lower-*.f64N/A

                                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                  13. lower-atan2.f6452.2

                                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                5. Applied rewrites52.2%

                                                  \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                6. Taylor expanded in y.re around 0

                                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                7. Step-by-step derivation
                                                  1. Applied rewrites56.9%

                                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                  2. Taylor expanded in x.re around -inf

                                                    \[\leadsto {\left(-1 \cdot x.re\right)}^{y.re} \cdot 1 \]
                                                  3. Step-by-step derivation
                                                    1. Applied rewrites63.5%

                                                      \[\leadsto {\left(-x.re\right)}^{y.re} \cdot 1 \]

                                                    if -185000 < x.re < 1.7500000000000001e27

                                                    1. Initial program 50.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. Add Preprocessing
                                                    3. Taylor expanded in y.im around 0

                                                      \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                    4. Step-by-step derivation
                                                      1. *-commutativeN/A

                                                        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                      2. lower-*.f64N/A

                                                        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                      3. lower-pow.f64N/A

                                                        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                      4. lower-sqrt.f64N/A

                                                        \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                      5. +-commutativeN/A

                                                        \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                      6. unpow2N/A

                                                        \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                      7. lower-fma.f64N/A

                                                        \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                      8. unpow2N/A

                                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                      9. lower-*.f64N/A

                                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                      10. lower-cos.f64N/A

                                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                      11. *-commutativeN/A

                                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                      12. lower-*.f64N/A

                                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                      13. lower-atan2.f6451.1

                                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                    5. Applied rewrites51.1%

                                                      \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                    6. Taylor expanded in y.re around 0

                                                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                    7. Step-by-step derivation
                                                      1. Applied rewrites57.9%

                                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                      2. Step-by-step derivation
                                                        1. Applied rewrites57.9%

                                                          \[\leadsto {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)} \cdot 1 \]
                                                        2. Taylor expanded in x.im around inf

                                                          \[\leadsto {\left({x.im}^{2}\right)}^{\left(y.re \cdot \frac{1}{2}\right)} \cdot 1 \]
                                                        3. Step-by-step derivation
                                                          1. Applied rewrites60.1%

                                                            \[\leadsto {\left(x.im \cdot x.im\right)}^{\left(y.re \cdot 0.5\right)} \cdot 1 \]

                                                          if 1.7500000000000001e27 < x.re

                                                          1. Initial program 26.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. Add Preprocessing
                                                          3. Taylor expanded in y.im around 0

                                                            \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                          4. Step-by-step derivation
                                                            1. *-commutativeN/A

                                                              \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                            2. lower-*.f64N/A

                                                              \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                            3. lower-pow.f64N/A

                                                              \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                            4. lower-sqrt.f64N/A

                                                              \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                            5. +-commutativeN/A

                                                              \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                            6. unpow2N/A

                                                              \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                            7. lower-fma.f64N/A

                                                              \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                            8. unpow2N/A

                                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                            9. lower-*.f64N/A

                                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                            10. lower-cos.f64N/A

                                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                            11. *-commutativeN/A

                                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                            12. lower-*.f64N/A

                                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                            13. lower-atan2.f6455.7

                                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                          5. Applied rewrites55.7%

                                                            \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                          6. Taylor expanded in y.re around 0

                                                            \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                          7. Step-by-step derivation
                                                            1. Applied rewrites55.7%

                                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                            2. Taylor expanded in x.im around 0

                                                              \[\leadsto {x.re}^{y.re} \cdot 1 \]
                                                            3. Step-by-step derivation
                                                              1. Applied rewrites60.9%

                                                                \[\leadsto {x.re}^{y.re} \cdot 1 \]
                                                            4. Recombined 3 regimes into one program.
                                                            5. Final simplification61.1%

                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;x.re \leq -185000:\\ \;\;\;\;{\left(-x.re\right)}^{y.re} \cdot 1\\ \mathbf{elif}\;x.re \leq 1.75 \cdot 10^{+27}:\\ \;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(0.5 \cdot y.re\right)} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;{x.re}^{y.re} \cdot 1\\ \end{array} \]
                                                            6. Add Preprocessing

                                                            Alternative 7: 55.0% accurate, 5.6× speedup?

                                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x.im \leq -4.4 \cdot 10^{-79}:\\ \;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\ \mathbf{elif}\;x.im \leq 1.7 \cdot 10^{-14}:\\ \;\;\;\;{\left(-x.re\right)}^{y.re} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;{x.im}^{y.re} \cdot 1\\ \end{array} \end{array} \]
                                                            (FPCore (x.re x.im y.re y.im)
                                                             :precision binary64
                                                             (if (<= x.im -4.4e-79)
                                                               (* (pow (- x.im) y.re) 1.0)
                                                               (if (<= x.im 1.7e-14) (* (pow (- x.re) y.re) 1.0) (* (pow x.im y.re) 1.0))))
                                                            double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                            	double tmp;
                                                            	if (x_46_im <= -4.4e-79) {
                                                            		tmp = pow(-x_46_im, y_46_re) * 1.0;
                                                            	} else if (x_46_im <= 1.7e-14) {
                                                            		tmp = pow(-x_46_re, y_46_re) * 1.0;
                                                            	} else {
                                                            		tmp = pow(x_46_im, y_46_re) * 1.0;
                                                            	}
                                                            	return tmp;
                                                            }
                                                            
                                                            real(8) function code(x_46re, x_46im, y_46re, y_46im)
                                                                real(8), intent (in) :: x_46re
                                                                real(8), intent (in) :: x_46im
                                                                real(8), intent (in) :: y_46re
                                                                real(8), intent (in) :: y_46im
                                                                real(8) :: tmp
                                                                if (x_46im <= (-4.4d-79)) then
                                                                    tmp = (-x_46im ** y_46re) * 1.0d0
                                                                else if (x_46im <= 1.7d-14) then
                                                                    tmp = (-x_46re ** y_46re) * 1.0d0
                                                                else
                                                                    tmp = (x_46im ** y_46re) * 1.0d0
                                                                end if
                                                                code = tmp
                                                            end function
                                                            
                                                            public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                            	double tmp;
                                                            	if (x_46_im <= -4.4e-79) {
                                                            		tmp = Math.pow(-x_46_im, y_46_re) * 1.0;
                                                            	} else if (x_46_im <= 1.7e-14) {
                                                            		tmp = Math.pow(-x_46_re, y_46_re) * 1.0;
                                                            	} else {
                                                            		tmp = Math.pow(x_46_im, y_46_re) * 1.0;
                                                            	}
                                                            	return tmp;
                                                            }
                                                            
                                                            def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                                            	tmp = 0
                                                            	if x_46_im <= -4.4e-79:
                                                            		tmp = math.pow(-x_46_im, y_46_re) * 1.0
                                                            	elif x_46_im <= 1.7e-14:
                                                            		tmp = math.pow(-x_46_re, y_46_re) * 1.0
                                                            	else:
                                                            		tmp = math.pow(x_46_im, y_46_re) * 1.0
                                                            	return tmp
                                                            
                                                            function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                            	tmp = 0.0
                                                            	if (x_46_im <= -4.4e-79)
                                                            		tmp = Float64((Float64(-x_46_im) ^ y_46_re) * 1.0);
                                                            	elseif (x_46_im <= 1.7e-14)
                                                            		tmp = Float64((Float64(-x_46_re) ^ y_46_re) * 1.0);
                                                            	else
                                                            		tmp = Float64((x_46_im ^ y_46_re) * 1.0);
                                                            	end
                                                            	return tmp
                                                            end
                                                            
                                                            function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                            	tmp = 0.0;
                                                            	if (x_46_im <= -4.4e-79)
                                                            		tmp = (-x_46_im ^ y_46_re) * 1.0;
                                                            	elseif (x_46_im <= 1.7e-14)
                                                            		tmp = (-x_46_re ^ y_46_re) * 1.0;
                                                            	else
                                                            		tmp = (x_46_im ^ y_46_re) * 1.0;
                                                            	end
                                                            	tmp_2 = tmp;
                                                            end
                                                            
                                                            code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, -4.4e-79], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$im, 1.7e-14], N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
                                                            
                                                            \begin{array}{l}
                                                            
                                                            \\
                                                            \begin{array}{l}
                                                            \mathbf{if}\;x.im \leq -4.4 \cdot 10^{-79}:\\
                                                            \;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\
                                                            
                                                            \mathbf{elif}\;x.im \leq 1.7 \cdot 10^{-14}:\\
                                                            \;\;\;\;{\left(-x.re\right)}^{y.re} \cdot 1\\
                                                            
                                                            \mathbf{else}:\\
                                                            \;\;\;\;{x.im}^{y.re} \cdot 1\\
                                                            
                                                            
                                                            \end{array}
                                                            \end{array}
                                                            
                                                            Derivation
                                                            1. Split input into 3 regimes
                                                            2. if x.im < -4.3999999999999998e-79

                                                              1. Initial program 26.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. Add Preprocessing
                                                              3. Taylor expanded in y.im around 0

                                                                \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                              4. Step-by-step derivation
                                                                1. *-commutativeN/A

                                                                  \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                2. lower-*.f64N/A

                                                                  \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                3. lower-pow.f64N/A

                                                                  \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                4. lower-sqrt.f64N/A

                                                                  \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                5. +-commutativeN/A

                                                                  \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                6. unpow2N/A

                                                                  \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                7. lower-fma.f64N/A

                                                                  \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                8. unpow2N/A

                                                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                9. lower-*.f64N/A

                                                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                10. lower-cos.f64N/A

                                                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                11. *-commutativeN/A

                                                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                12. lower-*.f64N/A

                                                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                13. lower-atan2.f6448.3

                                                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                              5. Applied rewrites48.3%

                                                                \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                              6. Taylor expanded in y.re around 0

                                                                \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                              7. Step-by-step derivation
                                                                1. Applied rewrites53.4%

                                                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                                2. Taylor expanded in x.im around -inf

                                                                  \[\leadsto {\left(-1 \cdot x.im\right)}^{y.re} \cdot 1 \]
                                                                3. Step-by-step derivation
                                                                  1. Applied rewrites61.3%

                                                                    \[\leadsto {\left(-x.im\right)}^{y.re} \cdot 1 \]

                                                                  if -4.3999999999999998e-79 < x.im < 1.70000000000000001e-14

                                                                  1. Initial program 50.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. Add Preprocessing
                                                                  3. Taylor expanded in y.im around 0

                                                                    \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                  4. Step-by-step derivation
                                                                    1. *-commutativeN/A

                                                                      \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                    2. lower-*.f64N/A

                                                                      \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                    3. lower-pow.f64N/A

                                                                      \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                    4. lower-sqrt.f64N/A

                                                                      \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                    5. +-commutativeN/A

                                                                      \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                    6. unpow2N/A

                                                                      \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                    7. lower-fma.f64N/A

                                                                      \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                    8. unpow2N/A

                                                                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                    9. lower-*.f64N/A

                                                                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                    10. lower-cos.f64N/A

                                                                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                    11. *-commutativeN/A

                                                                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                    12. lower-*.f64N/A

                                                                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                    13. lower-atan2.f6453.2

                                                                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                                  5. Applied rewrites53.2%

                                                                    \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                  6. Taylor expanded in y.re around 0

                                                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                                  7. Step-by-step derivation
                                                                    1. Applied rewrites58.5%

                                                                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                                    2. Taylor expanded in x.re around -inf

                                                                      \[\leadsto {\left(-1 \cdot x.re\right)}^{y.re} \cdot 1 \]
                                                                    3. Step-by-step derivation
                                                                      1. Applied rewrites55.9%

                                                                        \[\leadsto {\left(-x.re\right)}^{y.re} \cdot 1 \]

                                                                      if 1.70000000000000001e-14 < x.im

                                                                      1. Initial program 30.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. Add Preprocessing
                                                                      3. Taylor expanded in y.im around 0

                                                                        \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                      4. Step-by-step derivation
                                                                        1. *-commutativeN/A

                                                                          \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                        2. lower-*.f64N/A

                                                                          \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                        3. lower-pow.f64N/A

                                                                          \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                        4. lower-sqrt.f64N/A

                                                                          \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                        5. +-commutativeN/A

                                                                          \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                        6. unpow2N/A

                                                                          \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                        7. lower-fma.f64N/A

                                                                          \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                        8. unpow2N/A

                                                                          \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                        9. lower-*.f64N/A

                                                                          \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                        10. lower-cos.f64N/A

                                                                          \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                        11. *-commutativeN/A

                                                                          \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                        12. lower-*.f64N/A

                                                                          \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                        13. lower-atan2.f6456.2

                                                                          \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                                      5. Applied rewrites56.2%

                                                                        \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                      6. Taylor expanded in y.re around 0

                                                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                                      7. Step-by-step derivation
                                                                        1. Applied rewrites59.4%

                                                                          \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                                        2. Taylor expanded in x.re around 0

                                                                          \[\leadsto {x.im}^{y.re} \cdot 1 \]
                                                                        3. Step-by-step derivation
                                                                          1. Applied rewrites62.6%

                                                                            \[\leadsto {x.im}^{y.re} \cdot 1 \]
                                                                        4. Recombined 3 regimes into one program.
                                                                        5. Add Preprocessing

                                                                        Alternative 8: 54.9% accurate, 5.7× speedup?

                                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x.im \leq -8.5 \cdot 10^{-130}:\\ \;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\ \mathbf{elif}\;x.im \leq 6.4 \cdot 10^{-15}:\\ \;\;\;\;{x.re}^{y.re} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;{x.im}^{y.re} \cdot 1\\ \end{array} \end{array} \]
                                                                        (FPCore (x.re x.im y.re y.im)
                                                                         :precision binary64
                                                                         (if (<= x.im -8.5e-130)
                                                                           (* (pow (- x.im) y.re) 1.0)
                                                                           (if (<= x.im 6.4e-15) (* (pow x.re y.re) 1.0) (* (pow x.im y.re) 1.0))))
                                                                        double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                        	double tmp;
                                                                        	if (x_46_im <= -8.5e-130) {
                                                                        		tmp = pow(-x_46_im, y_46_re) * 1.0;
                                                                        	} else if (x_46_im <= 6.4e-15) {
                                                                        		tmp = pow(x_46_re, y_46_re) * 1.0;
                                                                        	} else {
                                                                        		tmp = pow(x_46_im, y_46_re) * 1.0;
                                                                        	}
                                                                        	return tmp;
                                                                        }
                                                                        
                                                                        real(8) function code(x_46re, x_46im, y_46re, y_46im)
                                                                            real(8), intent (in) :: x_46re
                                                                            real(8), intent (in) :: x_46im
                                                                            real(8), intent (in) :: y_46re
                                                                            real(8), intent (in) :: y_46im
                                                                            real(8) :: tmp
                                                                            if (x_46im <= (-8.5d-130)) then
                                                                                tmp = (-x_46im ** y_46re) * 1.0d0
                                                                            else if (x_46im <= 6.4d-15) then
                                                                                tmp = (x_46re ** y_46re) * 1.0d0
                                                                            else
                                                                                tmp = (x_46im ** y_46re) * 1.0d0
                                                                            end if
                                                                            code = tmp
                                                                        end function
                                                                        
                                                                        public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                        	double tmp;
                                                                        	if (x_46_im <= -8.5e-130) {
                                                                        		tmp = Math.pow(-x_46_im, y_46_re) * 1.0;
                                                                        	} else if (x_46_im <= 6.4e-15) {
                                                                        		tmp = Math.pow(x_46_re, y_46_re) * 1.0;
                                                                        	} else {
                                                                        		tmp = Math.pow(x_46_im, y_46_re) * 1.0;
                                                                        	}
                                                                        	return tmp;
                                                                        }
                                                                        
                                                                        def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                                                        	tmp = 0
                                                                        	if x_46_im <= -8.5e-130:
                                                                        		tmp = math.pow(-x_46_im, y_46_re) * 1.0
                                                                        	elif x_46_im <= 6.4e-15:
                                                                        		tmp = math.pow(x_46_re, y_46_re) * 1.0
                                                                        	else:
                                                                        		tmp = math.pow(x_46_im, y_46_re) * 1.0
                                                                        	return tmp
                                                                        
                                                                        function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                        	tmp = 0.0
                                                                        	if (x_46_im <= -8.5e-130)
                                                                        		tmp = Float64((Float64(-x_46_im) ^ y_46_re) * 1.0);
                                                                        	elseif (x_46_im <= 6.4e-15)
                                                                        		tmp = Float64((x_46_re ^ y_46_re) * 1.0);
                                                                        	else
                                                                        		tmp = Float64((x_46_im ^ y_46_re) * 1.0);
                                                                        	end
                                                                        	return tmp
                                                                        end
                                                                        
                                                                        function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                        	tmp = 0.0;
                                                                        	if (x_46_im <= -8.5e-130)
                                                                        		tmp = (-x_46_im ^ y_46_re) * 1.0;
                                                                        	elseif (x_46_im <= 6.4e-15)
                                                                        		tmp = (x_46_re ^ y_46_re) * 1.0;
                                                                        	else
                                                                        		tmp = (x_46_im ^ y_46_re) * 1.0;
                                                                        	end
                                                                        	tmp_2 = tmp;
                                                                        end
                                                                        
                                                                        code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, -8.5e-130], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$im, 6.4e-15], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
                                                                        
                                                                        \begin{array}{l}
                                                                        
                                                                        \\
                                                                        \begin{array}{l}
                                                                        \mathbf{if}\;x.im \leq -8.5 \cdot 10^{-130}:\\
                                                                        \;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\
                                                                        
                                                                        \mathbf{elif}\;x.im \leq 6.4 \cdot 10^{-15}:\\
                                                                        \;\;\;\;{x.re}^{y.re} \cdot 1\\
                                                                        
                                                                        \mathbf{else}:\\
                                                                        \;\;\;\;{x.im}^{y.re} \cdot 1\\
                                                                        
                                                                        
                                                                        \end{array}
                                                                        \end{array}
                                                                        
                                                                        Derivation
                                                                        1. Split input into 3 regimes
                                                                        2. if x.im < -8.50000000000000033e-130

                                                                          1. Initial program 32.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. Add Preprocessing
                                                                          3. Taylor expanded in y.im around 0

                                                                            \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                          4. Step-by-step derivation
                                                                            1. *-commutativeN/A

                                                                              \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                            2. lower-*.f64N/A

                                                                              \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                            3. lower-pow.f64N/A

                                                                              \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                            4. lower-sqrt.f64N/A

                                                                              \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                            5. +-commutativeN/A

                                                                              \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                            6. unpow2N/A

                                                                              \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                            7. lower-fma.f64N/A

                                                                              \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                            8. unpow2N/A

                                                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                            9. lower-*.f64N/A

                                                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                            10. lower-cos.f64N/A

                                                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                            11. *-commutativeN/A

                                                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                            12. lower-*.f64N/A

                                                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                            13. lower-atan2.f6450.8

                                                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                                          5. Applied rewrites50.8%

                                                                            \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                          6. Taylor expanded in y.re around 0

                                                                            \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                                          7. Step-by-step derivation
                                                                            1. Applied rewrites55.3%

                                                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                                            2. Taylor expanded in x.im around -inf

                                                                              \[\leadsto {\left(-1 \cdot x.im\right)}^{y.re} \cdot 1 \]
                                                                            3. Step-by-step derivation
                                                                              1. Applied rewrites63.2%

                                                                                \[\leadsto {\left(-x.im\right)}^{y.re} \cdot 1 \]

                                                                              if -8.50000000000000033e-130 < x.im < 6.3999999999999999e-15

                                                                              1. Initial program 48.3%

                                                                                \[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. Add Preprocessing
                                                                              3. Taylor expanded in y.im around 0

                                                                                \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                              4. Step-by-step derivation
                                                                                1. *-commutativeN/A

                                                                                  \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                2. lower-*.f64N/A

                                                                                  \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                3. lower-pow.f64N/A

                                                                                  \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                4. lower-sqrt.f64N/A

                                                                                  \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                5. +-commutativeN/A

                                                                                  \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                6. unpow2N/A

                                                                                  \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                7. lower-fma.f64N/A

                                                                                  \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                8. unpow2N/A

                                                                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                9. lower-*.f64N/A

                                                                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                10. lower-cos.f64N/A

                                                                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                11. *-commutativeN/A

                                                                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                12. lower-*.f64N/A

                                                                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                13. lower-atan2.f6451.6

                                                                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                                              5. Applied rewrites51.6%

                                                                                \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                              6. Taylor expanded in y.re around 0

                                                                                \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                                              7. Step-by-step derivation
                                                                                1. Applied rewrites57.4%

                                                                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                                                2. Taylor expanded in x.im around 0

                                                                                  \[\leadsto {x.re}^{y.re} \cdot 1 \]
                                                                                3. Step-by-step derivation
                                                                                  1. Applied rewrites49.5%

                                                                                    \[\leadsto {x.re}^{y.re} \cdot 1 \]

                                                                                  if 6.3999999999999999e-15 < x.im

                                                                                  1. Initial program 30.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. Add Preprocessing
                                                                                  3. Taylor expanded in y.im around 0

                                                                                    \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                                  4. Step-by-step derivation
                                                                                    1. *-commutativeN/A

                                                                                      \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                    2. lower-*.f64N/A

                                                                                      \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                    3. lower-pow.f64N/A

                                                                                      \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                    4. lower-sqrt.f64N/A

                                                                                      \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                    5. +-commutativeN/A

                                                                                      \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                    6. unpow2N/A

                                                                                      \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                    7. lower-fma.f64N/A

                                                                                      \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                    8. unpow2N/A

                                                                                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                    9. lower-*.f64N/A

                                                                                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                    10. lower-cos.f64N/A

                                                                                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                    11. *-commutativeN/A

                                                                                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                    12. lower-*.f64N/A

                                                                                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                    13. lower-atan2.f6456.2

                                                                                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                                                  5. Applied rewrites56.2%

                                                                                    \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                  6. Taylor expanded in y.re around 0

                                                                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                                                  7. Step-by-step derivation
                                                                                    1. Applied rewrites59.4%

                                                                                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                                                    2. Taylor expanded in x.re around 0

                                                                                      \[\leadsto {x.im}^{y.re} \cdot 1 \]
                                                                                    3. Step-by-step derivation
                                                                                      1. Applied rewrites62.6%

                                                                                        \[\leadsto {x.im}^{y.re} \cdot 1 \]
                                                                                    4. Recombined 3 regimes into one program.
                                                                                    5. Add Preprocessing

                                                                                    Alternative 9: 51.9% accurate, 5.7× speedup?

                                                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -44:\\ \;\;\;\;{x.re}^{y.re} \cdot 1\\ \mathbf{elif}\;y.re \leq 4.3 \cdot 10^{+15}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;{x.im}^{y.re} \cdot 1\\ \end{array} \end{array} \]
                                                                                    (FPCore (x.re x.im y.re y.im)
                                                                                     :precision binary64
                                                                                     (if (<= y.re -44.0)
                                                                                       (* (pow x.re y.re) 1.0)
                                                                                       (if (<= y.re 4.3e+15) 1.0 (* (pow x.im y.re) 1.0))))
                                                                                    double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                    	double tmp;
                                                                                    	if (y_46_re <= -44.0) {
                                                                                    		tmp = pow(x_46_re, y_46_re) * 1.0;
                                                                                    	} else if (y_46_re <= 4.3e+15) {
                                                                                    		tmp = 1.0;
                                                                                    	} else {
                                                                                    		tmp = pow(x_46_im, y_46_re) * 1.0;
                                                                                    	}
                                                                                    	return tmp;
                                                                                    }
                                                                                    
                                                                                    real(8) function code(x_46re, x_46im, y_46re, y_46im)
                                                                                        real(8), intent (in) :: x_46re
                                                                                        real(8), intent (in) :: x_46im
                                                                                        real(8), intent (in) :: y_46re
                                                                                        real(8), intent (in) :: y_46im
                                                                                        real(8) :: tmp
                                                                                        if (y_46re <= (-44.0d0)) then
                                                                                            tmp = (x_46re ** y_46re) * 1.0d0
                                                                                        else if (y_46re <= 4.3d+15) then
                                                                                            tmp = 1.0d0
                                                                                        else
                                                                                            tmp = (x_46im ** y_46re) * 1.0d0
                                                                                        end if
                                                                                        code = tmp
                                                                                    end function
                                                                                    
                                                                                    public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                    	double tmp;
                                                                                    	if (y_46_re <= -44.0) {
                                                                                    		tmp = Math.pow(x_46_re, y_46_re) * 1.0;
                                                                                    	} else if (y_46_re <= 4.3e+15) {
                                                                                    		tmp = 1.0;
                                                                                    	} else {
                                                                                    		tmp = Math.pow(x_46_im, y_46_re) * 1.0;
                                                                                    	}
                                                                                    	return tmp;
                                                                                    }
                                                                                    
                                                                                    def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                                                                    	tmp = 0
                                                                                    	if y_46_re <= -44.0:
                                                                                    		tmp = math.pow(x_46_re, y_46_re) * 1.0
                                                                                    	elif y_46_re <= 4.3e+15:
                                                                                    		tmp = 1.0
                                                                                    	else:
                                                                                    		tmp = math.pow(x_46_im, y_46_re) * 1.0
                                                                                    	return tmp
                                                                                    
                                                                                    function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                    	tmp = 0.0
                                                                                    	if (y_46_re <= -44.0)
                                                                                    		tmp = Float64((x_46_re ^ y_46_re) * 1.0);
                                                                                    	elseif (y_46_re <= 4.3e+15)
                                                                                    		tmp = 1.0;
                                                                                    	else
                                                                                    		tmp = Float64((x_46_im ^ y_46_re) * 1.0);
                                                                                    	end
                                                                                    	return tmp
                                                                                    end
                                                                                    
                                                                                    function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                    	tmp = 0.0;
                                                                                    	if (y_46_re <= -44.0)
                                                                                    		tmp = (x_46_re ^ y_46_re) * 1.0;
                                                                                    	elseif (y_46_re <= 4.3e+15)
                                                                                    		tmp = 1.0;
                                                                                    	else
                                                                                    		tmp = (x_46_im ^ y_46_re) * 1.0;
                                                                                    	end
                                                                                    	tmp_2 = tmp;
                                                                                    end
                                                                                    
                                                                                    code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -44.0], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[y$46$re, 4.3e+15], 1.0, N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
                                                                                    
                                                                                    \begin{array}{l}
                                                                                    
                                                                                    \\
                                                                                    \begin{array}{l}
                                                                                    \mathbf{if}\;y.re \leq -44:\\
                                                                                    \;\;\;\;{x.re}^{y.re} \cdot 1\\
                                                                                    
                                                                                    \mathbf{elif}\;y.re \leq 4.3 \cdot 10^{+15}:\\
                                                                                    \;\;\;\;1\\
                                                                                    
                                                                                    \mathbf{else}:\\
                                                                                    \;\;\;\;{x.im}^{y.re} \cdot 1\\
                                                                                    
                                                                                    
                                                                                    \end{array}
                                                                                    \end{array}
                                                                                    
                                                                                    Derivation
                                                                                    1. Split input into 3 regimes
                                                                                    2. if y.re < -44

                                                                                      1. Initial program 31.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. Add Preprocessing
                                                                                      3. Taylor expanded in y.im around 0

                                                                                        \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                                      4. Step-by-step derivation
                                                                                        1. *-commutativeN/A

                                                                                          \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                        2. lower-*.f64N/A

                                                                                          \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                        3. lower-pow.f64N/A

                                                                                          \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                        4. lower-sqrt.f64N/A

                                                                                          \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                        5. +-commutativeN/A

                                                                                          \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                        6. unpow2N/A

                                                                                          \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                        7. lower-fma.f64N/A

                                                                                          \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                        8. unpow2N/A

                                                                                          \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                        9. lower-*.f64N/A

                                                                                          \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                        10. lower-cos.f64N/A

                                                                                          \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                        11. *-commutativeN/A

                                                                                          \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                        12. lower-*.f64N/A

                                                                                          \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                        13. lower-atan2.f6475.6

                                                                                          \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                                                      5. Applied rewrites75.6%

                                                                                        \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                      6. Taylor expanded in y.re around 0

                                                                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                                                      7. Step-by-step derivation
                                                                                        1. Applied rewrites78.8%

                                                                                          \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                                                        2. Taylor expanded in x.im around 0

                                                                                          \[\leadsto {x.re}^{y.re} \cdot 1 \]
                                                                                        3. Step-by-step derivation
                                                                                          1. Applied rewrites64.2%

                                                                                            \[\leadsto {x.re}^{y.re} \cdot 1 \]

                                                                                          if -44 < y.re < 4.3e15

                                                                                          1. Initial program 45.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. Add Preprocessing
                                                                                          3. Taylor expanded in y.im around 0

                                                                                            \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                                          4. Step-by-step derivation
                                                                                            1. *-commutativeN/A

                                                                                              \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                            2. lower-*.f64N/A

                                                                                              \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                            3. lower-pow.f64N/A

                                                                                              \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                            4. lower-sqrt.f64N/A

                                                                                              \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                            5. +-commutativeN/A

                                                                                              \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                            6. unpow2N/A

                                                                                              \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                            7. lower-fma.f64N/A

                                                                                              \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                            8. unpow2N/A

                                                                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                            9. lower-*.f64N/A

                                                                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                            10. lower-cos.f64N/A

                                                                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                            11. *-commutativeN/A

                                                                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                            12. lower-*.f64N/A

                                                                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                            13. lower-atan2.f6437.2

                                                                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                                                          5. Applied rewrites37.2%

                                                                                            \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                          6. Taylor expanded in y.re around 0

                                                                                            \[\leadsto 1 \]
                                                                                          7. Step-by-step derivation
                                                                                            1. Applied rewrites46.6%

                                                                                              \[\leadsto 1 \]

                                                                                            if 4.3e15 < y.re

                                                                                            1. Initial program 31.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. Add Preprocessing
                                                                                            3. Taylor expanded in y.im around 0

                                                                                              \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                                            4. Step-by-step derivation
                                                                                              1. *-commutativeN/A

                                                                                                \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                              2. lower-*.f64N/A

                                                                                                \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                              3. lower-pow.f64N/A

                                                                                                \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                              4. lower-sqrt.f64N/A

                                                                                                \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                              5. +-commutativeN/A

                                                                                                \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                              6. unpow2N/A

                                                                                                \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                              7. lower-fma.f64N/A

                                                                                                \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                              8. unpow2N/A

                                                                                                \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                              9. lower-*.f64N/A

                                                                                                \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                              10. lower-cos.f64N/A

                                                                                                \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                              11. *-commutativeN/A

                                                                                                \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                              12. lower-*.f64N/A

                                                                                                \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                              13. lower-atan2.f6459.2

                                                                                                \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                                                            5. Applied rewrites59.2%

                                                                                              \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                            6. Taylor expanded in y.re around 0

                                                                                              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                                                            7. Step-by-step derivation
                                                                                              1. Applied rewrites74.7%

                                                                                                \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                                                              2. Taylor expanded in x.re around 0

                                                                                                \[\leadsto {x.im}^{y.re} \cdot 1 \]
                                                                                              3. Step-by-step derivation
                                                                                                1. Applied rewrites56.8%

                                                                                                  \[\leadsto {x.im}^{y.re} \cdot 1 \]
                                                                                              4. Recombined 3 regimes into one program.
                                                                                              5. Add Preprocessing

                                                                                              Alternative 10: 51.2% accurate, 5.7× speedup?

                                                                                              \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x.im}^{y.re} \cdot 1\\ \mathbf{if}\;y.re \leq -430:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 4.3 \cdot 10^{+15}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                                                                              (FPCore (x.re x.im y.re y.im)
                                                                                               :precision binary64
                                                                                               (let* ((t_0 (* (pow x.im y.re) 1.0)))
                                                                                                 (if (<= y.re -430.0) t_0 (if (<= y.re 4.3e+15) 1.0 t_0))))
                                                                                              double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                              	double t_0 = pow(x_46_im, y_46_re) * 1.0;
                                                                                              	double tmp;
                                                                                              	if (y_46_re <= -430.0) {
                                                                                              		tmp = t_0;
                                                                                              	} else if (y_46_re <= 4.3e+15) {
                                                                                              		tmp = 1.0;
                                                                                              	} else {
                                                                                              		tmp = t_0;
                                                                                              	}
                                                                                              	return tmp;
                                                                                              }
                                                                                              
                                                                                              real(8) function code(x_46re, x_46im, y_46re, y_46im)
                                                                                                  real(8), intent (in) :: x_46re
                                                                                                  real(8), intent (in) :: x_46im
                                                                                                  real(8), intent (in) :: y_46re
                                                                                                  real(8), intent (in) :: y_46im
                                                                                                  real(8) :: t_0
                                                                                                  real(8) :: tmp
                                                                                                  t_0 = (x_46im ** y_46re) * 1.0d0
                                                                                                  if (y_46re <= (-430.0d0)) then
                                                                                                      tmp = t_0
                                                                                                  else if (y_46re <= 4.3d+15) then
                                                                                                      tmp = 1.0d0
                                                                                                  else
                                                                                                      tmp = t_0
                                                                                                  end if
                                                                                                  code = tmp
                                                                                              end function
                                                                                              
                                                                                              public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                              	double t_0 = Math.pow(x_46_im, y_46_re) * 1.0;
                                                                                              	double tmp;
                                                                                              	if (y_46_re <= -430.0) {
                                                                                              		tmp = t_0;
                                                                                              	} else if (y_46_re <= 4.3e+15) {
                                                                                              		tmp = 1.0;
                                                                                              	} else {
                                                                                              		tmp = t_0;
                                                                                              	}
                                                                                              	return tmp;
                                                                                              }
                                                                                              
                                                                                              def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                                                                              	t_0 = math.pow(x_46_im, y_46_re) * 1.0
                                                                                              	tmp = 0
                                                                                              	if y_46_re <= -430.0:
                                                                                              		tmp = t_0
                                                                                              	elif y_46_re <= 4.3e+15:
                                                                                              		tmp = 1.0
                                                                                              	else:
                                                                                              		tmp = t_0
                                                                                              	return tmp
                                                                                              
                                                                                              function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                              	t_0 = Float64((x_46_im ^ y_46_re) * 1.0)
                                                                                              	tmp = 0.0
                                                                                              	if (y_46_re <= -430.0)
                                                                                              		tmp = t_0;
                                                                                              	elseif (y_46_re <= 4.3e+15)
                                                                                              		tmp = 1.0;
                                                                                              	else
                                                                                              		tmp = t_0;
                                                                                              	end
                                                                                              	return tmp
                                                                                              end
                                                                                              
                                                                                              function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                              	t_0 = (x_46_im ^ y_46_re) * 1.0;
                                                                                              	tmp = 0.0;
                                                                                              	if (y_46_re <= -430.0)
                                                                                              		tmp = t_0;
                                                                                              	elseif (y_46_re <= 4.3e+15)
                                                                                              		tmp = 1.0;
                                                                                              	else
                                                                                              		tmp = t_0;
                                                                                              	end
                                                                                              	tmp_2 = tmp;
                                                                                              end
                                                                                              
                                                                                              code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[y$46$re, -430.0], t$95$0, If[LessEqual[y$46$re, 4.3e+15], 1.0, t$95$0]]]
                                                                                              
                                                                                              \begin{array}{l}
                                                                                              
                                                                                              \\
                                                                                              \begin{array}{l}
                                                                                              t_0 := {x.im}^{y.re} \cdot 1\\
                                                                                              \mathbf{if}\;y.re \leq -430:\\
                                                                                              \;\;\;\;t\_0\\
                                                                                              
                                                                                              \mathbf{elif}\;y.re \leq 4.3 \cdot 10^{+15}:\\
                                                                                              \;\;\;\;1\\
                                                                                              
                                                                                              \mathbf{else}:\\
                                                                                              \;\;\;\;t\_0\\
                                                                                              
                                                                                              
                                                                                              \end{array}
                                                                                              \end{array}
                                                                                              
                                                                                              Derivation
                                                                                              1. Split input into 2 regimes
                                                                                              2. if y.re < -430 or 4.3e15 < y.re

                                                                                                1. Initial program 30.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. Add Preprocessing
                                                                                                3. Taylor expanded in y.im around 0

                                                                                                  \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                                                4. Step-by-step derivation
                                                                                                  1. *-commutativeN/A

                                                                                                    \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                                  2. lower-*.f64N/A

                                                                                                    \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                                  3. lower-pow.f64N/A

                                                                                                    \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                                  4. lower-sqrt.f64N/A

                                                                                                    \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                                  5. +-commutativeN/A

                                                                                                    \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                                  6. unpow2N/A

                                                                                                    \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                                  7. lower-fma.f64N/A

                                                                                                    \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                                  8. unpow2N/A

                                                                                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                                  9. lower-*.f64N/A

                                                                                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                                  10. lower-cos.f64N/A

                                                                                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                                  11. *-commutativeN/A

                                                                                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                                  12. lower-*.f64N/A

                                                                                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                                  13. lower-atan2.f6466.5

                                                                                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                                                                5. Applied rewrites66.5%

                                                                                                  \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                                6. Taylor expanded in y.re around 0

                                                                                                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                                                                7. Step-by-step derivation
                                                                                                  1. Applied rewrites76.4%

                                                                                                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot 1 \]
                                                                                                  2. Taylor expanded in x.re around 0

                                                                                                    \[\leadsto {x.im}^{y.re} \cdot 1 \]
                                                                                                  3. Step-by-step derivation
                                                                                                    1. Applied rewrites55.5%

                                                                                                      \[\leadsto {x.im}^{y.re} \cdot 1 \]

                                                                                                    if -430 < y.re < 4.3e15

                                                                                                    1. Initial program 46.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. Add Preprocessing
                                                                                                    3. Taylor expanded in y.im around 0

                                                                                                      \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                                                    4. Step-by-step derivation
                                                                                                      1. *-commutativeN/A

                                                                                                        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                                      2. lower-*.f64N/A

                                                                                                        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                                      3. lower-pow.f64N/A

                                                                                                        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                                      4. lower-sqrt.f64N/A

                                                                                                        \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                                      5. +-commutativeN/A

                                                                                                        \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                                      6. unpow2N/A

                                                                                                        \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                                      7. lower-fma.f64N/A

                                                                                                        \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                                      8. unpow2N/A

                                                                                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                                      9. lower-*.f64N/A

                                                                                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                                      10. lower-cos.f64N/A

                                                                                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                                      11. *-commutativeN/A

                                                                                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                                      12. lower-*.f64N/A

                                                                                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                                      13. lower-atan2.f6437.7

                                                                                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                                                                    5. Applied rewrites37.7%

                                                                                                      \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                                    6. Taylor expanded in y.re around 0

                                                                                                      \[\leadsto 1 \]
                                                                                                    7. Step-by-step derivation
                                                                                                      1. Applied rewrites46.2%

                                                                                                        \[\leadsto 1 \]
                                                                                                    8. Recombined 2 regimes into one program.
                                                                                                    9. Add Preprocessing

                                                                                                    Alternative 11: 25.5% accurate, 680.0× speedup?

                                                                                                    \[\begin{array}{l} \\ 1 \end{array} \]
                                                                                                    (FPCore (x.re x.im y.re y.im) :precision binary64 1.0)
                                                                                                    double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                                    	return 1.0;
                                                                                                    }
                                                                                                    
                                                                                                    real(8) function code(x_46re, x_46im, y_46re, y_46im)
                                                                                                        real(8), intent (in) :: x_46re
                                                                                                        real(8), intent (in) :: x_46im
                                                                                                        real(8), intent (in) :: y_46re
                                                                                                        real(8), intent (in) :: y_46im
                                                                                                        code = 1.0d0
                                                                                                    end function
                                                                                                    
                                                                                                    public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                                    	return 1.0;
                                                                                                    }
                                                                                                    
                                                                                                    def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                                                                                    	return 1.0
                                                                                                    
                                                                                                    function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                                    	return 1.0
                                                                                                    end
                                                                                                    
                                                                                                    function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                                    	tmp = 1.0;
                                                                                                    end
                                                                                                    
                                                                                                    code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 1.0
                                                                                                    
                                                                                                    \begin{array}{l}
                                                                                                    
                                                                                                    \\
                                                                                                    1
                                                                                                    \end{array}
                                                                                                    
                                                                                                    Derivation
                                                                                                    1. Initial program 38.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. Add Preprocessing
                                                                                                    3. Taylor expanded in y.im around 0

                                                                                                      \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                                                    4. Step-by-step derivation
                                                                                                      1. *-commutativeN/A

                                                                                                        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                                      2. lower-*.f64N/A

                                                                                                        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                                      3. lower-pow.f64N/A

                                                                                                        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                                      4. lower-sqrt.f64N/A

                                                                                                        \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                                      5. +-commutativeN/A

                                                                                                        \[\leadsto {\left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                                      6. unpow2N/A

                                                                                                        \[\leadsto {\left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                                      7. lower-fma.f64N/A

                                                                                                        \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.re, x.re, {x.im}^{2}\right)}}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                                      8. unpow2N/A

                                                                                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                                      9. lower-*.f64N/A

                                                                                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, \color{blue}{x.im \cdot x.im}\right)}\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                                                                                      10. lower-cos.f64N/A

                                                                                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                                      11. *-commutativeN/A

                                                                                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                                      12. lower-*.f64N/A

                                                                                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                                      13. lower-atan2.f6452.5

                                                                                                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                                                                    5. Applied rewrites52.5%

                                                                                                      \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                                    6. Taylor expanded in y.re around 0

                                                                                                      \[\leadsto 1 \]
                                                                                                    7. Step-by-step derivation
                                                                                                      1. Applied rewrites23.9%

                                                                                                        \[\leadsto 1 \]
                                                                                                      2. Add Preprocessing

                                                                                                      Reproduce

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