powComplex, real part

Percentage Accurate: 39.8% → 77.2%
Time: 16.5s
Alternatives: 9
Speedup: 6.0×

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

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

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

Alternative 1: 77.2% accurate, 3.1× 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 -1.3 \cdot 10^{-6}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 490000000:\\ \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (pow (fma x.im x.im (* x.re x.re)) (* y.re 0.5))))
   (if (<= y.re -1.3e-6)
     t_0
     (if (<= y.re 490000000.0) (exp (- (* y.im (atan2 x.im x.re)))) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = pow(fma(x_46_im, x_46_im, (x_46_re * x_46_re)), (y_46_re * 0.5));
	double tmp;
	if (y_46_re <= -1.3e-6) {
		tmp = t_0;
	} else if (y_46_re <= 490000000.0) {
		tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = 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 <= -1.3e-6)
		tmp = t_0;
	elseif (y_46_re <= 490000000.0)
		tmp = exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re))));
	else
		tmp = t_0;
	end
	return tmp
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[(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, -1.3e-6], t$95$0, If[LessEqual[y$46$re, 490000000.0], N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\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 -1.3 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y.re < -1.30000000000000005e-6 or 4.9e8 < y.re

    1. Initial program 30.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\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. 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} \]
        4. 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}} \]
        5. *-lft-identity74.4

          \[\leadsto \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 \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
        7. 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} \]
        8. 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)}} \]
        9. 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)}} \]
        10. 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)}} \]
        11. 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)} \]
        12. lower-*.f6474.4

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

        \[\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 -1.30000000000000005e-6 < y.re < 4.9e8

      1. Initial program 35.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.f6448.4

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

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

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

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

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

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

    Alternative 2: 72.4% accurate, 0.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_2 := \log \left(\frac{-1}{x.re}\right)\\ t_3 := y.im \cdot \log x.re\\ t_4 := \sin t\_0 \cdot \sin t\_3\\ t_5 := \cos t\_0 \cdot \cos t\_3\\ \mathbf{if}\;x.re \leq -5 \cdot 10^{-309}:\\ \;\;\;\;\cos \left(\mathsf{fma}\left(t\_2, -y.im, t\_0\right)\right) \cdot e^{-\mathsf{fma}\left(y.re, t\_2, t\_1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{{t\_5}^{3} - {t\_4}^{3}}{{t\_5}^{2} + \left({t\_4}^{2} + t\_5 \cdot t\_4\right)} \cdot e^{y.re \cdot \log x.re - t\_1}\\ \end{array} \end{array} \]
    (FPCore (x.re x.im y.re y.im)
     :precision binary64
     (let* ((t_0 (* y.re (atan2 x.im x.re)))
            (t_1 (* y.im (atan2 x.im x.re)))
            (t_2 (log (/ -1.0 x.re)))
            (t_3 (* y.im (log x.re)))
            (t_4 (* (sin t_0) (sin t_3)))
            (t_5 (* (cos t_0) (cos t_3))))
       (if (<= x.re -5e-309)
         (* (cos (fma t_2 (- y.im) t_0)) (exp (- (fma y.re t_2 t_1))))
         (*
          (/
           (- (pow t_5 3.0) (pow t_4 3.0))
           (+ (pow t_5 2.0) (+ (pow t_4 2.0) (* t_5 t_4))))
          (exp (- (* y.re (log x.re)) t_1))))))
    double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
    	double t_0 = y_46_re * atan2(x_46_im, x_46_re);
    	double t_1 = y_46_im * atan2(x_46_im, x_46_re);
    	double t_2 = log((-1.0 / x_46_re));
    	double t_3 = y_46_im * log(x_46_re);
    	double t_4 = sin(t_0) * sin(t_3);
    	double t_5 = cos(t_0) * cos(t_3);
    	double tmp;
    	if (x_46_re <= -5e-309) {
    		tmp = cos(fma(t_2, -y_46_im, t_0)) * exp(-fma(y_46_re, t_2, t_1));
    	} else {
    		tmp = ((pow(t_5, 3.0) - pow(t_4, 3.0)) / (pow(t_5, 2.0) + (pow(t_4, 2.0) + (t_5 * t_4)))) * exp(((y_46_re * log(x_46_re)) - t_1));
    	}
    	return tmp;
    }
    
    function code(x_46_re, x_46_im, y_46_re, y_46_im)
    	t_0 = Float64(y_46_re * atan(x_46_im, x_46_re))
    	t_1 = Float64(y_46_im * atan(x_46_im, x_46_re))
    	t_2 = log(Float64(-1.0 / x_46_re))
    	t_3 = Float64(y_46_im * log(x_46_re))
    	t_4 = Float64(sin(t_0) * sin(t_3))
    	t_5 = Float64(cos(t_0) * cos(t_3))
    	tmp = 0.0
    	if (x_46_re <= -5e-309)
    		tmp = Float64(cos(fma(t_2, Float64(-y_46_im), t_0)) * exp(Float64(-fma(y_46_re, t_2, t_1))));
    	else
    		tmp = Float64(Float64(Float64((t_5 ^ 3.0) - (t_4 ^ 3.0)) / Float64((t_5 ^ 2.0) + Float64((t_4 ^ 2.0) + Float64(t_5 * t_4)))) * exp(Float64(Float64(y_46_re * log(x_46_re)) - t_1)));
    	end
    	return tmp
    end
    
    code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sin[t$95$0], $MachinePrecision] * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[Cos[t$95$0], $MachinePrecision] * N[Cos[t$95$3], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -5e-309], N[(N[Cos[N[(t$95$2 * (-y$46$im) + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[(-N[(y$46$re * t$95$2 + t$95$1), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Power[t$95$5, 3.0], $MachinePrecision] - N[Power[t$95$4, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[t$95$5, 2.0], $MachinePrecision] + N[(N[Power[t$95$4, 2.0], $MachinePrecision] + N[(t$95$5 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
    t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
    t_2 := \log \left(\frac{-1}{x.re}\right)\\
    t_3 := y.im \cdot \log x.re\\
    t_4 := \sin t\_0 \cdot \sin t\_3\\
    t_5 := \cos t\_0 \cdot \cos t\_3\\
    \mathbf{if}\;x.re \leq -5 \cdot 10^{-309}:\\
    \;\;\;\;\cos \left(\mathsf{fma}\left(t\_2, -y.im, t\_0\right)\right) \cdot e^{-\mathsf{fma}\left(y.re, t\_2, t\_1\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{{t\_5}^{3} - {t\_4}^{3}}{{t\_5}^{2} + \left({t\_4}^{2} + t\_5 \cdot t\_4\right)} \cdot e^{y.re \cdot \log x.re - t\_1}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x.re < -4.9999999999999995e-309

      1. Initial program 32.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -4.9999999999999995e-309 < x.re

      1. Initial program 34.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 x.im around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 3: 61.3% accurate, 4.7× 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 -1.26 \cdot 10^{-36}:\\ \;\;\;\;{\left(t\_0 \cdot t\_0\right)}^{\left(0.5 \cdot \left(y.re \cdot 0.5\right)\right)}\\ \mathbf{elif}\;y.re \leq 31:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;{t\_0}^{\left(y.re \cdot 0.5\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 -1.26e-36)
         (pow (* t_0 t_0) (* 0.5 (* y.re 0.5)))
         (if (<= y.re 31.0) 1.0 (pow t_0 (* y.re 0.5))))))
    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 <= -1.26e-36) {
    		tmp = pow((t_0 * t_0), (0.5 * (y_46_re * 0.5)));
    	} else if (y_46_re <= 31.0) {
    		tmp = 1.0;
    	} else {
    		tmp = pow(t_0, (y_46_re * 0.5));
    	}
    	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 <= -1.26e-36)
    		tmp = Float64(t_0 * t_0) ^ Float64(0.5 * Float64(y_46_re * 0.5));
    	elseif (y_46_re <= 31.0)
    		tmp = 1.0;
    	else
    		tmp = t_0 ^ Float64(y_46_re * 0.5);
    	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, -1.26e-36], N[Power[N[(t$95$0 * t$95$0), $MachinePrecision], N[(0.5 * N[(y$46$re * 0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 31.0], 1.0, N[Power[t$95$0, N[(y$46$re * 0.5), $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 -1.26 \cdot 10^{-36}:\\
    \;\;\;\;{\left(t\_0 \cdot t\_0\right)}^{\left(0.5 \cdot \left(y.re \cdot 0.5\right)\right)}\\
    
    \mathbf{elif}\;y.re \leq 31:\\
    \;\;\;\;1\\
    
    \mathbf{else}:\\
    \;\;\;\;{t\_0}^{\left(y.re \cdot 0.5\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y.re < -1.26000000000000005e-36

      1. Initial program 30.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-*.f6475.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 rewrites75.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 rewrites78.5%

          \[\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. 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} \]
          4. 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}} \]
          5. *-lft-identity78.5

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

            \[\leadsto \color{blue}{{\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)} \cdot {\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(\frac{\frac{y.re}{2}}{2}\right)}} \]
          10. 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{\frac{y.re}{2}}{2}\right)}} \]
          11. 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{\frac{y.re}{2}}{2}\right)}} \]
          12. 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{\frac{y.re}{2}}{2}\right)} \]
          13. div-invN/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(\frac{y.re}{2} \cdot \frac{1}{2}\right)}} \]
          14. 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(\frac{y.re}{2} \cdot \color{blue}{\frac{1}{2}}\right)} \]
          15. 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(\frac{y.re}{2} \cdot \frac{1}{2}\right)}} \]
          16. div-invN/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(\color{blue}{\left(y.re \cdot \frac{1}{2}\right)} \cdot \frac{1}{2}\right)} \]
          17. 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(\left(y.re \cdot \color{blue}{\frac{1}{2}}\right) \cdot \frac{1}{2}\right)} \]
          18. lower-*.f6479.9

            \[\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(\color{blue}{\left(y.re \cdot 0.5\right)} \cdot 0.5\right)} \]
        3. Applied rewrites79.9%

          \[\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(\left(y.re \cdot 0.5\right) \cdot 0.5\right)}} \]

        if -1.26000000000000005e-36 < y.re < 31

        1. Initial program 35.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-*.f6430.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 rewrites30.1%

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

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

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

          if 31 < y.re

          1. Initial program 30.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.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 rewrites57.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 rewrites66.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. 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} \]
              4. 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}} \]
              5. *-lft-identity66.9

                \[\leadsto \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 \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
              7. 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} \]
              8. 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)}} \]
              9. 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)}} \]
              10. 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)}} \]
              11. 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)} \]
              12. lower-*.f6466.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 rewrites66.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)}} \]
          8. Recombined 3 regimes into one program.
          9. Final simplification62.5%

            \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -1.26 \cdot 10^{-36}:\\ \;\;\;\;{\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(0.5 \cdot \left(y.re \cdot 0.5\right)\right)}\\ \mathbf{elif}\;y.re \leq 31:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(y.re \cdot 0.5\right)}\\ \end{array} \]
          10. Add Preprocessing

          Alternative 4: 61.5% 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 -1.26 \cdot 10^{-36}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 31:\\ \;\;\;\;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 -1.26e-36) t_0 (if (<= y.re 31.0) 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 <= -1.26e-36) {
          		tmp = t_0;
          	} else if (y_46_re <= 31.0) {
          		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 <= -1.26e-36)
          		tmp = t_0;
          	elseif (y_46_re <= 31.0)
          		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, -1.26e-36], t$95$0, If[LessEqual[y$46$re, 31.0], 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 -1.26 \cdot 10^{-36}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;y.re \leq 31:\\
          \;\;\;\;1\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y.re < -1.26000000000000005e-36 or 31 < y.re

            1. Initial program 30.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-*.f6466.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 rewrites66.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 rewrites72.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. 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. 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} \]
                4. 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}} \]
                5. *-lft-identity72.8

                  \[\leadsto \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 \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
                7. 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} \]
                8. 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)}} \]
                9. 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)}} \]
                10. 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)}} \]
                11. 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)} \]
                12. lower-*.f6472.8

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

                \[\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 -1.26000000000000005e-36 < y.re < 31

              1. Initial program 35.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-*.f6430.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 rewrites30.1%

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

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

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

              Alternative 5: 54.0% accurate, 6.0× speedup?

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

                1. Initial program 34.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-*.f6445.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 rewrites45.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 rewrites48.0%

                    \[\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 -inf

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

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

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

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

                  if -5.50000000000000043e-149 < x.re < -1.4000000000000001e-287

                  1. Initial program 19.2%

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

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

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

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

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

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

                      \[\leadsto e^{\log \left(\sqrt{\color{blue}{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 \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    2. lower-*.f6454.3

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

                    \[\leadsto e^{\log \left(\sqrt{\color{blue}{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 \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  9. Taylor expanded in y.re around 0

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

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

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

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

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

                    if -1.4000000000000001e-287 < x.re

                    1. Initial program 35.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-*.f6453.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 rewrites53.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 rewrites55.4%

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

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

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

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

                    Alternative 6: 55.4% accurate, 6.0× speedup?

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

                      1. Initial program 14.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \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 rewrites48.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. 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.f6459.3

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

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

                        if -0.340000000000000024 < x.im < 5.7999999999999996e-53

                        1. Initial program 46.6%

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

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

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

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

                          if 5.7999999999999996e-53 < x.im

                          1. Initial program 32.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 e^{\log \left(\sqrt{x.re \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.f6466.1

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

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

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

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

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

                            \[\leadsto e^{\log \left(\sqrt{\color{blue}{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 \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                          9. Taylor expanded in y.re around 0

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

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

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

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

                              \[\leadsto \color{blue}{{x.im}^{y.re}} \]
                          11. Recombined 3 regimes into one program.
                          12. Final simplification56.3%

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

                          Alternative 7: 53.2% accurate, 6.0× speedup?

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

                            1. Initial program 30.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-*.f6467.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 rewrites67.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 rewrites73.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. Taylor expanded in x.im around 0

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

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

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

                              if -9.9999999999999998e-13 < y.re < 37000

                              1. Initial program 35.3%

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

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

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

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

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

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

                              Alternative 8: 51.8% accurate, 6.0× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -0.0026:\\ \;\;\;\;{x.im}^{y.re}\\ \mathbf{elif}\;y.re \leq 220000000000:\\ \;\;\;\;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 -0.0026)
                                 (pow x.im y.re)
                                 (if (<= y.re 220000000000.0) 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 <= -0.0026) {
                              		tmp = pow(x_46_im, y_46_re);
                              	} else if (y_46_re <= 220000000000.0) {
                              		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 <= (-0.0026d0)) then
                                      tmp = x_46im ** y_46re
                                  else if (y_46re <= 220000000000.0d0) 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 <= -0.0026) {
                              		tmp = Math.pow(x_46_im, y_46_re);
                              	} else if (y_46_re <= 220000000000.0) {
                              		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 <= -0.0026:
                              		tmp = math.pow(x_46_im, y_46_re)
                              	elif y_46_re <= 220000000000.0:
                              		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 <= -0.0026)
                              		tmp = x_46_im ^ y_46_re;
                              	elseif (y_46_re <= 220000000000.0)
                              		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 <= -0.0026)
                              		tmp = x_46_im ^ y_46_re;
                              	elseif (y_46_re <= 220000000000.0)
                              		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, -0.0026], N[Power[x$46$im, y$46$re], $MachinePrecision], If[LessEqual[y$46$re, 220000000000.0], 1.0, N[Power[x$46$im, y$46$re], $MachinePrecision]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;y.re \leq -0.0026:\\
                              \;\;\;\;{x.im}^{y.re}\\
                              
                              \mathbf{elif}\;y.re \leq 220000000000:\\
                              \;\;\;\;1\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;{x.im}^{y.re}\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if y.re < -0.0025999999999999999 or 2.2e11 < y.re

                                1. Initial program 29.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 e^{\log \left(\sqrt{x.re \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.f6469.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 \left(y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right) \]
                                5. Applied rewrites69.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)} \]
                                6. Taylor expanded in x.re around 0

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

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

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

                                  \[\leadsto e^{\log \left(\sqrt{\color{blue}{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 \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                                9. Taylor expanded in y.re around 0

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

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

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

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

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

                                  if -0.0025999999999999999 < y.re < 2.2e11

                                  1. Initial program 36.2%

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                                    10. lower-*.f6431.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 rewrites31.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} \]
                                  7. Step-by-step derivation
                                    1. Applied rewrites46.8%

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

                                  Alternative 9: 26.1% 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 33.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-*.f6449.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 rewrites49.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 rewrites25.3%

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

                                    Reproduce

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