powComplex, real part

Percentage Accurate: 41.6% → 78.1%
Time: 18.6s
Alternatives: 16
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 16 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: 41.6% 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: 78.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ t_1 := e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ t_2 := e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{if}\;y.re \leq -9 \cdot 10^{+20}:\\ \;\;\;\;\cos t\_0 \cdot t\_2\\ \mathbf{elif}\;y.re \leq 6.2 \cdot 10^{-167}:\\ \;\;\;\;t\_1 \cdot \cos \left(\log \left(\sqrt{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{0.25}}\right) \cdot y.im\right)\\ \mathbf{elif}\;y.re \leq 5600:\\ \;\;\;\;t\_1 \cdot \cos \left(t\_0 + \log \left({\left(e^{0.5}\right)}^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}\right) \cdot y.im\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right) \cdot t\_2\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (* (atan2 x.im x.re) y.re))
        (t_1 (exp (* (- y.im) (atan2 x.im x.re))))
        (t_2
         (exp
          (-
           (* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
           (* (atan2 x.im x.re) y.im)))))
   (if (<= y.re -9e+20)
     (* (cos t_0) t_2)
     (if (<= y.re 6.2e-167)
       (* t_1 (cos (* (log (sqrt (pow (hypot x.im x.re) 0.25))) y.im)))
       (if (<= y.re 5600.0)
         (*
          t_1
          (cos (+ t_0 (* (log (pow (exp 0.5) (log (hypot x.re x.im)))) y.im))))
         (* (cos (* (log (sqrt (hypot x.re x.im))) y.im)) t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
	double t_1 = exp((-y_46_im * atan2(x_46_im, x_46_re)));
	double t_2 = exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
	double tmp;
	if (y_46_re <= -9e+20) {
		tmp = cos(t_0) * t_2;
	} else if (y_46_re <= 6.2e-167) {
		tmp = t_1 * cos((log(sqrt(pow(hypot(x_46_im, x_46_re), 0.25))) * y_46_im));
	} else if (y_46_re <= 5600.0) {
		tmp = t_1 * cos((t_0 + (log(pow(exp(0.5), log(hypot(x_46_re, x_46_im)))) * y_46_im)));
	} else {
		tmp = cos((log(sqrt(hypot(x_46_re, x_46_im))) * y_46_im)) * t_2;
	}
	return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_re;
	double t_1 = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
	double t_2 = Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
	double tmp;
	if (y_46_re <= -9e+20) {
		tmp = Math.cos(t_0) * t_2;
	} else if (y_46_re <= 6.2e-167) {
		tmp = t_1 * Math.cos((Math.log(Math.sqrt(Math.pow(Math.hypot(x_46_im, x_46_re), 0.25))) * y_46_im));
	} else if (y_46_re <= 5600.0) {
		tmp = t_1 * Math.cos((t_0 + (Math.log(Math.pow(Math.exp(0.5), Math.log(Math.hypot(x_46_re, x_46_im)))) * y_46_im)));
	} else {
		tmp = Math.cos((Math.log(Math.sqrt(Math.hypot(x_46_re, x_46_im))) * y_46_im)) * t_2;
	}
	return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	t_0 = math.atan2(x_46_im, x_46_re) * y_46_re
	t_1 = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re)))
	t_2 = math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im)))
	tmp = 0
	if y_46_re <= -9e+20:
		tmp = math.cos(t_0) * t_2
	elif y_46_re <= 6.2e-167:
		tmp = t_1 * math.cos((math.log(math.sqrt(math.pow(math.hypot(x_46_im, x_46_re), 0.25))) * y_46_im))
	elif y_46_re <= 5600.0:
		tmp = t_1 * math.cos((t_0 + (math.log(math.pow(math.exp(0.5), math.log(math.hypot(x_46_re, x_46_im)))) * y_46_im)))
	else:
		tmp = math.cos((math.log(math.sqrt(math.hypot(x_46_re, x_46_im))) * y_46_im)) * t_2
	return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re)
	t_1 = exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))
	t_2 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))
	tmp = 0.0
	if (y_46_re <= -9e+20)
		tmp = Float64(cos(t_0) * t_2);
	elseif (y_46_re <= 6.2e-167)
		tmp = Float64(t_1 * cos(Float64(log(sqrt((hypot(x_46_im, x_46_re) ^ 0.25))) * y_46_im)));
	elseif (y_46_re <= 5600.0)
		tmp = Float64(t_1 * cos(Float64(t_0 + Float64(log((exp(0.5) ^ log(hypot(x_46_re, x_46_im)))) * y_46_im))));
	else
		tmp = Float64(cos(Float64(log(sqrt(hypot(x_46_re, x_46_im))) * y_46_im)) * t_2);
	end
	return tmp
