powComplex, real part

Percentage Accurate: 40.7% → 68.8%
Time: 17.1s
Alternatives: 15
Speedup: 6.2×

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 15 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: 68.8% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x.im \leq 1.35 \cdot 10^{-256}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}, 1\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\

\mathbf{else}:\\
\;\;\;\;\cos \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 - t\_1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x.im < -6.80000000000000036e-289

    1. Initial program 43.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 x.im around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.80000000000000036e-289 < x.im < 1.3500000000000001e-256

    1. Initial program 40.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-*.f6463.8

        \[\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 rewrites63.8%

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

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

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

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

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

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

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

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

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

    if 1.3500000000000001e-256 < x.im

    1. Initial program 43.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 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.f6479.8

        \[\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 rewrites79.8%

      \[\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}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.im \leq -6.8 \cdot 10^{-289}:\\ \;\;\;\;\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, \left(-y.im\right) \cdot \log \left(\frac{-1}{x.im}\right)\right)\right) \cdot e^{-\mathsf{fma}\left(y.re, \log \left(\frac{-1}{x.im}\right), y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{elif}\;x.im \leq 1.35 \cdot 10^{-256}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}, 1\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;\cos \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}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 72.5% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(y.im, \log x.re, t\_0\right)\right) \cdot e^{y.re \cdot \log x.re - t\_1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x.re < -1.9999999999999998e-308

    1. Initial program 42.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999998e-308 < x.re

    1. Initial program 44.2%

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

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

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

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

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

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

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

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

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

Alternative 3: 73.9% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{if}\;y.re \leq -5.4 \cdot 10^{+31}:\\ \;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot t\_0\\ \mathbf{elif}\;y.re \leq 6.2 \cdot 10^{-7}:\\ \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \sqrt{x.re \cdot \left(x.re \cdot \left(x.re \cdot x.re\right)\right)}\right)}\right)}^{y.re}\\ \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)))))
   (if (<= y.re -5.4e+31)
     (* (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re) t_0)
     (if (<= y.re 6.2e-7)
       (exp (- (* y.im (atan2 x.im x.re))))
       (*
        t_0
        (pow
         (sqrt (fma x.im x.im (sqrt (* x.re (* x.re (* x.re 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 = cos((y_46_re * atan2(x_46_im, x_46_re)));
	double tmp;
	if (y_46_re <= -5.4e+31) {
		tmp = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re) * t_0;
	} else if (y_46_re <= 6.2e-7) {
		tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re)));
	} else {
		tmp = t_0 * pow(sqrt(fma(x_46_im, x_46_im, sqrt((x_46_re * (x_46_re * (x_46_re * x_46_re)))))), y_46_re);
	}
	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)))
	tmp = 0.0
	if (y_46_re <= -5.4e+31)
		tmp = Float64((sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re) * t_0);
	elseif (y_46_re <= 6.2e-7)
		tmp = exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re))));
	else
		tmp = Float64(t_0 * (sqrt(fma(x_46_im, x_46_im, sqrt(Float64(x_46_re * Float64(x_46_re * Float64(x_46_re * x_46_re)))))) ^ y_46_re));
	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]}, If[LessEqual[y$46$re, -5.4e+31], N[(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] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 6.2e-7], N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision], N[(t$95$0 * N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[Sqrt[N[(x$46$re * N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;y.re \leq 6.2 \cdot 10^{-7}:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \sqrt{x.re \cdot \left(x.re \cdot \left(x.re \cdot x.re\right)\right)}\right)}\right)}^{y.re}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y.re < -5.39999999999999971e31

    1. Initial program 41.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-*.f6478.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 rewrites78.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}} \]

    if -5.39999999999999971e31 < y.re < 6.1999999999999999e-7

    1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 6.1999999999999999e-7 < y.re

      1. Initial program 49.9%

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

        \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
      4. Step-by-step derivation
        1. 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-*.f6466.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 rewrites66.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. Step-by-step derivation
        1. lift-*.f6466.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} \]
        2. rem-square-sqrtN/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}{\sqrt{x.re \cdot x.re} \cdot \sqrt{x.re \cdot x.re}}\right)}\right)}^{y.re} \]
        3. sqrt-unprodN/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}{\sqrt{\left(x.re \cdot x.re\right) \cdot \left(x.re \cdot x.re\right)}}\right)}\right)}^{y.re} \]
        4. lower-sqrt.f64N/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}{\sqrt{\left(x.re \cdot x.re\right) \cdot \left(x.re \cdot x.re\right)}}\right)}\right)}^{y.re} \]
        5. lift-*.f64N/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, \sqrt{\color{blue}{\left(x.re \cdot x.re\right)} \cdot \left(x.re \cdot x.re\right)}\right)}\right)}^{y.re} \]
        6. associate-*l*N/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, \sqrt{\color{blue}{x.re \cdot \left(x.re \cdot \left(x.re \cdot x.re\right)\right)}}\right)}\right)}^{y.re} \]
        7. lift-*.f64N/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, \sqrt{x.re \cdot \left(x.re \cdot \color{blue}{\left(x.re \cdot x.re\right)}\right)}\right)}\right)}^{y.re} \]
        8. cube-unmultN/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, \sqrt{x.re \cdot \color{blue}{{x.re}^{3}}}\right)}\right)}^{y.re} \]
        9. lower-*.f64N/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, \sqrt{\color{blue}{x.re \cdot {x.re}^{3}}}\right)}\right)}^{y.re} \]
        10. cube-unmultN/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, \sqrt{x.re \cdot \color{blue}{\left(x.re \cdot \left(x.re \cdot x.re\right)\right)}}\right)}\right)}^{y.re} \]
        11. lift-*.f64N/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, \sqrt{x.re \cdot \left(x.re \cdot \color{blue}{\left(x.re \cdot x.re\right)}\right)}\right)}\right)}^{y.re} \]
        12. lower-*.f6466.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, \sqrt{x.re \cdot \color{blue}{\left(x.re \cdot \left(x.re \cdot x.re\right)\right)}}\right)}\right)}^{y.re} \]
      7. Applied rewrites66.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}{\sqrt{x.re \cdot \left(x.re \cdot \left(x.re \cdot x.re\right)\right)}}\right)}\right)}^{y.re} \]
    8. Recombined 3 regimes into one program.
    9. Final simplification73.7%

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

    Alternative 4: 74.0% accurate, 2.0× speedup?

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

      1. Initial program 46.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-*.f6471.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 rewrites71.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}} \]

      if -5.39999999999999971e31 < y.re < 4.3000000000000001e-7

      1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 5: 71.9% accurate, 2.1× speedup?

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

        1. Initial program 41.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-*.f6478.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 rewrites78.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 x.im around 0

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

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

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

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

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

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

        if -5.39999999999999971e31 < y.re < 6.09999999999999983e-7

        1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 6.09999999999999983e-7 < y.re

          1. Initial program 49.9%

            \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
          2. Add Preprocessing
          3. Taylor expanded in y.re around 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 \color{blue}{\left(\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) + -1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} \]
          4. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(-1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
            2. mul-1-negN/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 \left(\color{blue}{\left(\mathsf{neg}\left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
            3. distribute-rgt-neg-inN/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 \left(\color{blue}{y.re \cdot \left(\mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
            4. lower-fma.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 \color{blue}{\mathsf{fma}\left(y.re, \mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
          5. Applied rewrites44.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 \color{blue}{\mathsf{fma}\left(y.re, \left(-\tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \sin \left(y.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\right), \cos \left(y.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\right)\right)} \]
          6. Taylor expanded in y.im around 0

            \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
          7. Step-by-step derivation
            1. lower-pow.f64N/A

              \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
            2. lower-sqrt.f64N/A

              \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
            3. unpow2N/A

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

              \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
            5. unpow2N/A

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

              \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
          8. Applied rewrites65.1%

            \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
          9. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto {\left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)}^{y.re} \]
            2. lift-fma.f64N/A

              \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}}\right)}^{y.re} \]
            3. lift-sqrt.f64N/A

              \[\leadsto {\color{blue}{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}}^{y.re} \]
            4. sqr-powN/A

              \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{y.re}{2}\right)} \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{y.re}{2}\right)}} \]
            5. pow2N/A

              \[\leadsto \color{blue}{{\left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{y.re}{2}\right)}\right)}^{2}} \]
            6. sqr-powN/A

              \[\leadsto {\color{blue}{\left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)} \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)}\right)}}^{2} \]
            7. pow2N/A

              \[\leadsto {\color{blue}{\left({\left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)}\right)}^{2}\right)}}^{2} \]
            8. pow-powN/A

              \[\leadsto \color{blue}{{\left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)}\right)}^{\left(2 \cdot 2\right)}} \]
            9. metadata-evalN/A

              \[\leadsto {\left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)}\right)}^{\color{blue}{4}} \]
            10. metadata-evalN/A

              \[\leadsto {\left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)}\right)}^{\color{blue}{\left(2 + 2\right)}} \]
            11. lower-pow.f64N/A

              \[\leadsto \color{blue}{{\left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)}\right)}^{\left(2 + 2\right)}} \]
          10. Applied rewrites65.1%

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

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

        Alternative 6: 71.3% accurate, 2.1× speedup?

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

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

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

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

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

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

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

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

          if -5.60000000000000034e31 < y.re < 6.09999999999999983e-7

          1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if 6.09999999999999983e-7 < y.re

            1. Initial program 49.9%

              \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
            2. Add Preprocessing
            3. Taylor expanded in y.re around 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 \color{blue}{\left(\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) + -1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} \]
            4. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(-1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
              2. mul-1-negN/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 \left(\color{blue}{\left(\mathsf{neg}\left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
              3. distribute-rgt-neg-inN/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 \left(\color{blue}{y.re \cdot \left(\mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
              4. lower-fma.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 \color{blue}{\mathsf{fma}\left(y.re, \mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
            5. Applied rewrites44.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 \color{blue}{\mathsf{fma}\left(y.re, \left(-\tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \sin \left(y.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\right), \cos \left(y.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\right)\right)} \]
            6. Taylor expanded in y.im around 0

              \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
            7. Step-by-step derivation
              1. lower-pow.f64N/A

                \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
              2. lower-sqrt.f64N/A

                \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
              3. unpow2N/A

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

                \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
              5. unpow2N/A

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

                \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
            8. Applied rewrites65.1%

              \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
            9. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto {\left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)}^{y.re} \]
              2. lift-fma.f64N/A

                \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}}\right)}^{y.re} \]
              3. lift-sqrt.f64N/A

                \[\leadsto {\color{blue}{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}}^{y.re} \]
              4. sqr-powN/A

                \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{y.re}{2}\right)} \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{y.re}{2}\right)}} \]
              5. pow2N/A

                \[\leadsto \color{blue}{{\left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{y.re}{2}\right)}\right)}^{2}} \]
              6. sqr-powN/A

                \[\leadsto {\color{blue}{\left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)} \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)}\right)}}^{2} \]
              7. pow2N/A

                \[\leadsto {\color{blue}{\left({\left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)}\right)}^{2}\right)}}^{2} \]
              8. pow-powN/A

                \[\leadsto \color{blue}{{\left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)}\right)}^{\left(2 \cdot 2\right)}} \]
              9. metadata-evalN/A

                \[\leadsto {\left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)}\right)}^{\color{blue}{4}} \]
              10. metadata-evalN/A

                \[\leadsto {\left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)}\right)}^{\color{blue}{\left(2 + 2\right)}} \]
              11. lower-pow.f64N/A

                \[\leadsto \color{blue}{{\left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)}\right)}^{\left(2 + 2\right)}} \]
            10. Applied rewrites65.1%

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

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

          Alternative 7: 77.4% accurate, 2.9× speedup?

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

            1. Initial program 44.8%

              \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
            2. Add Preprocessing
            3. Taylor expanded in y.re 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 \color{blue}{\left(\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) + -1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} \]
            4. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(-1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
              2. mul-1-negN/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 \left(\color{blue}{\left(\mathsf{neg}\left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
              3. distribute-rgt-neg-inN/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 \left(\color{blue}{y.re \cdot \left(\mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
              4. lower-fma.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 \color{blue}{\mathsf{fma}\left(y.re, \mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
            5. Applied rewrites44.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 \color{blue}{\mathsf{fma}\left(y.re, \left(-\tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \sin \left(y.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\right), \cos \left(y.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\right)\right)} \]
            6. Taylor expanded in y.im around 0

              \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
            7. Step-by-step derivation
              1. lower-pow.f64N/A

                \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
              2. lower-sqrt.f64N/A

                \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
              3. unpow2N/A

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

                \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
              5. unpow2N/A

                \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
              6. lower-*.f6463.2

                \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
            8. Applied rewrites63.2%

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

            if -3.49999999999999996e-4 < y.re < 6.09999999999999983e-7

            1. Initial program 39.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 6.09999999999999983e-7 < y.re

              1. Initial program 49.9%

                \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
              2. Add Preprocessing
              3. Taylor expanded in y.re around 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 \color{blue}{\left(\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) + -1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} \]
              4. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(-1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                2. mul-1-negN/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 \left(\color{blue}{\left(\mathsf{neg}\left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                3. distribute-rgt-neg-inN/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 \left(\color{blue}{y.re \cdot \left(\mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                4. lower-fma.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 \color{blue}{\mathsf{fma}\left(y.re, \mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
              5. Applied rewrites44.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 \color{blue}{\mathsf{fma}\left(y.re, \left(-\tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \sin \left(y.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\right), \cos \left(y.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\right)\right)} \]
              6. Taylor expanded in y.im around 0

                \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
              7. Step-by-step derivation
                1. lower-pow.f64N/A

                  \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                2. lower-sqrt.f64N/A

                  \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
                3. unpow2N/A

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

                  \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                5. unpow2N/A

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

                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
              8. Applied rewrites65.1%

                \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
              9. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto {\left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)}^{y.re} \]
                2. lift-fma.f64N/A

                  \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}}\right)}^{y.re} \]
                3. lift-sqrt.f64N/A

                  \[\leadsto {\color{blue}{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}}^{y.re} \]
                4. sqr-powN/A

                  \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{y.re}{2}\right)} \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{y.re}{2}\right)}} \]
                5. pow2N/A

                  \[\leadsto \color{blue}{{\left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{y.re}{2}\right)}\right)}^{2}} \]
                6. sqr-powN/A

                  \[\leadsto {\color{blue}{\left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)} \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)}\right)}}^{2} \]
                7. pow2N/A

                  \[\leadsto {\color{blue}{\left({\left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)}\right)}^{2}\right)}}^{2} \]
                8. pow-powN/A

                  \[\leadsto \color{blue}{{\left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)}\right)}^{\left(2 \cdot 2\right)}} \]
                9. metadata-evalN/A

                  \[\leadsto {\left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)}\right)}^{\color{blue}{4}} \]
                10. metadata-evalN/A

                  \[\leadsto {\left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)}\right)}^{\color{blue}{\left(2 + 2\right)}} \]
                11. lower-pow.f64N/A

                  \[\leadsto \color{blue}{{\left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)}\right)}^{\left(2 + 2\right)}} \]
              10. Applied rewrites65.1%

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

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

            Alternative 8: 77.4% accurate, 3.1× speedup?

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

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

                  \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(-1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                2. mul-1-negN/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 \left(\color{blue}{\left(\mathsf{neg}\left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                3. distribute-rgt-neg-inN/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 \left(\color{blue}{y.re \cdot \left(\mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                4. lower-fma.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 \color{blue}{\mathsf{fma}\left(y.re, \mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
              5. Applied rewrites44.4%

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

                \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
              7. Step-by-step derivation
                1. lower-pow.f64N/A

                  \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                2. lower-sqrt.f64N/A

                  \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
                3. unpow2N/A

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

                  \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                5. unpow2N/A

                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                6. lower-*.f6464.3

                  \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
              8. Applied rewrites64.3%

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

              if -3.49999999999999996e-4 < y.re < 6.09999999999999983e-7

              1. Initial program 39.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 9: 61.0% accurate, 5.0× speedup?

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

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

                    \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(-1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                  2. mul-1-negN/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 \left(\color{blue}{\left(\mathsf{neg}\left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                  3. distribute-rgt-neg-inN/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 \left(\color{blue}{y.re \cdot \left(\mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                  4. lower-fma.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 \color{blue}{\mathsf{fma}\left(y.re, \mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                5. Applied rewrites41.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 \color{blue}{\mathsf{fma}\left(y.re, \left(-\tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \sin \left(y.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\right), \cos \left(y.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\right)\right)} \]
                6. Taylor expanded in y.im around 0

                  \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                7. Step-by-step derivation
                  1. lower-pow.f64N/A

                    \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                  2. lower-sqrt.f64N/A

                    \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
                  3. unpow2N/A

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

                    \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                  5. unpow2N/A

                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                  6. lower-*.f6461.5

                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                8. Applied rewrites61.5%

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

                if -1.9000000000000002e-98 < y.re < 2.1000000000000001e-50

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{1}{\color{blue}{1 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \]
                9. Step-by-step derivation
                  1. +-commutativeN/A

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

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

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

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

                  \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.im, 1\right)}} \]
              3. Recombined 2 regimes into one program.
              4. Add Preprocessing

              Alternative 10: 57.6% accurate, 5.5× speedup?

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

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

                    \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(-1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                  2. mul-1-negN/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 \left(\color{blue}{\left(\mathsf{neg}\left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                  3. distribute-rgt-neg-inN/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 \left(\color{blue}{y.re \cdot \left(\mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                  4. lower-fma.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 \color{blue}{\mathsf{fma}\left(y.re, \mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                5. Applied rewrites42.3%

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

                  \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                7. Step-by-step derivation
                  1. lower-pow.f64N/A

                    \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                  2. lower-sqrt.f64N/A

                    \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
                  3. unpow2N/A

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

                    \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                  5. unpow2N/A

                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                  6. lower-*.f6455.2

                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                8. Applied rewrites55.2%

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

                  \[\leadsto {\color{blue}{\left(-1 \cdot x.re\right)}}^{y.re} \]
                10. Step-by-step derivation
                  1. neg-mul-1N/A

                    \[\leadsto {\color{blue}{\left(\mathsf{neg}\left(x.re\right)\right)}}^{y.re} \]
                  2. lower-neg.f6462.1

                    \[\leadsto {\color{blue}{\left(-x.re\right)}}^{y.re} \]
                11. Applied rewrites62.1%

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

                if -2.60000000000000007e-165 < x.re < 0.13

                1. Initial program 46.8%

                  \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                2. Add Preprocessing
                3. Taylor expanded in y.re 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 \color{blue}{\left(\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) + -1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(-1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                  2. mul-1-negN/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 \left(\color{blue}{\left(\mathsf{neg}\left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                  3. distribute-rgt-neg-inN/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 \left(\color{blue}{y.re \cdot \left(\mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                  4. lower-fma.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 \color{blue}{\mathsf{fma}\left(y.re, \mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                5. Applied rewrites45.6%

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

                  \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                7. Step-by-step derivation
                  1. lower-pow.f64N/A

                    \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                  2. lower-sqrt.f64N/A

                    \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
                  3. unpow2N/A

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

                    \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                  5. unpow2N/A

                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                  6. lower-*.f6445.2

                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                8. Applied rewrites45.2%

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

                  \[\leadsto \color{blue}{e^{-1 \cdot \left(y.re \cdot \log \left(\frac{1}{x.im}\right)\right)}} \]
                10. Step-by-step derivation
                  1. mul-1-negN/A

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

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

                    \[\leadsto e^{\color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{x.im}\right)\right)\right) \cdot y.re}} \]
                  4. log-recN/A

                    \[\leadsto e^{\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log x.im\right)\right)}\right)\right) \cdot y.re} \]
                  5. remove-double-negN/A

                    \[\leadsto e^{\color{blue}{\log x.im} \cdot y.re} \]
                  6. exp-to-powN/A

                    \[\leadsto \color{blue}{{x.im}^{y.re}} \]
                  7. lower-pow.f6431.4

                    \[\leadsto \color{blue}{{x.im}^{y.re}} \]
                11. Applied rewrites31.4%

                  \[\leadsto \color{blue}{{x.im}^{y.re}} \]
                12. Step-by-step derivation
                  1. sqr-powN/A

                    \[\leadsto \color{blue}{{x.im}^{\left(\frac{y.re}{2}\right)} \cdot {x.im}^{\left(\frac{y.re}{2}\right)}} \]
                  2. pow-prod-downN/A

                    \[\leadsto \color{blue}{{\left(x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}} \]
                  3. lift-*.f64N/A

                    \[\leadsto {\color{blue}{\left(x.im \cdot x.im\right)}}^{\left(\frac{y.re}{2}\right)} \]
                  4. lower-pow.f64N/A

                    \[\leadsto \color{blue}{{\left(x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}} \]
                  5. div-invN/A

                    \[\leadsto {\left(x.im \cdot x.im\right)}^{\color{blue}{\left(y.re \cdot \frac{1}{2}\right)}} \]
                  6. metadata-evalN/A

                    \[\leadsto {\left(x.im \cdot x.im\right)}^{\left(y.re \cdot \color{blue}{\frac{1}{2}}\right)} \]
                  7. *-commutativeN/A

                    \[\leadsto {\left(x.im \cdot x.im\right)}^{\color{blue}{\left(\frac{1}{2} \cdot y.re\right)}} \]
                  8. lower-*.f6442.8

                    \[\leadsto {\left(x.im \cdot x.im\right)}^{\color{blue}{\left(0.5 \cdot y.re\right)}} \]
                13. Applied rewrites42.8%

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

                if 0.13 < x.re

                1. Initial program 36.2%

                  \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                2. Add Preprocessing
                3. Taylor expanded in y.re 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 \color{blue}{\left(\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) + -1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(-1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                  2. mul-1-negN/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 \left(\color{blue}{\left(\mathsf{neg}\left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                  3. distribute-rgt-neg-inN/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 \left(\color{blue}{y.re \cdot \left(\mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                  4. lower-fma.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 \color{blue}{\mathsf{fma}\left(y.re, \mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                5. Applied rewrites34.3%

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

                  \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                7. Step-by-step derivation
                  1. lower-pow.f64N/A

                    \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                  2. lower-sqrt.f64N/A

                    \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
                  3. unpow2N/A

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

                    \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                  5. unpow2N/A

                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                  6. lower-*.f6452.6

                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                8. Applied rewrites52.6%

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

                  \[\leadsto \color{blue}{{x.re}^{y.re}} \]
                10. Step-by-step derivation
                  1. lower-pow.f6456.5

                    \[\leadsto \color{blue}{{x.re}^{y.re}} \]
                11. Applied rewrites56.5%

                  \[\leadsto \color{blue}{{x.re}^{y.re}} \]
              3. Recombined 3 regimes into one program.
              4. Final simplification53.7%

                \[\leadsto \begin{array}{l} \mathbf{if}\;x.re \leq -2.6 \cdot 10^{-165}:\\ \;\;\;\;{\left(-x.re\right)}^{y.re}\\ \mathbf{elif}\;x.re \leq 0.13:\\ \;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(y.re \cdot 0.5\right)}\\ \mathbf{else}:\\ \;\;\;\;{x.re}^{y.re}\\ \end{array} \]
              5. Add Preprocessing

              Alternative 11: 52.3% accurate, 5.7× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -1.9 \cdot 10^{-6}:\\ \;\;\;\;{x.im}^{y.re}\\ \mathbf{elif}\;y.re \leq 32000000000:\\ \;\;\;\;1\\ \mathbf{elif}\;y.re \leq 3 \cdot 10^{+233}:\\ \;\;\;\;{x.re}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;{x.im}^{y.re}\\ \end{array} \end{array} \]
              (FPCore (x.re x.im y.re y.im)
               :precision binary64
               (if (<= y.re -1.9e-6)
                 (pow x.im y.re)
                 (if (<= y.re 32000000000.0)
                   1.0
                   (if (<= y.re 3e+233) (pow x.re y.re) (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 (y_46_re <= -1.9e-6) {
              		tmp = pow(x_46_im, y_46_re);
              	} else if (y_46_re <= 32000000000.0) {
              		tmp = 1.0;
              	} else if (y_46_re <= 3e+233) {
              		tmp = pow(x_46_re, y_46_re);
              	} else {
              		tmp = 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 (y_46re <= (-1.9d-6)) then
                      tmp = x_46im ** y_46re
                  else if (y_46re <= 32000000000.0d0) then
                      tmp = 1.0d0
                  else if (y_46re <= 3d+233) then
                      tmp = x_46re ** y_46re
                  else
                      tmp = 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 (y_46_re <= -1.9e-6) {
              		tmp = Math.pow(x_46_im, y_46_re);
              	} else if (y_46_re <= 32000000000.0) {
              		tmp = 1.0;
              	} else if (y_46_re <= 3e+233) {
              		tmp = Math.pow(x_46_re, y_46_re);
              	} else {
              		tmp = 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 y_46_re <= -1.9e-6:
              		tmp = math.pow(x_46_im, y_46_re)
              	elif y_46_re <= 32000000000.0:
              		tmp = 1.0
              	elif y_46_re <= 3e+233:
              		tmp = math.pow(x_46_re, y_46_re)
              	else:
              		tmp = 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 (y_46_re <= -1.9e-6)
              		tmp = x_46_im ^ y_46_re;
              	elseif (y_46_re <= 32000000000.0)
              		tmp = 1.0;
              	elseif (y_46_re <= 3e+233)
              		tmp = x_46_re ^ y_46_re;
              	else
              		tmp = 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 (y_46_re <= -1.9e-6)
              		tmp = x_46_im ^ y_46_re;
              	elseif (y_46_re <= 32000000000.0)
              		tmp = 1.0;
              	elseif (y_46_re <= 3e+233)
              		tmp = x_46_re ^ y_46_re;
              	else
              		tmp = 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[y$46$re, -1.9e-6], N[Power[x$46$im, y$46$re], $MachinePrecision], If[LessEqual[y$46$re, 32000000000.0], 1.0, If[LessEqual[y$46$re, 3e+233], N[Power[x$46$re, y$46$re], $MachinePrecision], N[Power[x$46$im, y$46$re], $MachinePrecision]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;y.re \leq -1.9 \cdot 10^{-6}:\\
              \;\;\;\;{x.im}^{y.re}\\
              
              \mathbf{elif}\;y.re \leq 32000000000:\\
              \;\;\;\;1\\
              
              \mathbf{elif}\;y.re \leq 3 \cdot 10^{+233}:\\
              \;\;\;\;{x.re}^{y.re}\\
              
              \mathbf{else}:\\
              \;\;\;\;{x.im}^{y.re}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if y.re < -1.9e-6 or 3.00000000000000014e233 < y.re

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

                    \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(-1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                  2. mul-1-negN/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 \left(\color{blue}{\left(\mathsf{neg}\left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                  3. distribute-rgt-neg-inN/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 \left(\color{blue}{y.re \cdot \left(\mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                  4. lower-fma.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 \color{blue}{\mathsf{fma}\left(y.re, \mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                5. Applied rewrites40.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 \color{blue}{\mathsf{fma}\left(y.re, \left(-\tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \sin \left(y.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\right), \cos \left(y.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\right)\right)} \]
                6. Taylor expanded in y.im around 0

                  \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                7. Step-by-step derivation
                  1. lower-pow.f64N/A

                    \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                  2. lower-sqrt.f64N/A

                    \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
                  3. unpow2N/A

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

                    \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                  5. unpow2N/A

                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                  6. lower-*.f6464.6

                    \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                8. Applied rewrites64.6%

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

                  \[\leadsto \color{blue}{e^{-1 \cdot \left(y.re \cdot \log \left(\frac{1}{x.im}\right)\right)}} \]
                10. Step-by-step derivation
                  1. mul-1-negN/A

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

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

                    \[\leadsto e^{\color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{x.im}\right)\right)\right) \cdot y.re}} \]
                  4. log-recN/A

                    \[\leadsto e^{\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log x.im\right)\right)}\right)\right) \cdot y.re} \]
                  5. remove-double-negN/A

                    \[\leadsto e^{\color{blue}{\log x.im} \cdot y.re} \]
                  6. exp-to-powN/A

                    \[\leadsto \color{blue}{{x.im}^{y.re}} \]
                  7. lower-pow.f6456.0

                    \[\leadsto \color{blue}{{x.im}^{y.re}} \]
                11. Applied rewrites56.0%

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

                if -1.9e-6 < y.re < 3.2e10

                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-*.f6438.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 rewrites38.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 \color{blue}{1} \]
                7. Step-by-step derivation
                  1. Applied rewrites42.7%

                    \[\leadsto \color{blue}{1} \]

                  if 3.2e10 < y.re < 3.00000000000000014e233

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

                      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(-1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                    2. mul-1-negN/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 \left(\color{blue}{\left(\mathsf{neg}\left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                    3. distribute-rgt-neg-inN/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 \left(\color{blue}{y.re \cdot \left(\mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                    4. lower-fma.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 \color{blue}{\mathsf{fma}\left(y.re, \mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                  5. Applied rewrites52.2%

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

                    \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                  7. Step-by-step derivation
                    1. lower-pow.f64N/A

                      \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                    2. lower-sqrt.f64N/A

                      \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
                    3. unpow2N/A

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

                      \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                    5. unpow2N/A

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

                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                  8. Applied rewrites65.5%

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

                    \[\leadsto \color{blue}{{x.re}^{y.re}} \]
                  10. Step-by-step derivation
                    1. lower-pow.f6465.5

                      \[\leadsto \color{blue}{{x.re}^{y.re}} \]
                  11. Applied rewrites65.5%

                    \[\leadsto \color{blue}{{x.re}^{y.re}} \]
                8. Recombined 3 regimes into one program.
                9. Add Preprocessing

                Alternative 12: 53.5% accurate, 6.0× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x.im \leq -4.6 \cdot 10^{-281}:\\ \;\;\;\;{\left(-x.im\right)}^{y.re}\\ \mathbf{elif}\;x.im \leq 1.35 \cdot 10^{-244}:\\ \;\;\;\;{x.re}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;{x.im}^{y.re}\\ \end{array} \end{array} \]
                (FPCore (x.re x.im y.re y.im)
                 :precision binary64
                 (if (<= x.im -4.6e-281)
                   (pow (- x.im) y.re)
                   (if (<= x.im 1.35e-244) (pow x.re y.re) (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 <= -4.6e-281) {
                		tmp = pow(-x_46_im, y_46_re);
                	} else if (x_46_im <= 1.35e-244) {
                		tmp = pow(x_46_re, y_46_re);
                	} else {
                		tmp = 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 <= (-4.6d-281)) then
                        tmp = -x_46im ** y_46re
                    else if (x_46im <= 1.35d-244) then
                        tmp = x_46re ** y_46re
                    else
                        tmp = 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 <= -4.6e-281) {
                		tmp = Math.pow(-x_46_im, y_46_re);
                	} else if (x_46_im <= 1.35e-244) {
                		tmp = Math.pow(x_46_re, y_46_re);
                	} else {
                		tmp = 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 <= -4.6e-281:
                		tmp = math.pow(-x_46_im, y_46_re)
                	elif x_46_im <= 1.35e-244:
                		tmp = math.pow(x_46_re, y_46_re)
                	else:
                		tmp = 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 <= -4.6e-281)
                		tmp = Float64(-x_46_im) ^ y_46_re;
                	elseif (x_46_im <= 1.35e-244)
                		tmp = x_46_re ^ y_46_re;
                	else
                		tmp = 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 <= -4.6e-281)
                		tmp = -x_46_im ^ y_46_re;
                	elseif (x_46_im <= 1.35e-244)
                		tmp = x_46_re ^ y_46_re;
                	else
                		tmp = 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, -4.6e-281], N[Power[(-x$46$im), y$46$re], $MachinePrecision], If[LessEqual[x$46$im, 1.35e-244], N[Power[x$46$re, y$46$re], $MachinePrecision], N[Power[x$46$im, y$46$re], $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;x.im \leq -4.6 \cdot 10^{-281}:\\
                \;\;\;\;{\left(-x.im\right)}^{y.re}\\
                
                \mathbf{elif}\;x.im \leq 1.35 \cdot 10^{-244}:\\
                \;\;\;\;{x.re}^{y.re}\\
                
                \mathbf{else}:\\
                \;\;\;\;{x.im}^{y.re}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if x.im < -4.59999999999999978e-281

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

                      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(-1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                    2. mul-1-negN/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 \left(\color{blue}{\left(\mathsf{neg}\left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                    3. distribute-rgt-neg-inN/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 \left(\color{blue}{y.re \cdot \left(\mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                    4. lower-fma.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 \color{blue}{\mathsf{fma}\left(y.re, \mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                  5. Applied rewrites42.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 \color{blue}{\mathsf{fma}\left(y.re, \left(-\tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \sin \left(y.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\right), \cos \left(y.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\right)\right)} \]
                  6. Taylor expanded in y.im around 0

                    \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                  7. Step-by-step derivation
                    1. lower-pow.f64N/A

                      \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                    2. lower-sqrt.f64N/A

                      \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
                    3. unpow2N/A

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

                      \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                    5. unpow2N/A

                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                    6. lower-*.f6457.7

                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                  8. Applied rewrites57.7%

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

                    \[\leadsto {\color{blue}{\left(-1 \cdot x.im\right)}}^{y.re} \]
                  10. Step-by-step derivation
                    1. mul-1-negN/A

                      \[\leadsto {\color{blue}{\left(\mathsf{neg}\left(x.im\right)\right)}}^{y.re} \]
                    2. lower-neg.f6453.0

                      \[\leadsto {\color{blue}{\left(-x.im\right)}}^{y.re} \]
                  11. Applied rewrites53.0%

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

                  if -4.59999999999999978e-281 < x.im < 1.35e-244

                  1. Initial program 44.8%

                    \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                  2. Add Preprocessing
                  3. Taylor expanded in y.re 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 \color{blue}{\left(\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) + -1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} \]
                  4. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(-1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                    2. mul-1-negN/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 \left(\color{blue}{\left(\mathsf{neg}\left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                    3. distribute-rgt-neg-inN/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 \left(\color{blue}{y.re \cdot \left(\mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                    4. lower-fma.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 \color{blue}{\mathsf{fma}\left(y.re, \mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                  5. Applied rewrites44.8%

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

                    \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                  7. Step-by-step derivation
                    1. lower-pow.f64N/A

                      \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                    2. lower-sqrt.f64N/A

                      \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
                    3. unpow2N/A

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

                      \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                    5. unpow2N/A

                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                    6. lower-*.f6463.0

                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                  8. Applied rewrites63.0%

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

                    \[\leadsto \color{blue}{{x.re}^{y.re}} \]
                  10. Step-by-step derivation
                    1. lower-pow.f6455.2

                      \[\leadsto \color{blue}{{x.re}^{y.re}} \]
                  11. Applied rewrites55.2%

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

                  if 1.35e-244 < x.im

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

                      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(-1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                    2. mul-1-negN/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 \left(\color{blue}{\left(\mathsf{neg}\left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                    3. distribute-rgt-neg-inN/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 \left(\color{blue}{y.re \cdot \left(\mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                    4. lower-fma.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 \color{blue}{\mathsf{fma}\left(y.re, \mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                  5. Applied rewrites40.9%

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

                    \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                  7. Step-by-step derivation
                    1. lower-pow.f64N/A

                      \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                    2. lower-sqrt.f64N/A

                      \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
                    3. unpow2N/A

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

                      \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                    5. unpow2N/A

                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                    6. lower-*.f6440.7

                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                  8. Applied rewrites40.7%

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

                    \[\leadsto \color{blue}{e^{-1 \cdot \left(y.re \cdot \log \left(\frac{1}{x.im}\right)\right)}} \]
                  10. Step-by-step derivation
                    1. mul-1-negN/A

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

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

                      \[\leadsto e^{\color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{x.im}\right)\right)\right) \cdot y.re}} \]
                    4. log-recN/A

                      \[\leadsto e^{\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log x.im\right)\right)}\right)\right) \cdot y.re} \]
                    5. remove-double-negN/A

                      \[\leadsto e^{\color{blue}{\log x.im} \cdot y.re} \]
                    6. exp-to-powN/A

                      \[\leadsto \color{blue}{{x.im}^{y.re}} \]
                    7. lower-pow.f6448.2

                      \[\leadsto \color{blue}{{x.im}^{y.re}} \]
                  11. Applied rewrites48.2%

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

                Alternative 13: 52.1% accurate, 6.0× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -1.9 \cdot 10^{-6}:\\ \;\;\;\;{x.im}^{y.re}\\ \mathbf{elif}\;y.re \leq 9.5 \cdot 10^{+15}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;{x.im}^{y.re}\\ \end{array} \end{array} \]
                (FPCore (x.re x.im y.re y.im)
                 :precision binary64
                 (if (<= y.re -1.9e-6)
                   (pow x.im y.re)
                   (if (<= y.re 9.5e+15) 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 (y_46_re <= -1.9e-6) {
                		tmp = pow(x_46_im, y_46_re);
                	} else if (y_46_re <= 9.5e+15) {
                		tmp = 1.0;
                	} else {
                		tmp = 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 (y_46re <= (-1.9d-6)) then
                        tmp = x_46im ** y_46re
                    else if (y_46re <= 9.5d+15) then
                        tmp = 1.0d0
                    else
                        tmp = 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 (y_46_re <= -1.9e-6) {
                		tmp = Math.pow(x_46_im, y_46_re);
                	} else if (y_46_re <= 9.5e+15) {
                		tmp = 1.0;
                	} else {
                		tmp = 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 y_46_re <= -1.9e-6:
                		tmp = math.pow(x_46_im, y_46_re)
                	elif y_46_re <= 9.5e+15:
                		tmp = 1.0
                	else:
                		tmp = 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 (y_46_re <= -1.9e-6)
                		tmp = x_46_im ^ y_46_re;
                	elseif (y_46_re <= 9.5e+15)
                		tmp = 1.0;
                	else
                		tmp = 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 (y_46_re <= -1.9e-6)
                		tmp = x_46_im ^ y_46_re;
                	elseif (y_46_re <= 9.5e+15)
                		tmp = 1.0;
                	else
                		tmp = 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[y$46$re, -1.9e-6], N[Power[x$46$im, y$46$re], $MachinePrecision], If[LessEqual[y$46$re, 9.5e+15], 1.0, N[Power[x$46$im, y$46$re], $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;y.re \leq -1.9 \cdot 10^{-6}:\\
                \;\;\;\;{x.im}^{y.re}\\
                
                \mathbf{elif}\;y.re \leq 9.5 \cdot 10^{+15}:\\
                \;\;\;\;1\\
                
                \mathbf{else}:\\
                \;\;\;\;{x.im}^{y.re}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if y.re < -1.9e-6 or 9.5e15 < y.re

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

                      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(-1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                    2. mul-1-negN/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 \left(\color{blue}{\left(\mathsf{neg}\left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                    3. distribute-rgt-neg-inN/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 \left(\color{blue}{y.re \cdot \left(\mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                    4. lower-fma.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 \color{blue}{\mathsf{fma}\left(y.re, \mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                  5. Applied rewrites45.2%

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

                    \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                  7. Step-by-step derivation
                    1. lower-pow.f64N/A

                      \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                    2. lower-sqrt.f64N/A

                      \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
                    3. unpow2N/A

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

                      \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                    5. unpow2N/A

                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                    6. lower-*.f6464.6

                      \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                  8. Applied rewrites64.6%

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

                    \[\leadsto \color{blue}{e^{-1 \cdot \left(y.re \cdot \log \left(\frac{1}{x.im}\right)\right)}} \]
                  10. Step-by-step derivation
                    1. mul-1-negN/A

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

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

                      \[\leadsto e^{\color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{x.im}\right)\right)\right) \cdot y.re}} \]
                    4. log-recN/A

                      \[\leadsto e^{\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log x.im\right)\right)}\right)\right) \cdot y.re} \]
                    5. remove-double-negN/A

                      \[\leadsto e^{\color{blue}{\log x.im} \cdot y.re} \]
                    6. exp-to-powN/A

                      \[\leadsto \color{blue}{{x.im}^{y.re}} \]
                    7. lower-pow.f6454.4

                      \[\leadsto \color{blue}{{x.im}^{y.re}} \]
                  11. Applied rewrites54.4%

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

                  if -1.9e-6 < y.re < 9.5e15

                  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-*.f6438.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 rewrites38.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 \color{blue}{1} \]
                  7. Step-by-step derivation
                    1. Applied rewrites42.4%

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

                  Alternative 14: 54.3% accurate, 6.2× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x.re \leq -5 \cdot 10^{-303}:\\ \;\;\;\;{\left(-x.re\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;{x.re}^{y.re}\\ \end{array} \end{array} \]
                  (FPCore (x.re x.im y.re y.im)
                   :precision binary64
                   (if (<= x.re -5e-303) (pow (- x.re) y.re) (pow x.re 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_re <= -5e-303) {
                  		tmp = pow(-x_46_re, y_46_re);
                  	} else {
                  		tmp = pow(x_46_re, 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_46re <= (-5d-303)) then
                          tmp = -x_46re ** y_46re
                      else
                          tmp = x_46re ** 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_re <= -5e-303) {
                  		tmp = Math.pow(-x_46_re, y_46_re);
                  	} else {
                  		tmp = Math.pow(x_46_re, y_46_re);
                  	}
                  	return tmp;
                  }
                  
                  def code(x_46_re, x_46_im, y_46_re, y_46_im):
                  	tmp = 0
                  	if x_46_re <= -5e-303:
                  		tmp = math.pow(-x_46_re, y_46_re)
                  	else:
                  		tmp = math.pow(x_46_re, 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_re <= -5e-303)
                  		tmp = Float64(-x_46_re) ^ y_46_re;
                  	else
                  		tmp = x_46_re ^ 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_re <= -5e-303)
                  		tmp = -x_46_re ^ y_46_re;
                  	else
                  		tmp = x_46_re ^ 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$re, -5e-303], N[Power[(-x$46$re), y$46$re], $MachinePrecision], N[Power[x$46$re, y$46$re], $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;x.re \leq -5 \cdot 10^{-303}:\\
                  \;\;\;\;{\left(-x.re\right)}^{y.re}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;{x.re}^{y.re}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if x.re < -4.9999999999999998e-303

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

                        \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(-1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                      2. mul-1-negN/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 \left(\color{blue}{\left(\mathsf{neg}\left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                      3. distribute-rgt-neg-inN/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 \left(\color{blue}{y.re \cdot \left(\mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                      4. lower-fma.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 \color{blue}{\mathsf{fma}\left(y.re, \mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                    5. Applied rewrites43.5%

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

                      \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                    7. Step-by-step derivation
                      1. lower-pow.f64N/A

                        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                      2. lower-sqrt.f64N/A

                        \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
                      3. unpow2N/A

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

                        \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                      5. unpow2N/A

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

                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                    8. Applied rewrites52.4%

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

                      \[\leadsto {\color{blue}{\left(-1 \cdot x.re\right)}}^{y.re} \]
                    10. Step-by-step derivation
                      1. neg-mul-1N/A

                        \[\leadsto {\color{blue}{\left(\mathsf{neg}\left(x.re\right)\right)}}^{y.re} \]
                      2. lower-neg.f6454.0

                        \[\leadsto {\color{blue}{\left(-x.re\right)}}^{y.re} \]
                    11. Applied rewrites54.0%

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

                    if -4.9999999999999998e-303 < x.re

                    1. Initial program 43.9%

                      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in y.re 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 \color{blue}{\left(\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) + -1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(-1 \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                      2. mul-1-negN/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 \left(\color{blue}{\left(\mathsf{neg}\left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                      3. distribute-rgt-neg-inN/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 \left(\color{blue}{y.re \cdot \left(\mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
                      4. lower-fma.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 \color{blue}{\mathsf{fma}\left(y.re, \mathsf{neg}\left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                    5. Applied rewrites39.9%

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

                      \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                    7. Step-by-step derivation
                      1. lower-pow.f64N/A

                        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                      2. lower-sqrt.f64N/A

                        \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
                      3. unpow2N/A

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

                        \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                      5. unpow2N/A

                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                      6. lower-*.f6449.2

                        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                    8. Applied rewrites49.2%

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

                      \[\leadsto \color{blue}{{x.re}^{y.re}} \]
                    10. Step-by-step derivation
                      1. lower-pow.f6445.8

                        \[\leadsto \color{blue}{{x.re}^{y.re}} \]
                    11. Applied rewrites45.8%

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

                  Alternative 15: 25.8% accurate, 680.0× speedup?

                  \[\begin{array}{l} \\ 1 \end{array} \]
                  (FPCore (x.re x.im y.re y.im) :precision binary64 1.0)
                  double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                  	return 1.0;
                  }
                  
                  real(8) function code(x_46re, x_46im, y_46re, y_46im)
                      real(8), intent (in) :: x_46re
                      real(8), intent (in) :: x_46im
                      real(8), intent (in) :: y_46re
                      real(8), intent (in) :: y_46im
                      code = 1.0d0
                  end function
                  
                  public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                  	return 1.0;
                  }
                  
                  def code(x_46_re, x_46_im, y_46_re, y_46_im):
                  	return 1.0
                  
                  function code(x_46_re, x_46_im, y_46_re, y_46_im)
                  	return 1.0
                  end
                  
                  function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
                  	tmp = 1.0;
                  end
                  
                  code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 1.0
                  
                  \begin{array}{l}
                  
                  \\
                  1
                  \end{array}
                  
                  Derivation
                  1. Initial program 43.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-*.f6454.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 rewrites54.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 \color{blue}{1} \]
                  7. Step-by-step derivation
                    1. Applied rewrites23.0%

                      \[\leadsto \color{blue}{1} \]
                    2. Add Preprocessing

                    Reproduce

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