powComplex, real part

Percentage Accurate: 40.7% → 77.6%
Time: 16.3s
Alternatives: 14
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 14 alternatives:

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

Initial Program: 40.7% accurate, 1.0× speedup?

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

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

Alternative 1: 77.6% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\\
t_1 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -5.5 \cdot 10^{-25}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t\_1\\

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

\mathbf{else}:\\
\;\;\;\;{\left(t\_0 \cdot t\_0\right)}^{\left(y.re \cdot 0.25\right)} \cdot 1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y.re < -5.50000000000000004e-25

    1. Initial program 48.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 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. 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(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
      2. lower-atan2.f6477.1

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

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

    if -5.50000000000000004e-25 < y.re < 215

    1. Initial program 40.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 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. 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(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
      2. lower-atan2.f6446.3

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

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

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

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

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

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

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

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

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

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

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

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

    if 215 < y.re

    1. Initial program 26.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. lower-*.f64N/A

        \[\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}} \]
      2. lower-cos.f64N/A

        \[\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} \]
      3. lower-*.f64N/A

        \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 2: 76.3% accurate, 1.6× speedup?

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

          1. Initial program 47.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. lower-*.f64N/A

              \[\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}} \]
            2. lower-cos.f64N/A

              \[\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} \]
            3. lower-*.f64N/A

              \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

            if -2.15e8 < y.re < 215

            1. Initial program 41.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 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. 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(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
              2. lower-atan2.f6445.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(y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right) \]
            5. Applied rewrites45.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(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
            6. Taylor expanded in y.re around 0

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

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

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

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

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

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

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

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

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

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

            if 215 < y.re

            1. Initial program 26.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. lower-*.f64N/A

                \[\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}} \]
              2. lower-cos.f64N/A

                \[\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} \]
              3. lower-*.f64N/A

                \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 3: 76.3% accurate, 2.0× speedup?

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

                  1. Initial program 47.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. lower-*.f64N/A

                      \[\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}} \]
                    2. lower-cos.f64N/A

                      \[\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} \]
                    3. lower-*.f64N/A

                      \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

                    if -2.15e8 < y.re < 215

                    1. Initial program 41.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 x.re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 215 < y.re

                        1. Initial program 26.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. lower-*.f64N/A

                            \[\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}} \]
                          2. lower-cos.f64N/A

                            \[\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} \]
                          3. lower-*.f64N/A

                            \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                            Alternative 4: 77.2% accurate, 2.0× speedup?

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

                              1. Initial program 47.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. lower-*.f64N/A

                                  \[\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}} \]
                                2. lower-cos.f64N/A

                                  \[\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} \]
                                3. lower-*.f64N/A

                                  \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

                              if -0.340000000000000024 < y.re < 215

                              1. Initial program 41.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 x.re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  if 215 < y.re

                                  1. Initial program 26.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. lower-*.f64N/A

                                      \[\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}} \]
                                    2. lower-cos.f64N/A

                                      \[\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} \]
                                    3. lower-*.f64N/A

                                      \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                      Alternative 5: 76.5% accurate, 3.0× speedup?

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

                                        1. Initial program 47.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. lower-*.f64N/A

                                            \[\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}} \]
                                          2. lower-cos.f64N/A

                                            \[\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} \]
                                          3. lower-*.f64N/A

                                            \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                            if -2.5e8 < y.re < 215

                                            1. Initial program 41.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 x.re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                if 215 < y.re

                                                1. Initial program 26.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. lower-*.f64N/A

                                                    \[\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}} \]
                                                  2. lower-cos.f64N/A

                                                    \[\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} \]
                                                  3. lower-*.f64N/A

                                                    \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                    Alternative 6: 61.2% accurate, 4.5× speedup?

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

                                                      1. Initial program 47.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. lower-*.f64N/A

                                                          \[\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}} \]
                                                        2. lower-cos.f64N/A

                                                          \[\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} \]
                                                        3. lower-*.f64N/A

                                                          \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                          if -0.0140000000000000003 < y.re < 2.2999999999999998e-19

                                                          1. Initial program 40.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 x.re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                              if 2.2999999999999998e-19 < y.re

                                                              1. Initial program 29.0%

                                                                \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                                              2. Add Preprocessing
                                                              3. Taylor expanded in y.im around 0

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

                                                                  \[\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}} \]
                                                                2. lower-cos.f64N/A

                                                                  \[\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} \]
                                                                3. lower-*.f64N/A

                                                                  \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                  Alternative 7: 61.4% accurate, 5.0× speedup?

                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -0.014:\\ \;\;\;\;1 \cdot {\left(\mathsf{fma}\left(0.5, \frac{x.re \cdot x.re}{x.im}, x.im\right)\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq 2.7 \cdot 10^{-19}:\\ \;\;\;\;1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ \mathbf{else}:\\ \;\;\;\;1 \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)}\\ \end{array} \end{array} \]
                                                                  (FPCore (x.re x.im y.re y.im)
                                                                   :precision binary64
                                                                   (if (<= y.re -0.014)
                                                                     (* 1.0 (pow (fma 0.5 (/ (* x.re x.re) x.im) x.im) y.re))
                                                                     (if (<= y.re 2.7e-19)
                                                                       (- 1.0 (* (atan2 x.im x.re) y.im))
                                                                       (* 1.0 (pow (fma x.re x.re (* x.im x.im)) (* y.re 0.5))))))
                                                                  double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                  	double tmp;
                                                                  	if (y_46_re <= -0.014) {
                                                                  		tmp = 1.0 * pow(fma(0.5, ((x_46_re * x_46_re) / x_46_im), x_46_im), y_46_re);
                                                                  	} else if (y_46_re <= 2.7e-19) {
                                                                  		tmp = 1.0 - (atan2(x_46_im, x_46_re) * y_46_im);
                                                                  	} else {
                                                                  		tmp = 1.0 * pow(fma(x_46_re, x_46_re, (x_46_im * x_46_im)), (y_46_re * 0.5));
                                                                  	}
                                                                  	return tmp;
                                                                  }
                                                                  
                                                                  function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                  	tmp = 0.0
                                                                  	if (y_46_re <= -0.014)
                                                                  		tmp = Float64(1.0 * (fma(0.5, Float64(Float64(x_46_re * x_46_re) / x_46_im), x_46_im) ^ y_46_re));
                                                                  	elseif (y_46_re <= 2.7e-19)
                                                                  		tmp = Float64(1.0 - Float64(atan(x_46_im, x_46_re) * y_46_im));
                                                                  	else
                                                                  		tmp = Float64(1.0 * (fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)) ^ Float64(y_46_re * 0.5)));
                                                                  	end
                                                                  	return tmp
                                                                  end
                                                                  
                                                                  code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -0.014], N[(1.0 * 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]), $MachinePrecision], If[LessEqual[y$46$re, 2.7e-19], N[(1.0 - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Power[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
                                                                  
                                                                  \begin{array}{l}
                                                                  
                                                                  \\
                                                                  \begin{array}{l}
                                                                  \mathbf{if}\;y.re \leq -0.014:\\
                                                                  \;\;\;\;1 \cdot {\left(\mathsf{fma}\left(0.5, \frac{x.re \cdot x.re}{x.im}, x.im\right)\right)}^{y.re}\\
                                                                  
                                                                  \mathbf{elif}\;y.re \leq 2.7 \cdot 10^{-19}:\\
                                                                  \;\;\;\;1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
                                                                  
                                                                  \mathbf{else}:\\
                                                                  \;\;\;\;1 \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)}\\
                                                                  
                                                                  
                                                                  \end{array}
                                                                  \end{array}
                                                                  
                                                                  Derivation
                                                                  1. Split input into 3 regimes
                                                                  2. if y.re < -0.0140000000000000003

                                                                    1. Initial program 47.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. lower-*.f64N/A

                                                                        \[\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}} \]
                                                                      2. lower-cos.f64N/A

                                                                        \[\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} \]
                                                                      3. lower-*.f64N/A

                                                                        \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                                        if -0.0140000000000000003 < y.re < 2.7000000000000001e-19

                                                                        1. Initial program 40.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 x.re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                            if 2.7000000000000001e-19 < y.re

                                                                            1. Initial program 29.0%

                                                                              \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                                                            2. Add Preprocessing
                                                                            3. Taylor expanded in y.im around 0

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

                                                                                \[\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}} \]
                                                                              2. lower-cos.f64N/A

                                                                                \[\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} \]
                                                                              3. lower-*.f64N/A

                                                                                \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

                                                                                  \[\leadsto {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)} \cdot \color{blue}{1} \]
                                                                              3. Recombined 3 regimes into one program.
                                                                              4. Final simplification60.0%

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

                                                                              Alternative 8: 62.5% accurate, 5.0× speedup?

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

                                                                                1. Initial program 39.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. lower-*.f64N/A

                                                                                    \[\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}} \]
                                                                                  2. lower-cos.f64N/A

                                                                                    \[\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} \]
                                                                                  3. lower-*.f64N/A

                                                                                    \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                                                                                    if -4.99999999999999962e-25 < y.re < 2.7000000000000001e-19

                                                                                    1. Initial program 38.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 x.re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                          \[\leadsto 1 - y.im \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                                                                                      4. Recombined 2 regimes into one program.
                                                                                      5. Final simplification59.8%

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

                                                                                      Alternative 9: 58.0% accurate, 5.3× speedup?

                                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x.im \leq -1.25 \cdot 10^{-27}:\\ \;\;\;\;1 \cdot {\left(-x.im\right)}^{y.re}\\ \mathbf{elif}\;x.im \leq 1.9 \cdot 10^{-60}:\\ \;\;\;\;1 \cdot {\left(x.re \cdot x.re\right)}^{\left(y.re \cdot 0.5\right)}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot {x.im}^{y.re}\\ \end{array} \end{array} \]
                                                                                      (FPCore (x.re x.im y.re y.im)
                                                                                       :precision binary64
                                                                                       (if (<= x.im -1.25e-27)
                                                                                         (* 1.0 (pow (- x.im) y.re))
                                                                                         (if (<= x.im 1.9e-60)
                                                                                           (* 1.0 (pow (* x.re x.re) (* y.re 0.5)))
                                                                                           (* 1.0 (pow 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 (x_46_im <= -1.25e-27) {
                                                                                      		tmp = 1.0 * pow(-x_46_im, y_46_re);
                                                                                      	} else if (x_46_im <= 1.9e-60) {
                                                                                      		tmp = 1.0 * pow((x_46_re * x_46_re), (y_46_re * 0.5));
                                                                                      	} else {
                                                                                      		tmp = 1.0 * pow(x_46_im, y_46_re);
                                                                                      	}
                                                                                      	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.25d-27)) then
                                                                                              tmp = 1.0d0 * (-x_46im ** y_46re)
                                                                                          else if (x_46im <= 1.9d-60) then
                                                                                              tmp = 1.0d0 * ((x_46re * x_46re) ** (y_46re * 0.5d0))
                                                                                          else
                                                                                              tmp = 1.0d0 * (x_46im ** y_46re)
                                                                                          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.25e-27) {
                                                                                      		tmp = 1.0 * Math.pow(-x_46_im, y_46_re);
                                                                                      	} else if (x_46_im <= 1.9e-60) {
                                                                                      		tmp = 1.0 * Math.pow((x_46_re * x_46_re), (y_46_re * 0.5));
                                                                                      	} else {
                                                                                      		tmp = 1.0 * Math.pow(x_46_im, y_46_re);
                                                                                      	}
                                                                                      	return tmp;
                                                                                      }
                                                                                      
                                                                                      def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                                                                      	tmp = 0
                                                                                      	if x_46_im <= -1.25e-27:
                                                                                      		tmp = 1.0 * math.pow(-x_46_im, y_46_re)
                                                                                      	elif x_46_im <= 1.9e-60:
                                                                                      		tmp = 1.0 * math.pow((x_46_re * x_46_re), (y_46_re * 0.5))
                                                                                      	else:
                                                                                      		tmp = 1.0 * math.pow(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 (x_46_im <= -1.25e-27)
                                                                                      		tmp = Float64(1.0 * (Float64(-x_46_im) ^ y_46_re));
                                                                                      	elseif (x_46_im <= 1.9e-60)
                                                                                      		tmp = Float64(1.0 * (Float64(x_46_re * x_46_re) ^ Float64(y_46_re * 0.5)));
                                                                                      	else
                                                                                      		tmp = Float64(1.0 * (x_46_im ^ y_46_re));
                                                                                      	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.25e-27)
                                                                                      		tmp = 1.0 * (-x_46_im ^ y_46_re);
                                                                                      	elseif (x_46_im <= 1.9e-60)
                                                                                      		tmp = 1.0 * ((x_46_re * x_46_re) ^ (y_46_re * 0.5));
                                                                                      	else
                                                                                      		tmp = 1.0 * (x_46_im ^ y_46_re);
                                                                                      	end
                                                                                      	tmp_2 = tmp;
                                                                                      end
                                                                                      
                                                                                      code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, -1.25e-27], N[(1.0 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.9e-60], N[(1.0 * N[Power[N[(x$46$re * x$46$re), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]
                                                                                      
                                                                                      \begin{array}{l}
                                                                                      
                                                                                      \\
                                                                                      \begin{array}{l}
                                                                                      \mathbf{if}\;x.im \leq -1.25 \cdot 10^{-27}:\\
                                                                                      \;\;\;\;1 \cdot {\left(-x.im\right)}^{y.re}\\
                                                                                      
                                                                                      \mathbf{elif}\;x.im \leq 1.9 \cdot 10^{-60}:\\
                                                                                      \;\;\;\;1 \cdot {\left(x.re \cdot x.re\right)}^{\left(y.re \cdot 0.5\right)}\\
                                                                                      
                                                                                      \mathbf{else}:\\
                                                                                      \;\;\;\;1 \cdot {x.im}^{y.re}\\
                                                                                      
                                                                                      
                                                                                      \end{array}
                                                                                      \end{array}
                                                                                      
                                                                                      Derivation
                                                                                      1. Split input into 3 regimes
                                                                                      2. if x.im < -1.25e-27

                                                                                        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. lower-*.f64N/A

                                                                                            \[\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}} \]
                                                                                          2. lower-cos.f64N/A

                                                                                            \[\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} \]
                                                                                          3. lower-*.f64N/A

                                                                                            \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                            if -1.25e-27 < x.im < 1.89999999999999997e-60

                                                                                            1. Initial program 42.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. lower-*.f64N/A

                                                                                                \[\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}} \]
                                                                                              2. lower-cos.f64N/A

                                                                                                \[\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} \]
                                                                                              3. lower-*.f64N/A

                                                                                                \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                  if 1.89999999999999997e-60 < x.im

                                                                                                  1. Initial program 38.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. lower-*.f64N/A

                                                                                                      \[\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}} \]
                                                                                                    2. lower-cos.f64N/A

                                                                                                      \[\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} \]
                                                                                                    3. lower-*.f64N/A

                                                                                                      \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                                                                                                        \[\leadsto 1 \cdot {x.im}^{\color{blue}{y.re}} \]
                                                                                                    4. Recombined 3 regimes into one program.
                                                                                                    5. Final simplification58.0%

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

                                                                                                    Alternative 10: 55.4% accurate, 5.6× speedup?

                                                                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x.im \leq -5 \cdot 10^{-169}:\\ \;\;\;\;1 \cdot {\left(-x.im\right)}^{y.re}\\ \mathbf{elif}\;x.im \leq 2.2 \cdot 10^{-71}:\\ \;\;\;\;1 \cdot {\left(-x.re\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot {x.im}^{y.re}\\ \end{array} \end{array} \]
                                                                                                    (FPCore (x.re x.im y.re y.im)
                                                                                                     :precision binary64
                                                                                                     (if (<= x.im -5e-169)
                                                                                                       (* 1.0 (pow (- x.im) y.re))
                                                                                                       (if (<= x.im 2.2e-71) (* 1.0 (pow (- x.re) y.re)) (* 1.0 (pow 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 (x_46_im <= -5e-169) {
                                                                                                    		tmp = 1.0 * pow(-x_46_im, y_46_re);
                                                                                                    	} else if (x_46_im <= 2.2e-71) {
                                                                                                    		tmp = 1.0 * pow(-x_46_re, y_46_re);
                                                                                                    	} else {
                                                                                                    		tmp = 1.0 * pow(x_46_im, y_46_re);
                                                                                                    	}
                                                                                                    	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 <= (-5d-169)) then
                                                                                                            tmp = 1.0d0 * (-x_46im ** y_46re)
                                                                                                        else if (x_46im <= 2.2d-71) then
                                                                                                            tmp = 1.0d0 * (-x_46re ** y_46re)
                                                                                                        else
                                                                                                            tmp = 1.0d0 * (x_46im ** y_46re)
                                                                                                        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 <= -5e-169) {
                                                                                                    		tmp = 1.0 * Math.pow(-x_46_im, y_46_re);
                                                                                                    	} else if (x_46_im <= 2.2e-71) {
                                                                                                    		tmp = 1.0 * Math.pow(-x_46_re, y_46_re);
                                                                                                    	} else {
                                                                                                    		tmp = 1.0 * Math.pow(x_46_im, y_46_re);
                                                                                                    	}
                                                                                                    	return tmp;
                                                                                                    }
                                                                                                    
                                                                                                    def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                                                                                    	tmp = 0
                                                                                                    	if x_46_im <= -5e-169:
                                                                                                    		tmp = 1.0 * math.pow(-x_46_im, y_46_re)
                                                                                                    	elif x_46_im <= 2.2e-71:
                                                                                                    		tmp = 1.0 * math.pow(-x_46_re, y_46_re)
                                                                                                    	else:
                                                                                                    		tmp = 1.0 * math.pow(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 (x_46_im <= -5e-169)
                                                                                                    		tmp = Float64(1.0 * (Float64(-x_46_im) ^ y_46_re));
                                                                                                    	elseif (x_46_im <= 2.2e-71)
                                                                                                    		tmp = Float64(1.0 * (Float64(-x_46_re) ^ y_46_re));
                                                                                                    	else
                                                                                                    		tmp = Float64(1.0 * (x_46_im ^ y_46_re));
                                                                                                    	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 <= -5e-169)
                                                                                                    		tmp = 1.0 * (-x_46_im ^ y_46_re);
                                                                                                    	elseif (x_46_im <= 2.2e-71)
                                                                                                    		tmp = 1.0 * (-x_46_re ^ y_46_re);
                                                                                                    	else
                                                                                                    		tmp = 1.0 * (x_46_im ^ y_46_re);
                                                                                                    	end
                                                                                                    	tmp_2 = tmp;
                                                                                                    end
                                                                                                    
                                                                                                    code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, -5e-169], N[(1.0 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 2.2e-71], N[(1.0 * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]
                                                                                                    
                                                                                                    \begin{array}{l}
                                                                                                    
                                                                                                    \\
                                                                                                    \begin{array}{l}
                                                                                                    \mathbf{if}\;x.im \leq -5 \cdot 10^{-169}:\\
                                                                                                    \;\;\;\;1 \cdot {\left(-x.im\right)}^{y.re}\\
                                                                                                    
                                                                                                    \mathbf{elif}\;x.im \leq 2.2 \cdot 10^{-71}:\\
                                                                                                    \;\;\;\;1 \cdot {\left(-x.re\right)}^{y.re}\\
                                                                                                    
                                                                                                    \mathbf{else}:\\
                                                                                                    \;\;\;\;1 \cdot {x.im}^{y.re}\\
                                                                                                    
                                                                                                    
                                                                                                    \end{array}
                                                                                                    \end{array}
                                                                                                    
                                                                                                    Derivation
                                                                                                    1. Split input into 3 regimes
                                                                                                    2. if x.im < -5.0000000000000002e-169

                                                                                                      1. Initial program 45.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. lower-*.f64N/A

                                                                                                          \[\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}} \]
                                                                                                        2. lower-cos.f64N/A

                                                                                                          \[\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} \]
                                                                                                        3. lower-*.f64N/A

                                                                                                          \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                          if -5.0000000000000002e-169 < x.im < 2.19999999999999997e-71

                                                                                                          1. Initial program 30.5%

                                                                                                            \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                                                                                          2. Add Preprocessing
                                                                                                          3. Taylor expanded in y.im around 0

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

                                                                                                              \[\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}} \]
                                                                                                            2. lower-cos.f64N/A

                                                                                                              \[\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} \]
                                                                                                            3. lower-*.f64N/A

                                                                                                              \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                              if 2.19999999999999997e-71 < x.im

                                                                                                              1. Initial program 38.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. lower-*.f64N/A

                                                                                                                  \[\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}} \]
                                                                                                                2. lower-cos.f64N/A

                                                                                                                  \[\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} \]
                                                                                                                3. lower-*.f64N/A

                                                                                                                  \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                Alternative 11: 55.3% accurate, 5.7× speedup?

                                                                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x.im \leq -5.3 \cdot 10^{-179}:\\ \;\;\;\;1 \cdot {\left(-x.im\right)}^{y.re}\\ \mathbf{elif}\;x.im \leq 2.6 \cdot 10^{-71}:\\ \;\;\;\;1 \cdot {x.re}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot {x.im}^{y.re}\\ \end{array} \end{array} \]
                                                                                                                (FPCore (x.re x.im y.re y.im)
                                                                                                                 :precision binary64
                                                                                                                 (if (<= x.im -5.3e-179)
                                                                                                                   (* 1.0 (pow (- x.im) y.re))
                                                                                                                   (if (<= x.im 2.6e-71) (* 1.0 (pow x.re y.re)) (* 1.0 (pow 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 (x_46_im <= -5.3e-179) {
                                                                                                                		tmp = 1.0 * pow(-x_46_im, y_46_re);
                                                                                                                	} else if (x_46_im <= 2.6e-71) {
                                                                                                                		tmp = 1.0 * pow(x_46_re, y_46_re);
                                                                                                                	} else {
                                                                                                                		tmp = 1.0 * pow(x_46_im, y_46_re);
                                                                                                                	}
                                                                                                                	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 <= (-5.3d-179)) then
                                                                                                                        tmp = 1.0d0 * (-x_46im ** y_46re)
                                                                                                                    else if (x_46im <= 2.6d-71) then
                                                                                                                        tmp = 1.0d0 * (x_46re ** y_46re)
                                                                                                                    else
                                                                                                                        tmp = 1.0d0 * (x_46im ** y_46re)
                                                                                                                    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 <= -5.3e-179) {
                                                                                                                		tmp = 1.0 * Math.pow(-x_46_im, y_46_re);
                                                                                                                	} else if (x_46_im <= 2.6e-71) {
                                                                                                                		tmp = 1.0 * Math.pow(x_46_re, y_46_re);
                                                                                                                	} else {
                                                                                                                		tmp = 1.0 * Math.pow(x_46_im, y_46_re);
                                                                                                                	}
                                                                                                                	return tmp;
                                                                                                                }
                                                                                                                
                                                                                                                def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                                                                                                	tmp = 0
                                                                                                                	if x_46_im <= -5.3e-179:
                                                                                                                		tmp = 1.0 * math.pow(-x_46_im, y_46_re)
                                                                                                                	elif x_46_im <= 2.6e-71:
                                                                                                                		tmp = 1.0 * math.pow(x_46_re, y_46_re)
                                                                                                                	else:
                                                                                                                		tmp = 1.0 * math.pow(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 (x_46_im <= -5.3e-179)
                                                                                                                		tmp = Float64(1.0 * (Float64(-x_46_im) ^ y_46_re));
                                                                                                                	elseif (x_46_im <= 2.6e-71)
                                                                                                                		tmp = Float64(1.0 * (x_46_re ^ y_46_re));
                                                                                                                	else
                                                                                                                		tmp = Float64(1.0 * (x_46_im ^ y_46_re));
                                                                                                                	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 <= -5.3e-179)
                                                                                                                		tmp = 1.0 * (-x_46_im ^ y_46_re);
                                                                                                                	elseif (x_46_im <= 2.6e-71)
                                                                                                                		tmp = 1.0 * (x_46_re ^ y_46_re);
                                                                                                                	else
                                                                                                                		tmp = 1.0 * (x_46_im ^ y_46_re);
                                                                                                                	end
                                                                                                                	tmp_2 = tmp;
                                                                                                                end
                                                                                                                
                                                                                                                code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, -5.3e-179], N[(1.0 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 2.6e-71], N[(1.0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]
                                                                                                                
                                                                                                                \begin{array}{l}
                                                                                                                
                                                                                                                \\
                                                                                                                \begin{array}{l}
                                                                                                                \mathbf{if}\;x.im \leq -5.3 \cdot 10^{-179}:\\
                                                                                                                \;\;\;\;1 \cdot {\left(-x.im\right)}^{y.re}\\
                                                                                                                
                                                                                                                \mathbf{elif}\;x.im \leq 2.6 \cdot 10^{-71}:\\
                                                                                                                \;\;\;\;1 \cdot {x.re}^{y.re}\\
                                                                                                                
                                                                                                                \mathbf{else}:\\
                                                                                                                \;\;\;\;1 \cdot {x.im}^{y.re}\\
                                                                                                                
                                                                                                                
                                                                                                                \end{array}
                                                                                                                \end{array}
                                                                                                                
                                                                                                                Derivation
                                                                                                                1. Split input into 3 regimes
                                                                                                                2. if x.im < -5.29999999999999994e-179

                                                                                                                  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. lower-*.f64N/A

                                                                                                                      \[\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}} \]
                                                                                                                    2. lower-cos.f64N/A

                                                                                                                      \[\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} \]
                                                                                                                    3. lower-*.f64N/A

                                                                                                                      \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                      if -5.29999999999999994e-179 < x.im < 2.5999999999999999e-71

                                                                                                                      1. Initial program 31.4%

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

                                                                                                                          \[\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}} \]
                                                                                                                        2. lower-cos.f64N/A

                                                                                                                          \[\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} \]
                                                                                                                        3. lower-*.f64N/A

                                                                                                                          \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

                                                                                                                          \[\leadsto 1 \cdot {x.re}^{\color{blue}{y.re}} \]
                                                                                                                        3. Step-by-step derivation
                                                                                                                          1. Applied rewrites51.4%

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

                                                                                                                          if 2.5999999999999999e-71 < x.im

                                                                                                                          1. Initial program 38.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. lower-*.f64N/A

                                                                                                                              \[\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}} \]
                                                                                                                            2. lower-cos.f64N/A

                                                                                                                              \[\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} \]
                                                                                                                            3. lower-*.f64N/A

                                                                                                                              \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                            Alternative 12: 48.8% accurate, 5.7× speedup?

                                                                                                                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 \cdot {x.re}^{y.re}\\ \mathbf{if}\;x.re \leq -3.6 \cdot 10^{-15}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x.re \leq 1.6 \cdot 10^{-110}:\\ \;\;\;\;1 \cdot {x.im}^{y.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 x.re y.re))))
                                                                                                                               (if (<= x.re -3.6e-15)
                                                                                                                                 t_0
                                                                                                                                 (if (<= x.re 1.6e-110) (* 1.0 (pow x.im y.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(x_46_re, y_46_re);
                                                                                                                            	double tmp;
                                                                                                                            	if (x_46_re <= -3.6e-15) {
                                                                                                                            		tmp = t_0;
                                                                                                                            	} else if (x_46_re <= 1.6e-110) {
                                                                                                                            		tmp = 1.0 * pow(x_46_im, y_46_re);
                                                                                                                            	} 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 = 1.0d0 * (x_46re ** y_46re)
                                                                                                                                if (x_46re <= (-3.6d-15)) then
                                                                                                                                    tmp = t_0
                                                                                                                                else if (x_46re <= 1.6d-110) then
                                                                                                                                    tmp = 1.0d0 * (x_46im ** y_46re)
                                                                                                                                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 = 1.0 * Math.pow(x_46_re, y_46_re);
                                                                                                                            	double tmp;
                                                                                                                            	if (x_46_re <= -3.6e-15) {
                                                                                                                            		tmp = t_0;
                                                                                                                            	} else if (x_46_re <= 1.6e-110) {
                                                                                                                            		tmp = 1.0 * Math.pow(x_46_im, y_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(x_46_re, y_46_re)
                                                                                                                            	tmp = 0
                                                                                                                            	if x_46_re <= -3.6e-15:
                                                                                                                            		tmp = t_0
                                                                                                                            	elif x_46_re <= 1.6e-110:
                                                                                                                            		tmp = 1.0 * math.pow(x_46_im, y_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 * (x_46_re ^ y_46_re))
                                                                                                                            	tmp = 0.0
                                                                                                                            	if (x_46_re <= -3.6e-15)
                                                                                                                            		tmp = t_0;
                                                                                                                            	elseif (x_46_re <= 1.6e-110)
                                                                                                                            		tmp = Float64(1.0 * (x_46_im ^ y_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 * (x_46_re ^ y_46_re);
                                                                                                                            	tmp = 0.0;
                                                                                                                            	if (x_46_re <= -3.6e-15)
                                                                                                                            		tmp = t_0;
                                                                                                                            	elseif (x_46_re <= 1.6e-110)
                                                                                                                            		tmp = 1.0 * (x_46_im ^ y_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[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -3.6e-15], t$95$0, If[LessEqual[x$46$re, 1.6e-110], N[(1.0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], t$95$0]]]
                                                                                                                            
                                                                                                                            \begin{array}{l}
                                                                                                                            
                                                                                                                            \\
                                                                                                                            \begin{array}{l}
                                                                                                                            t_0 := 1 \cdot {x.re}^{y.re}\\
                                                                                                                            \mathbf{if}\;x.re \leq -3.6 \cdot 10^{-15}:\\
                                                                                                                            \;\;\;\;t\_0\\
                                                                                                                            
                                                                                                                            \mathbf{elif}\;x.re \leq 1.6 \cdot 10^{-110}:\\
                                                                                                                            \;\;\;\;1 \cdot {x.im}^{y.re}\\
                                                                                                                            
                                                                                                                            \mathbf{else}:\\
                                                                                                                            \;\;\;\;t\_0\\
                                                                                                                            
                                                                                                                            
                                                                                                                            \end{array}
                                                                                                                            \end{array}
                                                                                                                            
                                                                                                                            Derivation
                                                                                                                            1. Split input into 2 regimes
                                                                                                                            2. if x.re < -3.6000000000000001e-15 or 1.60000000000000014e-110 < x.re

                                                                                                                              1. Initial program 36.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. lower-*.f64N/A

                                                                                                                                  \[\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}} \]
                                                                                                                                2. lower-cos.f64N/A

                                                                                                                                  \[\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} \]
                                                                                                                                3. lower-*.f64N/A

                                                                                                                                  \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

                                                                                                                                  \[\leadsto 1 \cdot {x.re}^{\color{blue}{y.re}} \]
                                                                                                                                3. Step-by-step derivation
                                                                                                                                  1. Applied rewrites53.7%

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

                                                                                                                                  if -3.6000000000000001e-15 < x.re < 1.60000000000000014e-110

                                                                                                                                  1. Initial program 44.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. lower-*.f64N/A

                                                                                                                                      \[\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}} \]
                                                                                                                                    2. lower-cos.f64N/A

                                                                                                                                      \[\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} \]
                                                                                                                                    3. lower-*.f64N/A

                                                                                                                                      \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

                                                                                                                                      \[\leadsto 1 \cdot {x.im}^{\color{blue}{y.re}} \]
                                                                                                                                    3. Step-by-step derivation
                                                                                                                                      1. Applied rewrites50.4%

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

                                                                                                                                    Alternative 13: 52.5% accurate, 5.7× speedup?

                                                                                                                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 \cdot {x.im}^{y.re}\\ \mathbf{if}\;y.re \leq -1.95 \cdot 10^{+23}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 2.95 \cdot 10^{-8}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                                                                                                                    (FPCore (x.re x.im y.re y.im)
                                                                                                                                     :precision binary64
                                                                                                                                     (let* ((t_0 (* 1.0 (pow x.im y.re))))
                                                                                                                                       (if (<= y.re -1.95e+23) t_0 (if (<= y.re 2.95e-8) 1.0 t_0))))
                                                                                                                                    double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                                                                    	double t_0 = 1.0 * pow(x_46_im, y_46_re);
                                                                                                                                    	double tmp;
                                                                                                                                    	if (y_46_re <= -1.95e+23) {
                                                                                                                                    		tmp = t_0;
                                                                                                                                    	} else if (y_46_re <= 2.95e-8) {
                                                                                                                                    		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 = 1.0d0 * (x_46im ** y_46re)
                                                                                                                                        if (y_46re <= (-1.95d+23)) then
                                                                                                                                            tmp = t_0
                                                                                                                                        else if (y_46re <= 2.95d-8) 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 = 1.0 * Math.pow(x_46_im, y_46_re);
                                                                                                                                    	double tmp;
                                                                                                                                    	if (y_46_re <= -1.95e+23) {
                                                                                                                                    		tmp = t_0;
                                                                                                                                    	} else if (y_46_re <= 2.95e-8) {
                                                                                                                                    		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 = 1.0 * math.pow(x_46_im, y_46_re)
                                                                                                                                    	tmp = 0
                                                                                                                                    	if y_46_re <= -1.95e+23:
                                                                                                                                    		tmp = t_0
                                                                                                                                    	elif y_46_re <= 2.95e-8:
                                                                                                                                    		tmp = 1.0
                                                                                                                                    	else:
                                                                                                                                    		tmp = t_0
                                                                                                                                    	return tmp
                                                                                                                                    
                                                                                                                                    function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                                                                    	t_0 = Float64(1.0 * (x_46_im ^ y_46_re))
                                                                                                                                    	tmp = 0.0
                                                                                                                                    	if (y_46_re <= -1.95e+23)
                                                                                                                                    		tmp = t_0;
                                                                                                                                    	elseif (y_46_re <= 2.95e-8)
                                                                                                                                    		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 = 1.0 * (x_46_im ^ y_46_re);
                                                                                                                                    	tmp = 0.0;
                                                                                                                                    	if (y_46_re <= -1.95e+23)
                                                                                                                                    		tmp = t_0;
                                                                                                                                    	elseif (y_46_re <= 2.95e-8)
                                                                                                                                    		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[(1.0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.95e+23], t$95$0, If[LessEqual[y$46$re, 2.95e-8], 1.0, t$95$0]]]
                                                                                                                                    
                                                                                                                                    \begin{array}{l}
                                                                                                                                    
                                                                                                                                    \\
                                                                                                                                    \begin{array}{l}
                                                                                                                                    t_0 := 1 \cdot {x.im}^{y.re}\\
                                                                                                                                    \mathbf{if}\;y.re \leq -1.95 \cdot 10^{+23}:\\
                                                                                                                                    \;\;\;\;t\_0\\
                                                                                                                                    
                                                                                                                                    \mathbf{elif}\;y.re \leq 2.95 \cdot 10^{-8}:\\
                                                                                                                                    \;\;\;\;1\\
                                                                                                                                    
                                                                                                                                    \mathbf{else}:\\
                                                                                                                                    \;\;\;\;t\_0\\
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    \end{array}
                                                                                                                                    \end{array}
                                                                                                                                    
                                                                                                                                    Derivation
                                                                                                                                    1. Split input into 2 regimes
                                                                                                                                    2. if y.re < -1.95e23 or 2.9499999999999999e-8 < y.re

                                                                                                                                      1. Initial program 37.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. lower-*.f64N/A

                                                                                                                                          \[\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}} \]
                                                                                                                                        2. lower-cos.f64N/A

                                                                                                                                          \[\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} \]
                                                                                                                                        3. lower-*.f64N/A

                                                                                                                                          \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                                          if -1.95e23 < y.re < 2.9499999999999999e-8

                                                                                                                                          1. Initial program 41.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. lower-*.f64N/A

                                                                                                                                              \[\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}} \]
                                                                                                                                            2. lower-cos.f64N/A

                                                                                                                                              \[\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} \]
                                                                                                                                            3. lower-*.f64N/A

                                                                                                                                              \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

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

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

                                                                                                                                          Alternative 14: 26.2% 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 39.2%

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

                                                                                                                                              \[\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}} \]
                                                                                                                                            2. lower-cos.f64N/A

                                                                                                                                              \[\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} \]
                                                                                                                                            3. lower-*.f64N/A

                                                                                                                                              \[\leadsto \cos \color{blue}{\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. lower-atan2.f64N/A

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

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

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

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

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

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

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

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

                                                                                                                                            \[\leadsto 1 \]
                                                                                                                                          7. Step-by-step derivation
                                                                                                                                            1. Applied rewrites22.8%

                                                                                                                                              \[\leadsto 1 \]
                                                                                                                                            2. Add Preprocessing

                                                                                                                                            Reproduce

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