end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = atan2(x_46_im, x_46_re) * y_46_re;
	t_1 = exp((-y_46_im * atan2(x_46_im, x_46_re)));
	t_2 = exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
	tmp = 0.0;
	if (y_46_re <= -9e+20)
		tmp = cos(t_0) * t_2;
	elseif (y_46_re <= 6.2e-167)
		tmp = t_1 * cos((log(sqrt((hypot(x_46_im, x_46_re) ^ 0.25))) * y_46_im));
	elseif (y_46_re <= 5600.0)
		tmp = t_1 * cos((t_0 + (log((exp(0.5) ^ log(hypot(x_46_re, x_46_im)))) * y_46_im)));
	else
		tmp = cos((log(sqrt(hypot(x_46_re, x_46_im))) * y_46_im)) * t_2;
	end
	tmp_2 = tmp;
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -9e+20], N[(N[Cos[t$95$0], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 6.2e-167], N[(t$95$1 * N[Cos[N[(N[Log[N[Sqrt[N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], 0.25], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5600.0], N[(t$95$1 * N[Cos[N[(t$95$0 + N[(N[Log[N[Power[N[Exp[0.5], $MachinePrecision], N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(N[Log[N[Sqrt[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_2 := e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq -9 \cdot 10^{+20}:\\
\;\;\;\;\cos t\_0 \cdot t\_2\\

\mathbf{elif}\;y.re \leq 6.2 \cdot 10^{-167}:\\
\;\;\;\;t\_1 \cdot \cos \left(\log \left(\sqrt{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{0.25}}\right) \cdot y.im\right)\\

\mathbf{elif}\;y.re \leq 5600:\\
\;\;\;\;t\_1 \cdot \cos \left(t\_0 + \log \left({\left(e^{0.5}\right)}^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}\right) \cdot y.im\right)\\

\mathbf{else}:\\
\;\;\;\;\cos \left(\log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right) \cdot t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y.re < -9e20

    1. Initial program 42.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 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.f6484.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 rewrites84.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)} \]

    if -9e20 < y.re < 6.2e-167

    1. Initial program 46.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. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{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. lift-exp.f64N/A

        \[\leadsto \color{blue}{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) \]
      3. lift--.f64N/A

        \[\leadsto e^{\color{blue}{\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) \]
      4. sub-negN/A

        \[\leadsto e^{\color{blue}{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re + \left(\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)}} \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) \]
      5. exp-sumN/A

        \[\leadsto \color{blue}{\left(e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\right)} \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) \]
      6. associate-*l*N/A

        \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
      7. lower-*.f64N/A

        \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
    4. Applied rewrites79.2%

      \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{y.re} \cdot \left({\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{\left(-y.im\right)} \cdot \cos \left(\mathsf{fma}\left(y.im, \log \left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} \]
    5. 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^{-1 \cdot \left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \cos \left(y.im \cdot \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right) \cdot e^{\color{blue}{\left(-y.im\right)} \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
      15. lower-atan2.f6480.1

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

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

      \[\leadsto \cos \left(y.im \cdot \log \left(\sqrt{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{0.25}}\right)\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]

    if 6.2e-167 < y.re < 5600

    1. Initial program 37.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.re around -inf

      \[\leadsto e^{\color{blue}{-1 \cdot \left(y.re \cdot \left(-1 \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) + \frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right)\right)}} \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) \]
    4. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto e^{\color{blue}{\left(-1 \cdot y.re\right) \cdot \left(-1 \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) + \frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right)}} \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) \]
      3. mul-1-negN/A

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

        \[\leadsto e^{\color{blue}{\left(-y.re\right)} \cdot \left(-1 \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) + \frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right)} \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) \]
      5. +-commutativeN/A

        \[\leadsto e^{\left(-y.re\right) \cdot \color{blue}{\left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} + -1 \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)}} \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) \]
      6. mul-1-negN/A

        \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} + \color{blue}{\left(\mathsf{neg}\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)}\right)} \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) \]
      7. unsub-negN/A

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

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

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

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

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

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

        \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}\right)} \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) \]
      14. +-commutativeN/A

        \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)\right)} \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) \]
      15. unpow2N/A

        \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)\right)} \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) \]
      16. unpow2N/A

        \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{x.re \cdot x.re + \color{blue}{x.im \cdot x.im}}\right)\right)} \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) \]
      17. lower-hypot.f6437.4

        \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{\color{blue}{\mathsf{hypot}\left(x.re, x.im\right)}}\right)\right)} \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) \]
    5. Applied rewrites37.4%

      \[\leadsto e^{\color{blue}{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)}} \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) \]
    6. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)} \cdot \cos \left(\log \color{blue}{\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. lift-+.f64N/A

        \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)} \cdot \cos \left(\log \left(\sqrt{\color{blue}{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) \]
      3. lift-*.f64N/A

        \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)} \cdot \cos \left(\log \left(\sqrt{\color{blue}{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) \]
      4. lift-*.f64N/A

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

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

        \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)} \cdot \cos \left(\log \color{blue}{\left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\frac{1}{2}}\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
      7. pow-to-expN/A

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

        \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)} \cdot \cos \left(\log \left(e^{\color{blue}{\log \left(e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot \frac{1}{2}}\right)}}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
      9. pow-to-expN/A

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

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

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

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

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

        \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)} \cdot \cos \left(\log \left({\left(e^{0.5}\right)}^{\color{blue}{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    7. Applied rewrites83.8%

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

      \[\leadsto e^{-1 \cdot \color{blue}{\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \cdot \cos \left(\log \left({\left(e^{\frac{1}{2}}\right)}^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    9. Step-by-step derivation
      1. Applied rewrites83.8%

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

      if 5600 < y.re

      1. Initial program 29.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 inf

        \[\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.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\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(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\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(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
        3. lower-log.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 \left(\color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)} \cdot y.im\right) \]
        4. lower-sqrt.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 \left(\log \color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)} \cdot y.im\right) \]
        5. +-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 \left(\log \left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right) \cdot y.im\right) \]
        6. unpow2N/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 \left(\log \left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right) \cdot y.im\right) \]
        7. unpow2N/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 \left(\log \left(\sqrt{x.re \cdot x.re + \color{blue}{x.im \cdot x.im}}\right) \cdot y.im\right) \]
        8. lower-hypot.f6482.5

          \[\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(\log \left(\sqrt{\color{blue}{\mathsf{hypot}\left(x.re, x.im\right)}}\right) \cdot y.im\right) \]
      5. Applied rewrites82.5%

        \[\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(\log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right)} \]
    10. Recombined 4 regimes into one program.
    11. Final simplification85.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -9 \cdot 10^{+20}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{elif}\;y.re \leq 6.2 \cdot 10^{-167}:\\ \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\log \left(\sqrt{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{0.25}}\right) \cdot y.im\right)\\ \mathbf{elif}\;y.re \leq 5600:\\ \;\;\;\;e^{\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 + \log \left({\left(e^{0.5}\right)}^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}\right) \cdot y.im\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \end{array} \]
    12. Add Preprocessing

    Alternative 2: 79.2% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\\ t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ \mathbf{if}\;y.re \leq 8.5 \cdot 10^{+93}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \log \left({\left(e^{0.5}\right)}^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}\right) \cdot y.im\right) \cdot e^{\left(t\_0 - \frac{t\_1}{y.re}\right) \cdot y.re}\\ \mathbf{else}:\\ \;\;\;\;\cos \left(t\_0 \cdot y.im\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - t\_1}\\ \end{array} \end{array} \]
    (FPCore (x.re x.im y.re y.im)
     :precision binary64
     (let* ((t_0 (log (sqrt (hypot x.re x.im)))) (t_1 (* (atan2 x.im x.re) y.im)))
       (if (<= y.re 8.5e+93)
         (*
          (cos
           (+
            (* (atan2 x.im x.re) y.re)
            (* (log (pow (exp 0.5) (log (hypot x.re x.im)))) y.im)))
          (exp (* (- t_0 (/ t_1 y.re)) y.re)))
         (*
          (cos (* t_0 y.im))
          (exp (- (* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re) t_1))))))
    double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
    	double t_0 = log(sqrt(hypot(x_46_re, x_46_im)));
    	double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
    	double tmp;
    	if (y_46_re <= 8.5e+93) {
    		tmp = cos(((atan2(x_46_im, x_46_re) * y_46_re) + (log(pow(exp(0.5), log(hypot(x_46_re, x_46_im)))) * y_46_im))) * exp(((t_0 - (t_1 / y_46_re)) * y_46_re));
    	} else {
    		tmp = cos((t_0 * y_46_im)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_1));
    	}
    	return tmp;
    }
    
    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(Math.hypot(x_46_re, x_46_im)));
    	double t_1 = Math.atan2(x_46_im, x_46_re) * y_46_im;
    	double tmp;
    	if (y_46_re <= 8.5e+93) {
    		tmp = Math.cos(((Math.atan2(x_46_im, x_46_re) * y_46_re) + (Math.log(Math.pow(Math.exp(0.5), Math.log(Math.hypot(x_46_re, x_46_im)))) * y_46_im))) * Math.exp(((t_0 - (t_1 / y_46_re)) * y_46_re));
    	} else {
    		tmp = Math.cos((t_0 * y_46_im)) * Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_1));
    	}
    	return tmp;
    }
    
    def code(x_46_re, x_46_im, y_46_re, y_46_im):
    	t_0 = math.log(math.sqrt(math.hypot(x_46_re, x_46_im)))
    	t_1 = math.atan2(x_46_im, x_46_re) * y_46_im
    	tmp = 0
    	if y_46_re <= 8.5e+93:
    		tmp = math.cos(((math.atan2(x_46_im, x_46_re) * y_46_re) + (math.log(math.pow(math.exp(0.5), math.log(math.hypot(x_46_re, x_46_im)))) * y_46_im))) * math.exp(((t_0 - (t_1 / y_46_re)) * y_46_re))
    	else:
    		tmp = math.cos((t_0 * y_46_im)) * math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_1))
    	return tmp
    
    function code(x_46_re, x_46_im, y_46_re, y_46_im)
    	t_0 = log(sqrt(hypot(x_46_re, x_46_im)))
    	t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im)
    	tmp = 0.0
    	if (y_46_re <= 8.5e+93)
    		tmp = Float64(cos(Float64(Float64(atan(x_46_im, x_46_re) * y_46_re) + Float64(log((exp(0.5) ^ log(hypot(x_46_re, x_46_im)))) * y_46_im))) * exp(Float64(Float64(t_0 - Float64(t_1 / y_46_re)) * y_46_re)));
    	else
    		tmp = Float64(cos(Float64(t_0 * y_46_im)) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - t_1)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
    	t_0 = log(sqrt(hypot(x_46_re, x_46_im)));
    	t_1 = atan2(x_46_im, x_46_re) * y_46_im;
    	tmp = 0.0;
    	if (y_46_re <= 8.5e+93)
    		tmp = cos(((atan2(x_46_im, x_46_re) * y_46_re) + (log((exp(0.5) ^ log(hypot(x_46_re, x_46_im)))) * y_46_im))) * exp(((t_0 - (t_1 / y_46_re)) * y_46_re));
    	else
    		tmp = cos((t_0 * y_46_im)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_1));
    	end
    	tmp_2 = tmp;
    end
    
    code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[y$46$re, 8.5e+93], N[(N[Cos[N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision] + N[(N[Log[N[Power[N[Exp[0.5], $MachinePrecision], N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(t$95$0 - N[(t$95$1 / y$46$re), $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\\
    t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
    \mathbf{if}\;y.re \leq 8.5 \cdot 10^{+93}:\\
    \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \log \left({\left(e^{0.5}\right)}^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}\right) \cdot y.im\right) \cdot e^{\left(t\_0 - \frac{t\_1}{y.re}\right) \cdot y.re}\\
    
    \mathbf{else}:\\
    \;\;\;\;\cos \left(t\_0 \cdot y.im\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - t\_1}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y.re < 8.5000000000000005e93

      1. Initial program 42.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.re around -inf

        \[\leadsto e^{\color{blue}{-1 \cdot \left(y.re \cdot \left(-1 \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) + \frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right)\right)}} \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) \]
      4. Step-by-step derivation
        1. associate-*r*N/A

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

          \[\leadsto e^{\color{blue}{\left(-1 \cdot y.re\right) \cdot \left(-1 \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) + \frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right)}} \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) \]
        3. mul-1-negN/A

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

          \[\leadsto e^{\color{blue}{\left(-y.re\right)} \cdot \left(-1 \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) + \frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right)} \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) \]
        5. +-commutativeN/A

          \[\leadsto e^{\left(-y.re\right) \cdot \color{blue}{\left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} + -1 \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)}} \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) \]
        6. mul-1-negN/A

          \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} + \color{blue}{\left(\mathsf{neg}\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)}\right)} \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) \]
        7. unsub-negN/A

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

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

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

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

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

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

          \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}\right)} \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) \]
        14. +-commutativeN/A

          \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)\right)} \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) \]
        15. unpow2N/A

          \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)\right)} \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) \]
        16. unpow2N/A

          \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{x.re \cdot x.re + \color{blue}{x.im \cdot x.im}}\right)\right)} \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) \]
        17. lower-hypot.f6442.6

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

        \[\leadsto e^{\color{blue}{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)}} \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) \]
      6. Step-by-step derivation
        1. lift-sqrt.f64N/A

          \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)} \cdot \cos \left(\log \color{blue}{\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. lift-+.f64N/A

          \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)} \cdot \cos \left(\log \left(\sqrt{\color{blue}{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) \]
        3. lift-*.f64N/A

          \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)} \cdot \cos \left(\log \left(\sqrt{\color{blue}{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) \]
        4. lift-*.f64N/A

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

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

          \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)} \cdot \cos \left(\log \color{blue}{\left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\frac{1}{2}}\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
        7. pow-to-expN/A

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

          \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)} \cdot \cos \left(\log \left(e^{\color{blue}{\log \left(e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot \frac{1}{2}}\right)}}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
        9. pow-to-expN/A

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

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

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

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

          \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)} \cdot \cos \left(\log \left({\color{blue}{\left(e^{\frac{1}{2}}\right)}}^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
        14. lower-log.f6483.9

          \[\leadsto e^{\left(-y.re\right) \cdot \left(\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.re} - \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)} \cdot \cos \left(\log \left({\left(e^{0.5}\right)}^{\color{blue}{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
      7. Applied rewrites83.9%

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

      if 8.5000000000000005e93 < 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 inf

        \[\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.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\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(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\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(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
        3. lower-log.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 \left(\color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)} \cdot y.im\right) \]
        4. lower-sqrt.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 \left(\log \color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)} \cdot y.im\right) \]
        5. +-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 \left(\log \left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right) \cdot y.im\right) \]
        6. unpow2N/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 \left(\log \left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right) \cdot y.im\right) \]
        7. unpow2N/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 \left(\log \left(\sqrt{x.re \cdot x.re + \color{blue}{x.im \cdot x.im}}\right) \cdot y.im\right) \]
        8. lower-hypot.f6482.2

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq 8.5 \cdot 10^{+93}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \log \left({\left(e^{0.5}\right)}^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}\right) \cdot y.im\right) \cdot e^{\left(\log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right) - \frac{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}{y.re}\right) \cdot y.re}\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 3: 78.1% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \left(\log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right)\\ t_1 := e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ t_2 := e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{if}\;y.re \leq -9 \cdot 10^{+20}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot t\_2\\ \mathbf{elif}\;y.re \leq 6.2 \cdot 10^{-167}:\\ \;\;\;\;t\_1 \cdot \cos \left(\log \left(\sqrt{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{0.25}}\right) \cdot y.im\right)\\ \mathbf{elif}\;y.re \leq 5600:\\ \;\;\;\;t\_0 \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot t\_2\\ \end{array} \end{array} \]
    (FPCore (x.re x.im y.re y.im)
     :precision binary64
     (let* ((t_0 (cos (* (log (sqrt (hypot x.re x.im))) y.im)))
            (t_1 (exp (* (- y.im) (atan2 x.im x.re))))
            (t_2
             (exp
              (-
               (* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
               (* (atan2 x.im x.re) y.im)))))
       (if (<= y.re -9e+20)
         (* (cos (* (atan2 x.im x.re) y.re)) t_2)
         (if (<= y.re 6.2e-167)
           (* t_1 (cos (* (log (sqrt (pow (hypot x.im x.re) 0.25))) y.im)))
           (if (<= y.re 5600.0) (* t_0 t_1) (* t_0 t_2))))))
    double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
    	double t_0 = cos((log(sqrt(hypot(x_46_re, x_46_im))) * y_46_im));
    	double t_1 = exp((-y_46_im * atan2(x_46_im, x_46_re)));
    	double t_2 = exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
    	double tmp;
    	if (y_46_re <= -9e+20) {
    		tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * t_2;
    	} else if (y_46_re <= 6.2e-167) {
    		tmp = t_1 * cos((log(sqrt(pow(hypot(x_46_im, x_46_re), 0.25))) * y_46_im));
    	} else if (y_46_re <= 5600.0) {
    		tmp = t_0 * t_1;
    	} else {
    		tmp = t_0 * t_2;
    	}
    	return tmp;
    }
    
    public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
    	double t_0 = Math.cos((Math.log(Math.sqrt(Math.hypot(x_46_re, x_46_im))) * y_46_im));
    	double t_1 = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
    	double t_2 = Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
    	double tmp;
    	if (y_46_re <= -9e+20) {
    		tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * t_2;
    	} else if (y_46_re <= 6.2e-167) {
    		tmp = t_1 * Math.cos((Math.log(Math.sqrt(Math.pow(Math.hypot(x_46_im, x_46_re), 0.25))) * y_46_im));
    	} else if (y_46_re <= 5600.0) {
    		tmp = t_0 * t_1;
    	} else {
    		tmp = t_0 * t_2;
    	}
    	return tmp;
    }
    
    def code(x_46_re, x_46_im, y_46_re, y_46_im):
    	t_0 = math.cos((math.log(math.sqrt(math.hypot(x_46_re, x_46_im))) * y_46_im))
    	t_1 = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re)))
    	t_2 = math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im)))
    	tmp = 0
    	if y_46_re <= -9e+20:
    		tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * t_2
    	elif y_46_re <= 6.2e-167:
    		tmp = t_1 * math.cos((math.log(math.sqrt(math.pow(math.hypot(x_46_im, x_46_re), 0.25))) * y_46_im))
    	elif y_46_re <= 5600.0:
    		tmp = t_0 * t_1
    	else:
    		tmp = t_0 * t_2
    	return tmp
    
    function code(x_46_re, x_46_im, y_46_re, y_46_im)
    	t_0 = cos(Float64(log(sqrt(hypot(x_46_re, x_46_im))) * y_46_im))
    	t_1 = exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))
    	t_2 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))
    	tmp = 0.0
    	if (y_46_re <= -9e+20)
    		tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * t_2);
    	elseif (y_46_re <= 6.2e-167)
    		tmp = Float64(t_1 * cos(Float64(log(sqrt((hypot(x_46_im, x_46_re) ^ 0.25))) * y_46_im)));
    	elseif (y_46_re <= 5600.0)
    		tmp = Float64(t_0 * t_1);
    	else
    		tmp = Float64(t_0 * t_2);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
    	t_0 = cos((log(sqrt(hypot(x_46_re, x_46_im))) * y_46_im));
    	t_1 = exp((-y_46_im * atan2(x_46_im, x_46_re)));
    	t_2 = exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
    	tmp = 0.0;
    	if (y_46_re <= -9e+20)
    		tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * t_2;
    	elseif (y_46_re <= 6.2e-167)
    		tmp = t_1 * cos((log(sqrt((hypot(x_46_im, x_46_re) ^ 0.25))) * y_46_im));
    	elseif (y_46_re <= 5600.0)
    		tmp = t_0 * t_1;
    	else
    		tmp = t_0 * t_2;
    	end
    	tmp_2 = tmp;
    end
    
    code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(N[Log[N[Sqrt[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -9e+20], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 6.2e-167], N[(t$95$1 * N[Cos[N[(N[Log[N[Sqrt[N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], 0.25], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5600.0], N[(t$95$0 * t$95$1), $MachinePrecision], N[(t$95$0 * t$95$2), $MachinePrecision]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \cos \left(\log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right)\\
    t_1 := e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
    t_2 := e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
    \mathbf{if}\;y.re \leq -9 \cdot 10^{+20}:\\
    \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot t\_2\\
    
    \mathbf{elif}\;y.re \leq 6.2 \cdot 10^{-167}:\\
    \;\;\;\;t\_1 \cdot \cos \left(\log \left(\sqrt{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{0.25}}\right) \cdot y.im\right)\\
    
    \mathbf{elif}\;y.re \leq 5600:\\
    \;\;\;\;t\_0 \cdot t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0 \cdot t\_2\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if y.re < -9e20

      1. Initial program 42.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 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.f6484.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 rewrites84.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)} \]

      if -9e20 < y.re < 6.2e-167

      1. Initial program 46.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. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{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. lift-exp.f64N/A

          \[\leadsto \color{blue}{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) \]
        3. lift--.f64N/A

          \[\leadsto e^{\color{blue}{\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) \]
        4. sub-negN/A

          \[\leadsto e^{\color{blue}{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re + \left(\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)}} \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) \]
        5. exp-sumN/A

          \[\leadsto \color{blue}{\left(e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\right)} \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) \]
        6. associate-*l*N/A

          \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
        7. lower-*.f64N/A

          \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
      4. Applied rewrites79.2%

        \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{y.re} \cdot \left({\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{\left(-y.im\right)} \cdot \cos \left(\mathsf{fma}\left(y.im, \log \left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} \]
      5. 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^{-1 \cdot \left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \]
      6. Step-by-step derivation
        1. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \cos \left(y.im \cdot \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right) \cdot e^{\color{blue}{\left(-y.im\right)} \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
        15. lower-atan2.f6480.1

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

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

        \[\leadsto \cos \left(y.im \cdot \log \left(\sqrt{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{0.25}}\right)\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]

      if 6.2e-167 < y.re < 5600

      1. Initial program 37.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. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{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. lift-exp.f64N/A

          \[\leadsto \color{blue}{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) \]
        3. lift--.f64N/A

          \[\leadsto e^{\color{blue}{\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) \]
        4. sub-negN/A

          \[\leadsto e^{\color{blue}{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re + \left(\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)}} \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) \]
        5. exp-sumN/A

          \[\leadsto \color{blue}{\left(e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\right)} \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) \]
        6. associate-*l*N/A

          \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
        7. lower-*.f64N/A

          \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
      4. Applied rewrites78.3%

        \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{y.re} \cdot \left({\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{\left(-y.im\right)} \cdot \cos \left(\mathsf{fma}\left(y.im, \log \left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} \]
      5. 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^{-1 \cdot \left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \]
      6. Step-by-step derivation
        1. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 5600 < y.re

      1. Initial program 29.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 inf

        \[\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.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\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(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\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(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
        3. lower-log.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 \left(\color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)} \cdot y.im\right) \]
        4. lower-sqrt.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 \left(\log \color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)} \cdot y.im\right) \]
        5. +-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 \left(\log \left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right) \cdot y.im\right) \]
        6. unpow2N/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 \left(\log \left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right) \cdot y.im\right) \]
        7. unpow2N/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 \left(\log \left(\sqrt{x.re \cdot x.re + \color{blue}{x.im \cdot x.im}}\right) \cdot y.im\right) \]
        8. lower-hypot.f6482.5

          \[\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(\log \left(\sqrt{\color{blue}{\mathsf{hypot}\left(x.re, x.im\right)}}\right) \cdot y.im\right) \]
      5. Applied rewrites82.5%

        \[\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(\log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right)} \]
    3. Recombined 4 regimes into one program.
    4. Final simplification85.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -9 \cdot 10^{+20}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{elif}\;y.re \leq 6.2 \cdot 10^{-167}:\\ \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\log \left(\sqrt{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{0.25}}\right) \cdot y.im\right)\\ \mathbf{elif}\;y.re \leq 5600:\\ \;\;\;\;\cos \left(\log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 4: 76.6% accurate, 1.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ t_1 := \sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\\ \mathbf{if}\;y.re \leq -9 \cdot 10^{+20}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{elif}\;y.re \leq 6.2 \cdot 10^{-167}:\\ \;\;\;\;t\_0 \cdot \cos \left(\log \left(\sqrt{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{0.25}}\right) \cdot y.im\right)\\ \mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\ \;\;\;\;\cos \left(\log t\_1 \cdot y.im\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;1 \cdot {t\_1}^{y.re}\\ \end{array} \end{array} \]
    (FPCore (x.re x.im y.re y.im)
     :precision binary64
     (let* ((t_0 (exp (* (- y.im) (atan2 x.im x.re))))
            (t_1 (sqrt (hypot x.re x.im))))
       (if (<= y.re -9e+20)
         (*
          (cos (* (atan2 x.im x.re) y.re))
          (exp
           (-
            (* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
            (* (atan2 x.im x.re) y.im))))
         (if (<= y.re 6.2e-167)
           (* t_0 (cos (* (log (sqrt (pow (hypot x.im x.re) 0.25))) y.im)))
           (if (<= y.re 1.6e-23)
             (* (cos (* (log t_1) y.im)) t_0)
             (* 1.0 (pow t_1 y.re)))))))
    double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
    	double t_0 = exp((-y_46_im * atan2(x_46_im, x_46_re)));
    	double t_1 = sqrt(hypot(x_46_re, x_46_im));
    	double tmp;
    	if (y_46_re <= -9e+20) {
    		tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
    	} else if (y_46_re <= 6.2e-167) {
    		tmp = t_0 * cos((log(sqrt(pow(hypot(x_46_im, x_46_re), 0.25))) * y_46_im));
    	} else if (y_46_re <= 1.6e-23) {
    		tmp = cos((log(t_1) * y_46_im)) * t_0;
    	} else {
    		tmp = 1.0 * pow(t_1, y_46_re);
    	}
    	return tmp;
    }
    
    public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
    	double t_0 = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
    	double t_1 = Math.sqrt(Math.hypot(x_46_re, x_46_im));
    	double tmp;
    	if (y_46_re <= -9e+20) {
    		tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
    	} else if (y_46_re <= 6.2e-167) {
    		tmp = t_0 * Math.cos((Math.log(Math.sqrt(Math.pow(Math.hypot(x_46_im, x_46_re), 0.25))) * y_46_im));
    	} else if (y_46_re <= 1.6e-23) {
    		tmp = Math.cos((Math.log(t_1) * y_46_im)) * t_0;
    	} else {
    		tmp = 1.0 * Math.pow(t_1, y_46_re);
    	}
    	return tmp;
    }
    
    def code(x_46_re, x_46_im, y_46_re, y_46_im):
    	t_0 = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re)))
    	t_1 = math.sqrt(math.hypot(x_46_re, x_46_im))
    	tmp = 0
    	if y_46_re <= -9e+20:
    		tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im)))
    	elif y_46_re <= 6.2e-167:
    		tmp = t_0 * math.cos((math.log(math.sqrt(math.pow(math.hypot(x_46_im, x_46_re), 0.25))) * y_46_im))
    	elif y_46_re <= 1.6e-23:
    		tmp = math.cos((math.log(t_1) * y_46_im)) * t_0
    	else:
    		tmp = 1.0 * math.pow(t_1, y_46_re)
    	return tmp
    
    function code(x_46_re, x_46_im, y_46_re, y_46_im)
    	t_0 = exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))
    	t_1 = sqrt(hypot(x_46_re, x_46_im))
    	tmp = 0.0
    	if (y_46_re <= -9e+20)
    		tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))));
    	elseif (y_46_re <= 6.2e-167)
    		tmp = Float64(t_0 * cos(Float64(log(sqrt((hypot(x_46_im, x_46_re) ^ 0.25))) * y_46_im)));
    	elseif (y_46_re <= 1.6e-23)
    		tmp = Float64(cos(Float64(log(t_1) * y_46_im)) * t_0);
    	else
    		tmp = Float64(1.0 * (t_1 ^ y_46_re));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
    	t_0 = exp((-y_46_im * atan2(x_46_im, x_46_re)));
    	t_1 = sqrt(hypot(x_46_re, x_46_im));
    	tmp = 0.0;
    	if (y_46_re <= -9e+20)
    		tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
    	elseif (y_46_re <= 6.2e-167)
    		tmp = t_0 * cos((log(sqrt((hypot(x_46_im, x_46_re) ^ 0.25))) * y_46_im));
    	elseif (y_46_re <= 1.6e-23)
    		tmp = cos((log(t_1) * y_46_im)) * t_0;
    	else
    		tmp = 1.0 * (t_1 ^ y_46_re);
    	end
    	tmp_2 = tmp;
    end
    
    code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -9e+20], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.2e-167], N[(t$95$0 * N[Cos[N[(N[Log[N[Sqrt[N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], 0.25], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.6e-23], N[(N[Cos[N[(N[Log[t$95$1], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(1.0 * N[Power[t$95$1, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
    t_1 := \sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\\
    \mathbf{if}\;y.re \leq -9 \cdot 10^{+20}:\\
    \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
    
    \mathbf{elif}\;y.re \leq 6.2 \cdot 10^{-167}:\\
    \;\;\;\;t\_0 \cdot \cos \left(\log \left(\sqrt{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{0.25}}\right) \cdot y.im\right)\\
    
    \mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\
    \;\;\;\;\cos \left(\log t\_1 \cdot y.im\right) \cdot t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;1 \cdot {t\_1}^{y.re}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if y.re < -9e20

      1. Initial program 42.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 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.f6484.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 rewrites84.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)} \]

      if -9e20 < y.re < 6.2e-167

      1. Initial program 46.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. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{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. lift-exp.f64N/A

          \[\leadsto \color{blue}{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) \]
        3. lift--.f64N/A

          \[\leadsto e^{\color{blue}{\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) \]
        4. sub-negN/A

          \[\leadsto e^{\color{blue}{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re + \left(\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)}} \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) \]
        5. exp-sumN/A

          \[\leadsto \color{blue}{\left(e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\right)} \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) \]
        6. associate-*l*N/A

          \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
        7. lower-*.f64N/A

          \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
      4. Applied rewrites79.2%

        \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{y.re} \cdot \left({\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{\left(-y.im\right)} \cdot \cos \left(\mathsf{fma}\left(y.im, \log \left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} \]
      5. 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^{-1 \cdot \left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \]
      6. Step-by-step derivation
        1. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \cos \left(y.im \cdot \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right) \cdot e^{\color{blue}{\left(-y.im\right)} \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
        15. lower-atan2.f6480.1

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

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

        \[\leadsto \cos \left(y.im \cdot \log \left(\sqrt{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{0.25}}\right)\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]

      if 6.2e-167 < y.re < 1.59999999999999988e-23

      1. Initial program 39.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. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{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. lift-exp.f64N/A

          \[\leadsto \color{blue}{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) \]
        3. lift--.f64N/A

          \[\leadsto e^{\color{blue}{\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) \]
        4. sub-negN/A

          \[\leadsto e^{\color{blue}{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re + \left(\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)}} \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) \]
        5. exp-sumN/A

          \[\leadsto \color{blue}{\left(e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\right)} \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) \]
        6. associate-*l*N/A

          \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
        7. lower-*.f64N/A

          \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
      4. Applied rewrites78.9%

        \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{y.re} \cdot \left({\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{\left(-y.im\right)} \cdot \cos \left(\mathsf{fma}\left(y.im, \log \left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} \]
      5. 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^{-1 \cdot \left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \]
      6. Step-by-step derivation
        1. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 1.59999999999999988e-23 < y.re

      1. Initial program 29.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. unpow2N/A

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

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

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

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

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

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

        \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.re, 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{hypot}\left(x.re, x.im\right)}\right)}^{y.re} \cdot 1 \]
      7. Step-by-step derivation
        1. Applied rewrites72.1%

          \[\leadsto {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re} \cdot 1 \]
      8. Recombined 4 regimes into one program.
      9. Final simplification82.6%

        \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -9 \cdot 10^{+20}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{elif}\;y.re \leq 6.2 \cdot 10^{-167}:\\ \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\log \left(\sqrt{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{0.25}}\right) \cdot y.im\right)\\ \mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\ \;\;\;\;\cos \left(\log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\ \end{array} \]
      10. Add Preprocessing

      Alternative 5: 77.3% accurate, 1.2× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ t_1 := \sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\\ \mathbf{if}\;y.re \leq -3.1 \cdot 10^{-15}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{elif}\;y.re \leq 2.1 \cdot 10^{-167}:\\ \;\;\;\;\cos \left(\log \left(\sqrt{\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}}\right) \cdot y.im\right) \cdot t\_0\\ \mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\ \;\;\;\;\cos \left(\log t\_1 \cdot y.im\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;1 \cdot {t\_1}^{y.re}\\ \end{array} \end{array} \]
      (FPCore (x.re x.im y.re y.im)
       :precision binary64
       (let* ((t_0 (exp (* (- y.im) (atan2 x.im x.re))))
              (t_1 (sqrt (hypot x.re x.im))))
         (if (<= y.re -3.1e-15)
           (*
            (cos (* (atan2 x.im x.re) y.re))
            (exp
             (-
              (* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
              (* (atan2 x.im x.re) y.im))))
           (if (<= y.re 2.1e-167)
             (* (cos (* (log (sqrt (sqrt (hypot x.im x.re)))) y.im)) t_0)
             (if (<= y.re 1.6e-23)
               (* (cos (* (log t_1) y.im)) t_0)
               (* 1.0 (pow t_1 y.re)))))))
      double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
      	double t_0 = exp((-y_46_im * atan2(x_46_im, x_46_re)));
      	double t_1 = sqrt(hypot(x_46_re, x_46_im));
      	double tmp;
      	if (y_46_re <= -3.1e-15) {
      		tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
      	} else if (y_46_re <= 2.1e-167) {
      		tmp = cos((log(sqrt(sqrt(hypot(x_46_im, x_46_re)))) * y_46_im)) * t_0;
      	} else if (y_46_re <= 1.6e-23) {
      		tmp = cos((log(t_1) * y_46_im)) * t_0;
      	} else {
      		tmp = 1.0 * pow(t_1, y_46_re);
      	}
      	return tmp;
      }
      
      public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
      	double t_0 = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
      	double t_1 = Math.sqrt(Math.hypot(x_46_re, x_46_im));
      	double tmp;
      	if (y_46_re <= -3.1e-15) {
      		tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.exp(((Math.log(Math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
      	} else if (y_46_re <= 2.1e-167) {
      		tmp = Math.cos((Math.log(Math.sqrt(Math.sqrt(Math.hypot(x_46_im, x_46_re)))) * y_46_im)) * t_0;
      	} else if (y_46_re <= 1.6e-23) {
      		tmp = Math.cos((Math.log(t_1) * y_46_im)) * t_0;
      	} else {
      		tmp = 1.0 * Math.pow(t_1, y_46_re);
      	}
      	return tmp;
      }
      
      def code(x_46_re, x_46_im, y_46_re, y_46_im):
      	t_0 = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re)))
      	t_1 = math.sqrt(math.hypot(x_46_re, x_46_im))
      	tmp = 0
      	if y_46_re <= -3.1e-15:
      		tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.exp(((math.log(math.sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im)))
      	elif y_46_re <= 2.1e-167:
      		tmp = math.cos((math.log(math.sqrt(math.sqrt(math.hypot(x_46_im, x_46_re)))) * y_46_im)) * t_0
      	elif y_46_re <= 1.6e-23:
      		tmp = math.cos((math.log(t_1) * y_46_im)) * t_0
      	else:
      		tmp = 1.0 * math.pow(t_1, y_46_re)
      	return tmp
      
      function code(x_46_re, x_46_im, y_46_re, y_46_im)
      	t_0 = exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))
      	t_1 = sqrt(hypot(x_46_re, x_46_im))
      	tmp = 0.0
      	if (y_46_re <= -3.1e-15)
      		tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))));
      	elseif (y_46_re <= 2.1e-167)
      		tmp = Float64(cos(Float64(log(sqrt(sqrt(hypot(x_46_im, x_46_re)))) * y_46_im)) * t_0);
      	elseif (y_46_re <= 1.6e-23)
      		tmp = Float64(cos(Float64(log(t_1) * y_46_im)) * t_0);
      	else
      		tmp = Float64(1.0 * (t_1 ^ y_46_re));
      	end
      	return tmp
      end
      
      function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
      	t_0 = exp((-y_46_im * atan2(x_46_im, x_46_re)));
      	t_1 = sqrt(hypot(x_46_re, x_46_im));
      	tmp = 0.0;
      	if (y_46_re <= -3.1e-15)
      		tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
      	elseif (y_46_re <= 2.1e-167)
      		tmp = cos((log(sqrt(sqrt(hypot(x_46_im, x_46_re)))) * y_46_im)) * t_0;
      	elseif (y_46_re <= 1.6e-23)
      		tmp = cos((log(t_1) * y_46_im)) * t_0;
      	else
      		tmp = 1.0 * (t_1 ^ y_46_re);
      	end
      	tmp_2 = tmp;
      end
      
      code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -3.1e-15], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.1e-167], N[(N[Cos[N[(N[Log[N[Sqrt[N[Sqrt[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 1.6e-23], N[(N[Cos[N[(N[Log[t$95$1], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(1.0 * N[Power[t$95$1, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
      t_1 := \sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\\
      \mathbf{if}\;y.re \leq -3.1 \cdot 10^{-15}:\\
      \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
      
      \mathbf{elif}\;y.re \leq 2.1 \cdot 10^{-167}:\\
      \;\;\;\;\cos \left(\log \left(\sqrt{\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}}\right) \cdot y.im\right) \cdot t\_0\\
      
      \mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\
      \;\;\;\;\cos \left(\log t\_1 \cdot y.im\right) \cdot t\_0\\
      
      \mathbf{else}:\\
      \;\;\;\;1 \cdot {t\_1}^{y.re}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if y.re < -3.0999999999999999e-15

        1. Initial program 43.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 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.f6482.4

            \[\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 rewrites82.4%

          \[\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)} \]

        if -3.0999999999999999e-15 < y.re < 2.10000000000000017e-167

        1. Initial program 46.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. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \color{blue}{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. lift-exp.f64N/A

            \[\leadsto \color{blue}{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) \]
          3. lift--.f64N/A

            \[\leadsto e^{\color{blue}{\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) \]
          4. sub-negN/A

            \[\leadsto e^{\color{blue}{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re + \left(\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)}} \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) \]
          5. exp-sumN/A

            \[\leadsto \color{blue}{\left(e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\right)} \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) \]
          6. associate-*l*N/A

            \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
          7. lower-*.f64N/A

            \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
        4. Applied rewrites81.1%

          \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{y.re} \cdot \left({\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{\left(-y.im\right)} \cdot \cos \left(\mathsf{fma}\left(y.im, \log \left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} \]
        5. 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^{-1 \cdot \left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \]
        6. Step-by-step derivation
          1. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \cos \left(y.im \cdot \log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right) \cdot e^{\color{blue}{\left(-y.im\right)} \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
          15. lower-atan2.f6482.1

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

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

          \[\leadsto \cos \left(y.im \cdot \log \left(\sqrt{\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}}\right)\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]

        if 2.10000000000000017e-167 < y.re < 1.59999999999999988e-23

        1. Initial program 39.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. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \color{blue}{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. lift-exp.f64N/A

            \[\leadsto \color{blue}{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) \]
          3. lift--.f64N/A

            \[\leadsto e^{\color{blue}{\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) \]
          4. sub-negN/A

            \[\leadsto e^{\color{blue}{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re + \left(\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)}} \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) \]
          5. exp-sumN/A

            \[\leadsto \color{blue}{\left(e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\right)} \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) \]
          6. associate-*l*N/A

            \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
          7. lower-*.f64N/A

            \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
        4. Applied rewrites78.9%

          \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{y.re} \cdot \left({\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{\left(-y.im\right)} \cdot \cos \left(\mathsf{fma}\left(y.im, \log \left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} \]
        5. 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^{-1 \cdot \left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \]
        6. Step-by-step derivation
          1. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.59999999999999988e-23 < y.re

        1. Initial program 29.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. unpow2N/A

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

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

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

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

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

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

          \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.re, 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{hypot}\left(x.re, x.im\right)}\right)}^{y.re} \cdot 1 \]
        7. Step-by-step derivation
          1. Applied rewrites72.1%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -3.1 \cdot 10^{-15}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{elif}\;y.re \leq 2.1 \cdot 10^{-167}:\\ \;\;\;\;\cos \left(\log \left(\sqrt{\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}}\right) \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\ \;\;\;\;\cos \left(\log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\ \end{array} \]
        10. Add Preprocessing

        Alternative 6: 75.7% accurate, 1.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ t_1 := \sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\\ t_2 := {t\_1}^{y.re}\\ \mathbf{if}\;y.re \leq -3.5 \cdot 10^{+22}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot t\_2\\ \mathbf{elif}\;y.re \leq 2.1 \cdot 10^{-167}:\\ \;\;\;\;\cos \left(\log \left(\sqrt{\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}}\right) \cdot y.im\right) \cdot t\_0\\ \mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\ \;\;\;\;\cos \left(\log t\_1 \cdot y.im\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;1 \cdot t\_2\\ \end{array} \end{array} \]
        (FPCore (x.re x.im y.re y.im)
         :precision binary64
         (let* ((t_0 (exp (* (- y.im) (atan2 x.im x.re))))
                (t_1 (sqrt (hypot x.re x.im)))
                (t_2 (pow t_1 y.re)))
           (if (<= y.re -3.5e+22)
             (* (cos (* (atan2 x.im x.re) y.re)) t_2)
             (if (<= y.re 2.1e-167)
               (* (cos (* (log (sqrt (sqrt (hypot x.im x.re)))) y.im)) t_0)
               (if (<= y.re 1.6e-23) (* (cos (* (log t_1) y.im)) t_0) (* 1.0 t_2))))))
        double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
        	double t_0 = exp((-y_46_im * atan2(x_46_im, x_46_re)));
        	double t_1 = sqrt(hypot(x_46_re, x_46_im));
        	double t_2 = pow(t_1, y_46_re);
        	double tmp;
        	if (y_46_re <= -3.5e+22) {
        		tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * t_2;
        	} else if (y_46_re <= 2.1e-167) {
        		tmp = cos((log(sqrt(sqrt(hypot(x_46_im, x_46_re)))) * y_46_im)) * t_0;
        	} else if (y_46_re <= 1.6e-23) {
        		tmp = cos((log(t_1) * y_46_im)) * t_0;
        	} else {
        		tmp = 1.0 * t_2;
        	}
        	return tmp;
        }
        
        public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
        	double t_0 = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
        	double t_1 = Math.sqrt(Math.hypot(x_46_re, x_46_im));
        	double t_2 = Math.pow(t_1, y_46_re);
        	double tmp;
        	if (y_46_re <= -3.5e+22) {
        		tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * t_2;
        	} else if (y_46_re <= 2.1e-167) {
        		tmp = Math.cos((Math.log(Math.sqrt(Math.sqrt(Math.hypot(x_46_im, x_46_re)))) * y_46_im)) * t_0;
        	} else if (y_46_re <= 1.6e-23) {
        		tmp = Math.cos((Math.log(t_1) * y_46_im)) * t_0;
        	} else {
        		tmp = 1.0 * t_2;
        	}
        	return tmp;
        }
        
        def code(x_46_re, x_46_im, y_46_re, y_46_im):
        	t_0 = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re)))
        	t_1 = math.sqrt(math.hypot(x_46_re, x_46_im))
        	t_2 = math.pow(t_1, y_46_re)
        	tmp = 0
        	if y_46_re <= -3.5e+22:
        		tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * t_2
        	elif y_46_re <= 2.1e-167:
        		tmp = math.cos((math.log(math.sqrt(math.sqrt(math.hypot(x_46_im, x_46_re)))) * y_46_im)) * t_0
        	elif y_46_re <= 1.6e-23:
        		tmp = math.cos((math.log(t_1) * y_46_im)) * t_0
        	else:
        		tmp = 1.0 * t_2
        	return tmp
        
        function code(x_46_re, x_46_im, y_46_re, y_46_im)
        	t_0 = exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))
        	t_1 = sqrt(hypot(x_46_re, x_46_im))
        	t_2 = t_1 ^ y_46_re
        	tmp = 0.0
        	if (y_46_re <= -3.5e+22)
        		tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * t_2);
        	elseif (y_46_re <= 2.1e-167)
        		tmp = Float64(cos(Float64(log(sqrt(sqrt(hypot(x_46_im, x_46_re)))) * y_46_im)) * t_0);
        	elseif (y_46_re <= 1.6e-23)
        		tmp = Float64(cos(Float64(log(t_1) * y_46_im)) * t_0);
        	else
        		tmp = Float64(1.0 * t_2);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
        	t_0 = exp((-y_46_im * atan2(x_46_im, x_46_re)));
        	t_1 = sqrt(hypot(x_46_re, x_46_im));
        	t_2 = t_1 ^ y_46_re;
        	tmp = 0.0;
        	if (y_46_re <= -3.5e+22)
        		tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * t_2;
        	elseif (y_46_re <= 2.1e-167)
        		tmp = cos((log(sqrt(sqrt(hypot(x_46_im, x_46_re)))) * y_46_im)) * t_0;
        	elseif (y_46_re <= 1.6e-23)
        		tmp = cos((log(t_1) * y_46_im)) * t_0;
        	else
        		tmp = 1.0 * t_2;
        	end
        	tmp_2 = tmp;
        end
        
        code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[t$95$1, y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -3.5e+22], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 2.1e-167], N[(N[Cos[N[(N[Log[N[Sqrt[N[Sqrt[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 1.6e-23], N[(N[Cos[N[(N[Log[t$95$1], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(1.0 * t$95$2), $MachinePrecision]]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
        t_1 := \sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\\
        t_2 := {t\_1}^{y.re}\\
        \mathbf{if}\;y.re \leq -3.5 \cdot 10^{+22}:\\
        \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot t\_2\\
        
        \mathbf{elif}\;y.re \leq 2.1 \cdot 10^{-167}:\\
        \;\;\;\;\cos \left(\log \left(\sqrt{\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}}\right) \cdot y.im\right) \cdot t\_0\\
        
        \mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\
        \;\;\;\;\cos \left(\log t\_1 \cdot y.im\right) \cdot t\_0\\
        
        \mathbf{else}:\\
        \;\;\;\;1 \cdot t\_2\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if y.re < -3.5e22

          1. Initial program 43.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. unpow2N/A

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

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

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

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

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

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

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

          if -3.5e22 < y.re < 2.10000000000000017e-167

          1. Initial program 46.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. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \color{blue}{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. lift-exp.f64N/A

              \[\leadsto \color{blue}{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) \]
            3. lift--.f64N/A

              \[\leadsto e^{\color{blue}{\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) \]
            4. sub-negN/A

              \[\leadsto e^{\color{blue}{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re + \left(\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)}} \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) \]
            5. exp-sumN/A

              \[\leadsto \color{blue}{\left(e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\right)} \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) \]
            6. associate-*l*N/A

              \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
            7. lower-*.f64N/A

              \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
          4. Applied rewrites78.5%

            \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{y.re} \cdot \left({\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{\left(-y.im\right)} \cdot \cos \left(\mathsf{fma}\left(y.im, \log \left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} \]
          5. 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^{-1 \cdot \left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \]
          6. Step-by-step derivation
            1. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \cos \left(y.im \cdot \log \left(\sqrt{\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}}\right)\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]

          if 2.10000000000000017e-167 < y.re < 1.59999999999999988e-23

          1. Initial program 39.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. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \color{blue}{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. lift-exp.f64N/A

              \[\leadsto \color{blue}{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) \]
            3. lift--.f64N/A

              \[\leadsto e^{\color{blue}{\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) \]
            4. sub-negN/A

              \[\leadsto e^{\color{blue}{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re + \left(\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)}} \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) \]
            5. exp-sumN/A

              \[\leadsto \color{blue}{\left(e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\right)} \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) \]
            6. associate-*l*N/A

              \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
            7. lower-*.f64N/A

              \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
          4. Applied rewrites78.9%

            \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{y.re} \cdot \left({\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{\left(-y.im\right)} \cdot \cos \left(\mathsf{fma}\left(y.im, \log \left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} \]
          5. 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^{-1 \cdot \left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \]
          6. Step-by-step derivation
            1. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 1.59999999999999988e-23 < y.re

          1. Initial program 29.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. unpow2N/A

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

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

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

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

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

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

            \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.re, 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{hypot}\left(x.re, x.im\right)}\right)}^{y.re} \cdot 1 \]
          7. Step-by-step derivation
            1. Applied rewrites72.1%

              \[\leadsto {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re} \cdot 1 \]
          8. Recombined 4 regimes into one program.
          9. Final simplification81.1%

            \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -3.5 \cdot 10^{+22}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq 2.1 \cdot 10^{-167}:\\ \;\;\;\;\cos \left(\log \left(\sqrt{\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}}\right) \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\ \;\;\;\;\cos \left(\log \left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\ \end{array} \]
          10. Add Preprocessing

          Alternative 7: 76.0% accurate, 1.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\ \mathbf{if}\;y.re \leq -3.5 \cdot 10^{+22}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot t\_0\\ \mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\ \;\;\;\;1 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot t\_0\\ \end{array} \end{array} \]
          (FPCore (x.re x.im y.re y.im)
           :precision binary64
           (let* ((t_0 (pow (sqrt (hypot x.re x.im)) y.re)))
             (if (<= y.re -3.5e+22)
               (* (cos (* (atan2 x.im x.re) y.re)) t_0)
               (if (<= y.re 1.6e-23)
                 (* 1.0 (exp (* (- y.im) (atan2 x.im x.re))))
                 (* 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(sqrt(hypot(x_46_re, x_46_im)), y_46_re);
          	double tmp;
          	if (y_46_re <= -3.5e+22) {
          		tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * t_0;
          	} else if (y_46_re <= 1.6e-23) {
          		tmp = 1.0 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
          	} else {
          		tmp = 1.0 * t_0;
          	}
          	return tmp;
          }
          
          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(Math.sqrt(Math.hypot(x_46_re, x_46_im)), y_46_re);
          	double tmp;
          	if (y_46_re <= -3.5e+22) {
          		tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * t_0;
          	} else if (y_46_re <= 1.6e-23) {
          		tmp = 1.0 * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
          	} else {
          		tmp = 1.0 * t_0;
          	}
          	return tmp;
          }
          
          def code(x_46_re, x_46_im, y_46_re, y_46_im):
          	t_0 = math.pow(math.sqrt(math.hypot(x_46_re, x_46_im)), y_46_re)
          	tmp = 0
          	if y_46_re <= -3.5e+22:
          		tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * t_0
          	elif y_46_re <= 1.6e-23:
          		tmp = 1.0 * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re)))
          	else:
          		tmp = 1.0 * t_0
          	return tmp
          
          function code(x_46_re, x_46_im, y_46_re, y_46_im)
          	t_0 = sqrt(hypot(x_46_re, x_46_im)) ^ y_46_re
          	tmp = 0.0
          	if (y_46_re <= -3.5e+22)
          		tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * t_0);
          	elseif (y_46_re <= 1.6e-23)
          		tmp = Float64(1.0 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))));
          	else
          		tmp = Float64(1.0 * t_0);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
          	t_0 = sqrt(hypot(x_46_re, x_46_im)) ^ y_46_re;
          	tmp = 0.0;
          	if (y_46_re <= -3.5e+22)
          		tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * t_0;
          	elseif (y_46_re <= 1.6e-23)
          		tmp = 1.0 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
          	else
          		tmp = 1.0 * 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[Power[N[Sqrt[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -3.5e+22], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 1.6e-23], N[(1.0 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 * t$95$0), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\
          \mathbf{if}\;y.re \leq -3.5 \cdot 10^{+22}:\\
          \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot t\_0\\
          
          \mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\
          \;\;\;\;1 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
          
          \mathbf{else}:\\
          \;\;\;\;1 \cdot t\_0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if y.re < -3.5e22

            1. Initial program 43.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. unpow2N/A

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

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

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

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

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

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

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

            if -3.5e22 < y.re < 1.59999999999999988e-23

            1. Initial program 44.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. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \color{blue}{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. lift-exp.f64N/A

                \[\leadsto \color{blue}{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) \]
              3. lift--.f64N/A

                \[\leadsto e^{\color{blue}{\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) \]
              4. sub-negN/A

                \[\leadsto e^{\color{blue}{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re + \left(\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)}} \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) \]
              5. exp-sumN/A

                \[\leadsto \color{blue}{\left(e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\right)} \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) \]
              6. associate-*l*N/A

                \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
              7. lower-*.f64N/A

                \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
            4. Applied rewrites78.6%

              \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{y.re} \cdot \left({\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{\left(-y.im\right)} \cdot \cos \left(\mathsf{fma}\left(y.im, \log \left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} \]
            5. 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^{-1 \cdot \left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \]
            6. Step-by-step derivation
              1. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto 1 \cdot e^{\color{blue}{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \]
            9. Step-by-step derivation
              1. Applied rewrites81.4%

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

              if 1.59999999999999988e-23 < y.re

              1. Initial program 29.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. unpow2N/A

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

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

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

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

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

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

                \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.re, 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{hypot}\left(x.re, x.im\right)}\right)}^{y.re} \cdot 1 \]
              7. Step-by-step derivation
                1. Applied rewrites72.1%

                  \[\leadsto {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re} \cdot 1 \]
              8. Recombined 3 regimes into one program.
              9. Final simplification79.0%

                \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -3.5 \cdot 10^{+22}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\ \;\;\;\;1 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\ \end{array} \]
              10. Add Preprocessing

              Alternative 8: 75.3% accurate, 2.0× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -3.5 \cdot 10^{+22}:\\ \;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.re \cdot x.re}{x.im}, x.im\right)\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\ \;\;\;\;1 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\ \end{array} \end{array} \]
              (FPCore (x.re x.im y.re y.im)
               :precision binary64
               (if (<= y.re -3.5e+22)
                 (*
                  (pow (fma 0.5 (/ (* x.re x.re) x.im) x.im) y.re)
                  (cos (* (atan2 x.im x.re) y.re)))
                 (if (<= y.re 1.6e-23)
                   (* 1.0 (exp (* (- y.im) (atan2 x.im x.re))))
                   (* 1.0 (pow (sqrt (hypot x.re x.im)) y.re)))))
              double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
              	double tmp;
              	if (y_46_re <= -3.5e+22) {
              		tmp = pow(fma(0.5, ((x_46_re * x_46_re) / x_46_im), x_46_im), y_46_re) * cos((atan2(x_46_im, x_46_re) * y_46_re));
              	} else if (y_46_re <= 1.6e-23) {
              		tmp = 1.0 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
              	} else {
              		tmp = 1.0 * pow(sqrt(hypot(x_46_re, x_46_im)), y_46_re);
              	}
              	return tmp;
              }
              
              function code(x_46_re, x_46_im, y_46_re, y_46_im)
              	tmp = 0.0
              	if (y_46_re <= -3.5e+22)
              		tmp = Float64((fma(0.5, Float64(Float64(x_46_re * x_46_re) / x_46_im), x_46_im) ^ y_46_re) * cos(Float64(atan(x_46_im, x_46_re) * y_46_re)));
              	elseif (y_46_re <= 1.6e-23)
              		tmp = Float64(1.0 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))));
              	else
              		tmp = Float64(1.0 * (sqrt(hypot(x_46_re, x_46_im)) ^ y_46_re));
              	end
              	return tmp
              end
              
              code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -3.5e+22], N[(N[Power[N[(0.5 * N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] + x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.6e-23], N[(1.0 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Power[N[Sqrt[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;y.re \leq -3.5 \cdot 10^{+22}:\\
              \;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.re \cdot x.re}{x.im}, x.im\right)\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
              
              \mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\
              \;\;\;\;1 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
              
              \mathbf{else}:\\
              \;\;\;\;1 \cdot {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if y.re < -3.5e22

                1. Initial program 43.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. unpow2N/A

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

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

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

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

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

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

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

                  \[\leadsto {\left(x.im + \frac{1}{2} \cdot \frac{{x.re}^{2}}{x.im}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                7. Step-by-step derivation
                  1. Applied rewrites76.7%

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

                  if -3.5e22 < y.re < 1.59999999999999988e-23

                  1. Initial program 44.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. Step-by-step derivation
                    1. lift-*.f64N/A

                      \[\leadsto \color{blue}{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. lift-exp.f64N/A

                      \[\leadsto \color{blue}{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) \]
                    3. lift--.f64N/A

                      \[\leadsto e^{\color{blue}{\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) \]
                    4. sub-negN/A

                      \[\leadsto e^{\color{blue}{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re + \left(\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)}} \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) \]
                    5. exp-sumN/A

                      \[\leadsto \color{blue}{\left(e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\right)} \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) \]
                    6. associate-*l*N/A

                      \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
                    7. lower-*.f64N/A

                      \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
                  4. Applied rewrites78.6%

                    \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{y.re} \cdot \left({\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{\left(-y.im\right)} \cdot \cos \left(\mathsf{fma}\left(y.im, \log \left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} \]
                  5. 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^{-1 \cdot \left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \]
                  6. Step-by-step derivation
                    1. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto 1 \cdot e^{\color{blue}{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \]
                  9. Step-by-step derivation
                    1. Applied rewrites81.4%

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

                    if 1.59999999999999988e-23 < y.re

                    1. Initial program 29.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. unpow2N/A

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

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

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

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

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

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

                      \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.re, 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{hypot}\left(x.re, x.im\right)}\right)}^{y.re} \cdot 1 \]
                    7. Step-by-step derivation
                      1. Applied rewrites72.1%

                        \[\leadsto {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re} \cdot 1 \]
                    8. Recombined 3 regimes into one program.
                    9. Final simplification78.2%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -3.5 \cdot 10^{+22}:\\ \;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.re \cdot x.re}{x.im}, x.im\right)\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\ \;\;\;\;1 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\ \end{array} \]
                    10. Add Preprocessing

                    Alternative 9: 76.2% accurate, 3.0× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 \cdot {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\ \mathbf{if}\;y.re \leq -3.5 \cdot 10^{+22}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\ \;\;\;\;1 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \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 (sqrt (hypot x.re x.im)) y.re))))
                       (if (<= y.re -3.5e+22)
                         t_0
                         (if (<= y.re 1.6e-23) (* 1.0 (exp (* (- y.im) (atan2 x.im x.re)))) 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(sqrt(hypot(x_46_re, x_46_im)), y_46_re);
                    	double tmp;
                    	if (y_46_re <= -3.5e+22) {
                    		tmp = t_0;
                    	} else if (y_46_re <= 1.6e-23) {
                    		tmp = 1.0 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                    	double t_0 = 1.0 * Math.pow(Math.sqrt(Math.hypot(x_46_re, x_46_im)), y_46_re);
                    	double tmp;
                    	if (y_46_re <= -3.5e+22) {
                    		tmp = t_0;
                    	} else if (y_46_re <= 1.6e-23) {
                    		tmp = 1.0 * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    def code(x_46_re, x_46_im, y_46_re, y_46_im):
                    	t_0 = 1.0 * math.pow(math.sqrt(math.hypot(x_46_re, x_46_im)), y_46_re)
                    	tmp = 0
                    	if y_46_re <= -3.5e+22:
                    		tmp = t_0
                    	elif y_46_re <= 1.6e-23:
                    		tmp = 1.0 * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re)))
                    	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 * (sqrt(hypot(x_46_re, x_46_im)) ^ y_46_re))
                    	tmp = 0.0
                    	if (y_46_re <= -3.5e+22)
                    		tmp = t_0;
                    	elseif (y_46_re <= 1.6e-23)
                    		tmp = Float64(1.0 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))));
                    	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 = 1.0 * (sqrt(hypot(x_46_re, x_46_im)) ^ y_46_re);
                    	tmp = 0.0;
                    	if (y_46_re <= -3.5e+22)
                    		tmp = t_0;
                    	elseif (y_46_re <= 1.6e-23)
                    		tmp = 1.0 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
                    	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[(1.0 * N[Power[N[Sqrt[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -3.5e+22], t$95$0, If[LessEqual[y$46$re, 1.6e-23], N[(1.0 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := 1 \cdot {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\
                    \mathbf{if}\;y.re \leq -3.5 \cdot 10^{+22}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\
                    \;\;\;\;1 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if y.re < -3.5e22 or 1.59999999999999988e-23 < y.re

                      1. Initial program 35.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. unpow2N/A

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

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

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

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

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

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

                        \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.re, 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{hypot}\left(x.re, x.im\right)}\right)}^{y.re} \cdot 1 \]
                      7. Step-by-step derivation
                        1. Applied rewrites74.1%

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

                        if -3.5e22 < y.re < 1.59999999999999988e-23

                        1. Initial program 44.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. Step-by-step derivation
                          1. lift-*.f64N/A

                            \[\leadsto \color{blue}{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. lift-exp.f64N/A

                            \[\leadsto \color{blue}{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) \]
                          3. lift--.f64N/A

                            \[\leadsto e^{\color{blue}{\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) \]
                          4. sub-negN/A

                            \[\leadsto e^{\color{blue}{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re + \left(\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)}} \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) \]
                          5. exp-sumN/A

                            \[\leadsto \color{blue}{\left(e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\right)} \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) \]
                          6. associate-*l*N/A

                            \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
                          7. lower-*.f64N/A

                            \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
                        4. Applied rewrites78.6%

                          \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{y.re} \cdot \left({\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{\left(-y.im\right)} \cdot \cos \left(\mathsf{fma}\left(y.im, \log \left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} \]
                        5. 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^{-1 \cdot \left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \]
                        6. Step-by-step derivation
                          1. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto 1 \cdot e^{\color{blue}{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \]
                        9. Step-by-step derivation
                          1. Applied rewrites81.4%

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

                          \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -3.5 \cdot 10^{+22}:\\ \;\;\;\;1 \cdot {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-23}:\\ \;\;\;\;1 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot {\left(\sqrt{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{y.re}\\ \end{array} \]
                        12. Add Preprocessing

                        Alternative 10: 74.7% accurate, 3.0× speedup?

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

                          1. Initial program 36.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. unpow2N/A

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

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

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

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

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

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

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

                            \[\leadsto {\left(x.re + \frac{1}{2} \cdot \frac{{x.im}^{2}}{x.re}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                          7. Step-by-step derivation
                            1. Applied rewrites68.1%

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

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

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

                              if -3.5e22 < y.re < 6

                              1. Initial program 43.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. Step-by-step derivation
                                1. lift-*.f64N/A

                                  \[\leadsto \color{blue}{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. lift-exp.f64N/A

                                  \[\leadsto \color{blue}{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) \]
                                3. lift--.f64N/A

                                  \[\leadsto e^{\color{blue}{\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) \]
                                4. sub-negN/A

                                  \[\leadsto e^{\color{blue}{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re + \left(\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)}} \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) \]
                                5. exp-sumN/A

                                  \[\leadsto \color{blue}{\left(e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\right)} \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) \]
                                6. associate-*l*N/A

                                  \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
                                7. lower-*.f64N/A

                                  \[\leadsto \color{blue}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \left(e^{\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \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)\right)} \]
                              4. Applied rewrites79.0%

                                \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{y.re} \cdot \left({\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{\left(-y.im\right)} \cdot \cos \left(\mathsf{fma}\left(y.im, \log \left(\sqrt{\mathsf{hypot}\left(x.im, x.re\right)}\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} \]
                              5. 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^{-1 \cdot \left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \]
                              6. Step-by-step derivation
                                1. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto 1 \cdot e^{\color{blue}{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \]
                              10. Recombined 2 regimes into one program.
                              11. Add Preprocessing

                              Alternative 11: 58.9% accurate, 4.8× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot 1\\ \mathbf{if}\;y.re \leq -4 \cdot 10^{-8}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 0.00205:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                              (FPCore (x.re x.im y.re y.im)
                               :precision binary64
                               (let* ((t_0 (* (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re) 1.0)))
                                 (if (<= y.re -4e-8) t_0 (if (<= y.re 0.00205) 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(fma(0.5, ((x_46_im * x_46_im) / x_46_re), x_46_re), y_46_re) * 1.0;
                              	double tmp;
                              	if (y_46_re <= -4e-8) {
                              		tmp = t_0;
                              	} else if (y_46_re <= 0.00205) {
                              		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((fma(0.5, Float64(Float64(x_46_im * x_46_im) / x_46_re), x_46_re) ^ y_46_re) * 1.0)
                              	tmp = 0.0
                              	if (y_46_re <= -4e-8)
                              		tmp = t_0;
                              	elseif (y_46_re <= 0.00205)
                              		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[(N[Power[N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[y$46$re, -4e-8], t$95$0, If[LessEqual[y$46$re, 0.00205], 1.0, t$95$0]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              t_0 := {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot 1\\
                              \mathbf{if}\;y.re \leq -4 \cdot 10^{-8}:\\
                              \;\;\;\;t\_0\\
                              
                              \mathbf{elif}\;y.re \leq 0.00205:\\
                              \;\;\;\;1\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;t\_0\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if y.re < -4.0000000000000001e-8 or 0.00205000000000000017 < y.re

                                1. Initial program 36.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. unpow2N/A

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

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

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

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

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

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

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

                                  \[\leadsto {\left(x.re + \frac{1}{2} \cdot \frac{{x.im}^{2}}{x.re}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                7. Step-by-step derivation
                                  1. Applied rewrites66.0%

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

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

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

                                    if -4.0000000000000001e-8 < y.re < 0.00205000000000000017

                                    1. Initial program 44.6%

                                      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                    2. 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. unpow2N/A

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

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

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

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

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

                                        \[\leadsto {\left(\sqrt{\mathsf{hypot}\left(x.re, 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.4%

                                      \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.re, 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 rewrites55.4%

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

                                    Alternative 12: 54.4% accurate, 5.6× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x.re \leq -1.2 \cdot 10^{-136}:\\ \;\;\;\;{\left(-x.re\right)}^{y.re} \cdot 1\\ \mathbf{elif}\;x.re \leq 2.4 \cdot 10^{-250}:\\ \;\;\;\;{\left(-x.im\right)}^{y.re} \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 -1.2e-136)
                                       (* (pow (- x.re) y.re) 1.0)
                                       (if (<= x.re 2.4e-250)
                                         (* (pow (- x.im) 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 <= -1.2e-136) {
                                    		tmp = pow(-x_46_re, y_46_re) * 1.0;
                                    	} else if (x_46_re <= 2.4e-250) {
                                    		tmp = pow(-x_46_im, 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 <= (-1.2d-136)) then
                                            tmp = (-x_46re ** y_46re) * 1.0d0
                                        else if (x_46re <= 2.4d-250) then
                                            tmp = (-x_46im ** 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 <= -1.2e-136) {
                                    		tmp = Math.pow(-x_46_re, y_46_re) * 1.0;
                                    	} else if (x_46_re <= 2.4e-250) {
                                    		tmp = Math.pow(-x_46_im, 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 <= -1.2e-136:
                                    		tmp = math.pow(-x_46_re, y_46_re) * 1.0
                                    	elif x_46_re <= 2.4e-250:
                                    		tmp = math.pow(-x_46_im, 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 <= -1.2e-136)
                                    		tmp = Float64((Float64(-x_46_re) ^ y_46_re) * 1.0);
                                    	elseif (x_46_re <= 2.4e-250)
                                    		tmp = Float64((Float64(-x_46_im) ^ 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 <= -1.2e-136)
                                    		tmp = (-x_46_re ^ y_46_re) * 1.0;
                                    	elseif (x_46_re <= 2.4e-250)
                                    		tmp = (-x_46_im ^ 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, -1.2e-136], N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$re, 2.4e-250], N[(N[Power[(-x$46$im), y$46$re], $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 -1.2 \cdot 10^{-136}:\\
                                    \;\;\;\;{\left(-x.re\right)}^{y.re} \cdot 1\\
                                    
                                    \mathbf{elif}\;x.re \leq 2.4 \cdot 10^{-250}:\\
                                    \;\;\;\;{\left(-x.im\right)}^{y.re} \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 < -1.1999999999999999e-136

                                      1. Initial program 47.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. unpow2N/A

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

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

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

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

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

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

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

                                        \[\leadsto {\left(x.re + \frac{1}{2} \cdot \frac{{x.im}^{2}}{x.re}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites37.3%

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

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

                                            \[\leadsto {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\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 rewrites64.8%

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

                                            if -1.1999999999999999e-136 < x.re < 2.3999999999999999e-250

                                            1. Initial program 47.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. unpow2N/A

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

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

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

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

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

                                                \[\leadsto {\left(\sqrt{\mathsf{hypot}\left(x.re, 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.2%

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

                                              \[\leadsto {\left(x.re + \frac{1}{2} \cdot \frac{{x.im}^{2}}{x.re}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites37.6%

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

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

                                                  \[\leadsto {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\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 2.3999999999999999e-250 < x.re

                                                  1. Initial program 32.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. unpow2N/A

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

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

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

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

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

                                                      \[\leadsto {\left(\sqrt{\mathsf{hypot}\left(x.re, 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.2%

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

                                                    \[\leadsto {\left(x.re + \frac{1}{2} \cdot \frac{{x.im}^{2}}{x.re}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                  7. Step-by-step derivation
                                                    1. Applied rewrites56.0%

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

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

                                                        \[\leadsto {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\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 rewrites56.6%

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

                                                      Alternative 13: 54.0% accurate, 5.7× speedup?

                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x.im \leq -1.12 \cdot 10^{-221}:\\ \;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\ \mathbf{elif}\;x.im \leq 7.8 \cdot 10^{-74}:\\ \;\;\;\;{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 -1.12e-221)
                                                         (* (pow (- x.im) y.re) 1.0)
                                                         (if (<= x.im 7.8e-74) (* (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 <= -1.12e-221) {
                                                      		tmp = pow(-x_46_im, y_46_re) * 1.0;
                                                      	} else if (x_46_im <= 7.8e-74) {
                                                      		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 <= (-1.12d-221)) then
                                                              tmp = (-x_46im ** y_46re) * 1.0d0
                                                          else if (x_46im <= 7.8d-74) 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 <= -1.12e-221) {
                                                      		tmp = Math.pow(-x_46_im, y_46_re) * 1.0;
                                                      	} else if (x_46_im <= 7.8e-74) {
                                                      		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 <= -1.12e-221:
                                                      		tmp = math.pow(-x_46_im, y_46_re) * 1.0
                                                      	elif x_46_im <= 7.8e-74:
                                                      		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 <= -1.12e-221)
                                                      		tmp = Float64((Float64(-x_46_im) ^ y_46_re) * 1.0);
                                                      	elseif (x_46_im <= 7.8e-74)
                                                      		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 <= -1.12e-221)
                                                      		tmp = (-x_46_im ^ y_46_re) * 1.0;
                                                      	elseif (x_46_im <= 7.8e-74)
                                                      		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, -1.12e-221], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$im, 7.8e-74], 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 -1.12 \cdot 10^{-221}:\\
                                                      \;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\
                                                      
                                                      \mathbf{elif}\;x.im \leq 7.8 \cdot 10^{-74}:\\
                                                      \;\;\;\;{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 < -1.12000000000000003e-221

                                                        1. Initial program 46.6%

                                                          \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                                        2. 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. unpow2N/A

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

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

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

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

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

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

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

                                                          \[\leadsto {\left(x.re + \frac{1}{2} \cdot \frac{{x.im}^{2}}{x.re}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                        7. Step-by-step derivation
                                                          1. Applied rewrites36.8%

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

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

                                                              \[\leadsto {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\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 rewrites56.3%

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

                                                              if -1.12000000000000003e-221 < x.im < 7.8000000000000003e-74

                                                              1. Initial program 44.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. unpow2N/A

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

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

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

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

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

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

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

                                                                \[\leadsto {\left(x.re + \frac{1}{2} \cdot \frac{{x.im}^{2}}{x.re}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                              7. Step-by-step derivation
                                                                1. Applied rewrites59.2%

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

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

                                                                    \[\leadsto {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\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.0%

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

                                                                    if 7.8000000000000003e-74 < x.im

                                                                    1. Initial program 29.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. unpow2N/A

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

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

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

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

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

                                                                        \[\leadsto {\left(\sqrt{\mathsf{hypot}\left(x.re, 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{hypot}\left(x.re, x.im\right)}\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                    6. Taylor expanded in x.im around 0

                                                                      \[\leadsto {\left(x.re + \frac{1}{2} \cdot \frac{{x.im}^{2}}{x.re}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                                    7. Step-by-step derivation
                                                                      1. Applied rewrites47.2%

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

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

                                                                          \[\leadsto {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\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 rewrites54.6%

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

                                                                        Alternative 14: 52.6% accurate, 5.7× speedup?

                                                                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x.re}^{y.re} \cdot 1\\ \mathbf{if}\;y.re \leq -0.0015:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 1.68 \cdot 10^{-18}:\\ \;\;\;\;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.re y.re) 1.0)))
                                                                           (if (<= y.re -0.0015) t_0 (if (<= y.re 1.68e-18) 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_re, y_46_re) * 1.0;
                                                                        	double tmp;
                                                                        	if (y_46_re <= -0.0015) {
                                                                        		tmp = t_0;
                                                                        	} else if (y_46_re <= 1.68e-18) {
                                                                        		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_46re ** y_46re) * 1.0d0
                                                                            if (y_46re <= (-0.0015d0)) then
                                                                                tmp = t_0
                                                                            else if (y_46re <= 1.68d-18) 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_re, y_46_re) * 1.0;
                                                                        	double tmp;
                                                                        	if (y_46_re <= -0.0015) {
                                                                        		tmp = t_0;
                                                                        	} else if (y_46_re <= 1.68e-18) {
                                                                        		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_re, y_46_re) * 1.0
                                                                        	tmp = 0
                                                                        	if y_46_re <= -0.0015:
                                                                        		tmp = t_0
                                                                        	elif y_46_re <= 1.68e-18:
                                                                        		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_re ^ y_46_re) * 1.0)
                                                                        	tmp = 0.0
                                                                        	if (y_46_re <= -0.0015)
                                                                        		tmp = t_0;
                                                                        	elseif (y_46_re <= 1.68e-18)
                                                                        		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_re ^ y_46_re) * 1.0;
                                                                        	tmp = 0.0;
                                                                        	if (y_46_re <= -0.0015)
                                                                        		tmp = t_0;
                                                                        	elseif (y_46_re <= 1.68e-18)
                                                                        		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$re, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[y$46$re, -0.0015], t$95$0, If[LessEqual[y$46$re, 1.68e-18], 1.0, t$95$0]]]
                                                                        
                                                                        \begin{array}{l}
                                                                        
                                                                        \\
                                                                        \begin{array}{l}
                                                                        t_0 := {x.re}^{y.re} \cdot 1\\
                                                                        \mathbf{if}\;y.re \leq -0.0015:\\
                                                                        \;\;\;\;t\_0\\
                                                                        
                                                                        \mathbf{elif}\;y.re \leq 1.68 \cdot 10^{-18}:\\
                                                                        \;\;\;\;1\\
                                                                        
                                                                        \mathbf{else}:\\
                                                                        \;\;\;\;t\_0\\
                                                                        
                                                                        
                                                                        \end{array}
                                                                        \end{array}
                                                                        
                                                                        Derivation
                                                                        1. Split input into 2 regimes
                                                                        2. if y.re < -0.0015 or 1.6799999999999999e-18 < y.re

                                                                          1. Initial program 35.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. unpow2N/A

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

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

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

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

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

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

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

                                                                            \[\leadsto {\left(x.re + \frac{1}{2} \cdot \frac{{x.im}^{2}}{x.re}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                                          7. Step-by-step derivation
                                                                            1. Applied rewrites64.7%

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

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

                                                                                \[\leadsto {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\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 rewrites61.3%

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

                                                                                if -0.0015 < y.re < 1.6799999999999999e-18

                                                                                1. Initial program 45.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. unpow2N/A

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

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

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

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

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

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

                                                                                  \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.re, 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 rewrites54.4%

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

                                                                                Alternative 15: 51.9% accurate, 5.7× speedup?

                                                                                \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x.im}^{y.re} \cdot 1\\ \mathbf{if}\;y.re \leq -3.9:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 1.68 \cdot 10^{-18}:\\ \;\;\;\;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 -3.9) t_0 (if (<= y.re 1.68e-18) 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 <= -3.9) {
                                                                                		tmp = t_0;
                                                                                	} else if (y_46_re <= 1.68e-18) {
                                                                                		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 <= (-3.9d0)) then
                                                                                        tmp = t_0
                                                                                    else if (y_46re <= 1.68d-18) 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 <= -3.9) {
                                                                                		tmp = t_0;
                                                                                	} else if (y_46_re <= 1.68e-18) {
                                                                                		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 <= -3.9:
                                                                                		tmp = t_0
                                                                                	elif y_46_re <= 1.68e-18:
                                                                                		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 <= -3.9)
                                                                                		tmp = t_0;
                                                                                	elseif (y_46_re <= 1.68e-18)
                                                                                		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 <= -3.9)
                                                                                		tmp = t_0;
                                                                                	elseif (y_46_re <= 1.68e-18)
                                                                                		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, -3.9], t$95$0, If[LessEqual[y$46$re, 1.68e-18], 1.0, t$95$0]]]
                                                                                
                                                                                \begin{array}{l}
                                                                                
                                                                                \\
                                                                                \begin{array}{l}
                                                                                t_0 := {x.im}^{y.re} \cdot 1\\
                                                                                \mathbf{if}\;y.re \leq -3.9:\\
                                                                                \;\;\;\;t\_0\\
                                                                                
                                                                                \mathbf{elif}\;y.re \leq 1.68 \cdot 10^{-18}:\\
                                                                                \;\;\;\;1\\
                                                                                
                                                                                \mathbf{else}:\\
                                                                                \;\;\;\;t\_0\\
                                                                                
                                                                                
                                                                                \end{array}
                                                                                \end{array}
                                                                                
                                                                                Derivation
                                                                                1. Split input into 2 regimes
                                                                                2. if y.re < -3.89999999999999991 or 1.6799999999999999e-18 < y.re

                                                                                  1. Initial program 35.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. unpow2N/A

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

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

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

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

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

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

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

                                                                                    \[\leadsto {\left(x.re + \frac{1}{2} \cdot \frac{{x.im}^{2}}{x.re}\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                                                  7. Step-by-step derivation
                                                                                    1. Applied rewrites64.9%

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

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

                                                                                        \[\leadsto {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\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 rewrites54.8%

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

                                                                                        if -3.89999999999999991 < y.re < 1.6799999999999999e-18

                                                                                        1. Initial program 45.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. unpow2N/A

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

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

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

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

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

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

                                                                                          \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.re, 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 rewrites54.1%

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

                                                                                        Alternative 16: 25.8% 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 40.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. unpow2N/A

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

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

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

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

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

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

                                                                                          \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(x.re, 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 rewrites31.5%

                                                                                            \[\leadsto 1 \]
                                                                                          2. Add Preprocessing

                                                                                          Reproduce

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