powComplex, real part

Percentage Accurate: 41.0% → 76.5%
Time: 18.2s
Alternatives: 9
Speedup: 6.3×

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 9 alternatives:

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

Initial Program: 41.0% 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: 76.5% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;y.re \leq 28:\\
\;\;\;\;e^{-t\_0}\\

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


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

    1. Initial program 47.5%

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

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

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

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

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

    if -3.09999999999999996e44 < y.re < 28

    1. Initial program 38.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 28 < y.re

    1. Initial program 39.0%

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

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

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

      \[\leadsto \color{blue}{1} \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. Applied rewrites70.3%

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

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

          \[\leadsto 1 \cdot {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}}\right)}^{y.re} \]
        3. pow1/2N/A

          \[\leadsto 1 \cdot {\color{blue}{\left({\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\frac{1}{2}}\right)}}^{y.re} \]
        4. pow1/2N/A

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

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

          \[\leadsto 1 \cdot \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
        7. *-lft-identity70.3

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

          \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
        9. 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} \]
        10. sqrt-pow2N/A

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

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

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

          \[\leadsto {\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(y.re \cdot \color{blue}{\frac{1}{2}}\right)} \]
        14. lower-*.f6470.3

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

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

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

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

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

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

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

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

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

          \[\leadsto {\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right) \cdot \mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(\frac{\color{blue}{y.re \cdot \frac{1}{2}}}{2}\right)} \]
        9. associate-/l*N/A

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

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

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

          \[\leadsto {\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right) \cdot \mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\color{blue}{\left(y.re \cdot \left(\frac{1}{2} \cdot \frac{1}{2}\right)\right)}} \]
        13. metadata-eval70.3

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

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

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

    Alternative 2: 75.8% accurate, 2.0× 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 -3.1 \cdot 10^{+44}:\\ \;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{t\_0}\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq 28:\\ \;\;\;\;e^{-\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;{\left(t\_0 \cdot t\_0\right)}^{\left(y.re \cdot 0.25\right)}\\ \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 -3.1e+44)
         (* (cos (* y.re (atan2 x.im x.re))) (pow (sqrt t_0) y.re))
         (if (<= y.re 28.0)
           (exp (- (* (atan2 x.im x.re) y.im)))
           (pow (* t_0 t_0) (* y.re 0.25))))))
    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 <= -3.1e+44) {
    		tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(sqrt(t_0), y_46_re);
    	} else if (y_46_re <= 28.0) {
    		tmp = exp(-(atan2(x_46_im, x_46_re) * y_46_im));
    	} else {
    		tmp = pow((t_0 * t_0), (y_46_re * 0.25));
    	}
    	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 <= -3.1e+44)
    		tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (sqrt(t_0) ^ y_46_re));
    	elseif (y_46_re <= 28.0)
    		tmp = exp(Float64(-Float64(atan(x_46_im, x_46_re) * y_46_im)));
    	else
    		tmp = Float64(t_0 * t_0) ^ Float64(y_46_re * 0.25);
    	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, -3.1e+44], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[t$95$0], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 28.0], N[Exp[(-N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision])], $MachinePrecision], N[Power[N[(t$95$0 * t$95$0), $MachinePrecision], N[(y$46$re * 0.25), $MachinePrecision]], $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 -3.1 \cdot 10^{+44}:\\
    \;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{t\_0}\right)}^{y.re}\\
    
    \mathbf{elif}\;y.re \leq 28:\\
    \;\;\;\;e^{-\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
    
    \mathbf{else}:\\
    \;\;\;\;{\left(t\_0 \cdot t\_0\right)}^{\left(y.re \cdot 0.25\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y.re < -3.09999999999999996e44

      1. Initial program 47.5%

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

        \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
      4. Step-by-step derivation
        1. 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-*.f6488.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 rewrites88.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 -3.09999999999999996e44 < y.re < 28

      1. Initial program 38.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 28 < y.re

      1. Initial program 39.0%

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

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

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

        \[\leadsto \color{blue}{1} \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. Applied rewrites70.3%

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

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

            \[\leadsto 1 \cdot {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}}\right)}^{y.re} \]
          3. pow1/2N/A

            \[\leadsto 1 \cdot {\color{blue}{\left({\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\frac{1}{2}}\right)}}^{y.re} \]
          4. pow1/2N/A

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

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

            \[\leadsto 1 \cdot \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
          7. *-lft-identity70.3

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

            \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
          9. 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} \]
          10. sqrt-pow2N/A

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

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

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

            \[\leadsto {\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(y.re \cdot \color{blue}{\frac{1}{2}}\right)} \]
          14. lower-*.f6470.3

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

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

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

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

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

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

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

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

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

            \[\leadsto {\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right) \cdot \mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(\frac{\color{blue}{y.re \cdot \frac{1}{2}}}{2}\right)} \]
          9. associate-/l*N/A

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

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

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

            \[\leadsto {\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right) \cdot \mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\color{blue}{\left(y.re \cdot \left(\frac{1}{2} \cdot \frac{1}{2}\right)\right)}} \]
          13. metadata-eval70.3

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

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

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

      Alternative 3: 76.0% accurate, 3.1× 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 -3.1 \cdot 10^{+44}:\\ \;\;\;\;{t\_0}^{\left(y.re \cdot 0.5\right)}\\ \mathbf{elif}\;y.re \leq 28:\\ \;\;\;\;e^{-\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;{\left(t\_0 \cdot t\_0\right)}^{\left(y.re \cdot 0.25\right)}\\ \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 -3.1e+44)
           (pow t_0 (* y.re 0.5))
           (if (<= y.re 28.0)
             (exp (- (* (atan2 x.im x.re) y.im)))
             (pow (* t_0 t_0) (* y.re 0.25))))))
      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 <= -3.1e+44) {
      		tmp = pow(t_0, (y_46_re * 0.5));
      	} else if (y_46_re <= 28.0) {
      		tmp = exp(-(atan2(x_46_im, x_46_re) * y_46_im));
      	} else {
      		tmp = pow((t_0 * t_0), (y_46_re * 0.25));
      	}
      	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 <= -3.1e+44)
      		tmp = t_0 ^ Float64(y_46_re * 0.5);
      	elseif (y_46_re <= 28.0)
      		tmp = exp(Float64(-Float64(atan(x_46_im, x_46_re) * y_46_im)));
      	else
      		tmp = Float64(t_0 * t_0) ^ Float64(y_46_re * 0.25);
      	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, -3.1e+44], N[Power[t$95$0, N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 28.0], N[Exp[(-N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision])], $MachinePrecision], N[Power[N[(t$95$0 * t$95$0), $MachinePrecision], N[(y$46$re * 0.25), $MachinePrecision]], $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 -3.1 \cdot 10^{+44}:\\
      \;\;\;\;{t\_0}^{\left(y.re \cdot 0.5\right)}\\
      
      \mathbf{elif}\;y.re \leq 28:\\
      \;\;\;\;e^{-\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
      
      \mathbf{else}:\\
      \;\;\;\;{\left(t\_0 \cdot t\_0\right)}^{\left(y.re \cdot 0.25\right)}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if y.re < -3.09999999999999996e44

        1. Initial program 47.5%

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

          \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
        4. Step-by-step derivation
          1. 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-*.f6488.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 rewrites88.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} \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. Applied rewrites83.7%

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

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

              \[\leadsto 1 \cdot {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}}\right)}^{y.re} \]
            3. pow1/2N/A

              \[\leadsto 1 \cdot {\color{blue}{\left({\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\frac{1}{2}}\right)}}^{y.re} \]
            4. pow1/2N/A

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

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

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

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

              \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
            9. 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} \]
            10. sqrt-pow2N/A

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

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

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

              \[\leadsto {\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(y.re \cdot \color{blue}{\frac{1}{2}}\right)} \]
            14. lower-*.f6483.7

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

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

          if -3.09999999999999996e44 < y.re < 28

          1. Initial program 38.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 28 < y.re

          1. Initial program 39.0%

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

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

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

            \[\leadsto \color{blue}{1} \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. Applied rewrites70.3%

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

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

                \[\leadsto 1 \cdot {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}}\right)}^{y.re} \]
              3. pow1/2N/A

                \[\leadsto 1 \cdot {\color{blue}{\left({\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\frac{1}{2}}\right)}}^{y.re} \]
              4. pow1/2N/A

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

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

                \[\leadsto 1 \cdot \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
              7. *-lft-identity70.3

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

                \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
              9. 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} \]
              10. sqrt-pow2N/A

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

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

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

                \[\leadsto {\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(y.re \cdot \color{blue}{\frac{1}{2}}\right)} \]
              14. lower-*.f6470.3

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

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

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

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

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

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

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

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

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

                \[\leadsto {\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right) \cdot \mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(\frac{\color{blue}{y.re \cdot \frac{1}{2}}}{2}\right)} \]
              9. associate-/l*N/A

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

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

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

                \[\leadsto {\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right) \cdot \mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\color{blue}{\left(y.re \cdot \left(\frac{1}{2} \cdot \frac{1}{2}\right)\right)}} \]
              13. metadata-eval70.3

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

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

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

          Alternative 4: 61.2% accurate, 5.2× speedup?

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

            1. Initial program 41.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{1} \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. Applied rewrites72.2%

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

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

                  \[\leadsto 1 \cdot {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}}\right)}^{y.re} \]
                3. pow1/2N/A

                  \[\leadsto 1 \cdot {\color{blue}{\left({\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\frac{1}{2}}\right)}}^{y.re} \]
                4. pow1/2N/A

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

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

                  \[\leadsto 1 \cdot \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
                7. *-lft-identity72.2

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

                  \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
                9. 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} \]
                10. sqrt-pow2N/A

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

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

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

                  \[\leadsto {\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(y.re \cdot \color{blue}{\frac{1}{2}}\right)} \]
                14. lower-*.f6472.2

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

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

              if -2.05e-94 < y.re < 1.4500000000000001e-22

              1. Initial program 39.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{1} \]
              7. Step-by-step derivation
                1. Applied rewrites44.7%

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

              Alternative 5: 58.0% accurate, 5.5× speedup?

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

                1. Initial program 29.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-*.f6456.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 rewrites56.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} \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. Applied rewrites59.1%

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

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

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

                      \[\leadsto 1 \cdot {\color{blue}{\left(-x.im\right)}}^{y.re} \]
                  4. Applied rewrites65.0%

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

                  if -3.4499999999999998e-40 < x.im < 3.49999999999999996e-4

                  1. Initial program 49.1%

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                    10. lower-*.f6456.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 rewrites56.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} \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. Applied rewrites56.9%

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

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

                        \[\leadsto 1 \cdot {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}}\right)}^{y.re} \]
                      3. pow1/2N/A

                        \[\leadsto 1 \cdot {\color{blue}{\left({\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\frac{1}{2}}\right)}}^{y.re} \]
                      4. pow1/2N/A

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

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

                        \[\leadsto 1 \cdot \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
                      7. *-lft-identity56.9

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

                        \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
                      9. 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} \]
                      10. sqrt-pow2N/A

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

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

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

                        \[\leadsto {\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(y.re \cdot \color{blue}{\frac{1}{2}}\right)} \]
                      14. lower-*.f6456.9

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

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

                      \[\leadsto {\color{blue}{\left({x.re}^{2}\right)}}^{\left(y.re \cdot \frac{1}{2}\right)} \]
                    5. Step-by-step derivation
                      1. unpow2N/A

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

                        \[\leadsto {\color{blue}{\left(x.re \cdot x.re\right)}}^{\left(y.re \cdot 0.5\right)} \]
                    6. Applied rewrites55.7%

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

                    if 3.49999999999999996e-4 < x.im

                    1. Initial program 36.0%

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

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

                        \[\leadsto \color{blue}{{x.im}^{y.re}} \]
                      3. Step-by-step derivation
                        1. lower-pow.f6459.9

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

                        \[\leadsto \color{blue}{{x.im}^{y.re}} \]
                    8. Recombined 3 regimes into one program.
                    9. Final simplification59.2%

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

                    Alternative 6: 55.7% accurate, 6.0× speedup?

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

                      1. Initial program 25.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{1} \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. Applied rewrites58.7%

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

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

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

                            \[\leadsto 1 \cdot {\color{blue}{\left(-x.im\right)}}^{y.re} \]
                        4. Applied rewrites65.1%

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

                        if -5.2999999999999998e-17 < x.im < 6.7999999999999994e-20

                        1. Initial program 50.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-*.f6457.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 rewrites57.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} \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. Applied rewrites57.2%

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

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

                              \[\leadsto \color{blue}{{x.re}^{y.re}} \]
                          4. Applied rewrites53.1%

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

                          if 6.7999999999999994e-20 < x.im

                          1. Initial program 36.4%

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                            10. lower-*.f6440.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 rewrites40.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} \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. Applied rewrites52.7%

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

                              \[\leadsto \color{blue}{{x.im}^{y.re}} \]
                            3. Step-by-step derivation
                              1. lower-pow.f6459.7

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

                              \[\leadsto \color{blue}{{x.im}^{y.re}} \]
                          8. Recombined 3 regimes into one program.
                          9. Final simplification57.7%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;x.im \leq -5.3 \cdot 10^{-17}:\\ \;\;\;\;{\left(-x.im\right)}^{y.re}\\ \mathbf{elif}\;x.im \leq 6.8 \cdot 10^{-20}:\\ \;\;\;\;{x.re}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;{x.im}^{y.re}\\ \end{array} \]
                          10. Add Preprocessing

                          Alternative 7: 51.4% accurate, 6.0× speedup?

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

                            1. Initial program 42.9%

                              \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                            2. Add Preprocessing
                            3. Taylor expanded in y.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-*.f6467.9

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

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

                              \[\leadsto \color{blue}{1} \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. Applied rewrites74.8%

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

                                \[\leadsto \color{blue}{{x.im}^{y.re}} \]
                              3. Step-by-step derivation
                                1. lower-pow.f6452.4

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

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

                              if -1.85e12 < y.re < 7.99999999999999964e-6

                              1. Initial program 38.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-*.f6432.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 rewrites32.4%

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

                                \[\leadsto \color{blue}{1} \]
                              7. Step-by-step derivation
                                1. Applied rewrites43.5%

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

                              Alternative 8: 48.9% accurate, 6.3× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x.im \leq 6.8 \cdot 10^{-20}:\\ \;\;\;\;{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 6.8e-20) (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 <= 6.8e-20) {
                              		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 <= 6.8d-20) 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 <= 6.8e-20) {
                              		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 <= 6.8e-20:
                              		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 <= 6.8e-20)
                              		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 <= 6.8e-20)
                              		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, 6.8e-20], 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 6.8 \cdot 10^{-20}:\\
                              \;\;\;\;{x.re}^{y.re}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;{x.im}^{y.re}\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if x.im < 6.7999999999999994e-20

                                1. Initial program 42.3%

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

                                  \[\leadsto \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-*.f6456.7

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

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

                                  \[\leadsto \color{blue}{1} \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. Applied rewrites57.7%

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

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

                                      \[\leadsto \color{blue}{{x.re}^{y.re}} \]
                                  4. Applied rewrites49.1%

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

                                  if 6.7999999999999994e-20 < x.im

                                  1. Initial program 36.4%

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                                    10. lower-*.f6440.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 rewrites40.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} \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. Applied rewrites52.7%

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

                                      \[\leadsto \color{blue}{{x.im}^{y.re}} \]
                                    3. Step-by-step derivation
                                      1. lower-pow.f6459.7

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

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

                                  Alternative 9: 25.9% accurate, 680.0× speedup?

                                  \[\begin{array}{l} \\ 1 \end{array} \]
                                  (FPCore (x.re x.im y.re y.im) :precision binary64 1.0)
                                  double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                  	return 1.0;
                                  }
                                  
                                  real(8) function code(x_46re, x_46im, y_46re, y_46im)
                                      real(8), intent (in) :: x_46re
                                      real(8), intent (in) :: x_46im
                                      real(8), intent (in) :: y_46re
                                      real(8), intent (in) :: y_46im
                                      code = 1.0d0
                                  end function
                                  
                                  public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                  	return 1.0;
                                  }
                                  
                                  def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                  	return 1.0
                                  
                                  function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                  	return 1.0
                                  end
                                  
                                  function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                  	tmp = 1.0;
                                  end
                                  
                                  code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 1.0
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  1
                                  \end{array}
                                  
                                  Derivation
                                  1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \color{blue}{1} \]
                                  7. Step-by-step derivation
                                    1. Applied rewrites20.5%

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

                                    Reproduce

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