powComplex, real part

Percentage Accurate: 41.4% → 80.0%
Time: 21.0s
Alternatives: 9
Speedup: 4.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 41.4% 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: 80.0% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{if}\;x.im \leq -1.1 \cdot 10^{-307}:\\ \;\;\;\;t_1 \cdot \cos \left(t_0 - y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\\ \mathbf{elif}\;x.im \leq 8 \cdot 10^{-116}:\\ \;\;\;\;t_1 \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \cos t_0\\ \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
         (exp
          (- (* (log (hypot x.re x.im)) y.re) (* (atan2 x.im x.re) y.im)))))
   (if (<= x.im -1.1e-307)
     (* t_1 (cos (- t_0 (* y.im (log (/ -1.0 x.im))))))
     (if (<= x.im 8e-116)
       (* t_1 (cos (* y.im (log (hypot x.im x.re)))))
       (* t_1 (cos t_0))))))
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 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
	double tmp;
	if (x_46_im <= -1.1e-307) {
		tmp = t_1 * cos((t_0 - (y_46_im * log((-1.0 / x_46_im)))));
	} else if (x_46_im <= 8e-116) {
		tmp = t_1 * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
	} else {
		tmp = t_1 * cos(t_0);
	}
	return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
	double t_1 = Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
	double tmp;
	if (x_46_im <= -1.1e-307) {
		tmp = t_1 * Math.cos((t_0 - (y_46_im * Math.log((-1.0 / x_46_im)))));
	} else if (x_46_im <= 8e-116) {
		tmp = t_1 * Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
	} else {
		tmp = t_1 * Math.cos(t_0);
	}
	return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	t_0 = y_46_re * math.atan2(x_46_im, x_46_re)
	t_1 = math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im)))
	tmp = 0
	if x_46_im <= -1.1e-307:
		tmp = t_1 * math.cos((t_0 - (y_46_im * math.log((-1.0 / x_46_im)))))
	elif x_46_im <= 8e-116:
		tmp = t_1 * math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re))))
	else:
		tmp = t_1 * math.cos(t_0)
	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 = exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))
	tmp = 0.0
	if (x_46_im <= -1.1e-307)
		tmp = Float64(t_1 * cos(Float64(t_0 - Float64(y_46_im * log(Float64(-1.0 / x_46_im))))));
	elseif (x_46_im <= 8e-116)
		tmp = Float64(t_1 * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))));
	else
		tmp = Float64(t_1 * cos(t_0));
	end
	return tmp
end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = y_46_re * atan2(x_46_im, x_46_re);
	t_1 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
	tmp = 0.0;
	if (x_46_im <= -1.1e-307)
		tmp = t_1 * cos((t_0 - (y_46_im * log((-1.0 / x_46_im)))));
	elseif (x_46_im <= 8e-116)
		tmp = t_1 * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
	else
		tmp = t_1 * cos(t_0);
	end
	tmp_2 = tmp;
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -1.1e-307], N[(t$95$1 * N[Cos[N[(t$95$0 - N[(y$46$im * N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 8e-116], N[(t$95$1 * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x.im \leq 8 \cdot 10^{-116}:\\
\;\;\;\;t_1 \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \cos t_0\\


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

    1. Initial program 38.8%

      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    2. Step-by-step derivation
      1. Simplified79.6%

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

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

          \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\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} + -1 \cdot \left(\log \left(\frac{-1}{x.im}\right) \cdot y.im\right)\right)} \]
        2. mul-1-neg85.8%

          \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\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} + \color{blue}{\left(-\log \left(\frac{-1}{x.im}\right) \cdot y.im\right)}\right) \]
        3. unsub-neg85.8%

          \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\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} - \log \left(\frac{-1}{x.im}\right) \cdot y.im\right)} \]
        4. *-commutative85.8%

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

        \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\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} - y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)} \]

      if -1.1e-307 < x.im < 8e-116

      1. Initial program 39.4%

        \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
      2. Step-by-step derivation
        1. Simplified82.9%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\cos \left({1}^{0.3333333333333333} \cdot \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
        5. Step-by-step derivation
          1. pow-base-144.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 8e-116 < x.im

        1. Initial program 37.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. Step-by-step derivation
          1. Simplified87.0%

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

            \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\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)} \]
        3. Recombined 3 regimes into one program.
        4. Final simplification86.4%

          \[\leadsto \begin{array}{l} \mathbf{if}\;x.im \leq -1.1 \cdot 10^{-307}:\\ \;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\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} - y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\\ \mathbf{elif}\;x.im \leq 8 \cdot 10^{-116}:\\ \;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\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)\\ \end{array} \]

        Alternative 2: 80.2% accurate, 0.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ t_2 := e^{t_1 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{if}\;x.im \leq -4.8 \cdot 10^{-308}:\\ \;\;\;\;t_2 \cdot \cos \left(t_0 - y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \cos \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right)\\ \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 (log (hypot x.re x.im)))
                (t_2 (exp (- (* t_1 y.re) (* (atan2 x.im x.re) y.im)))))
           (if (<= x.im -4.8e-308)
             (* t_2 (cos (- t_0 (* y.im (log (/ -1.0 x.im))))))
             (* t_2 (cos (fma t_1 y.im t_0))))))
        double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
        	double t_0 = y_46_re * atan2(x_46_im, x_46_re);
        	double t_1 = log(hypot(x_46_re, x_46_im));
        	double t_2 = exp(((t_1 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
        	double tmp;
        	if (x_46_im <= -4.8e-308) {
        		tmp = t_2 * cos((t_0 - (y_46_im * log((-1.0 / x_46_im)))));
        	} else {
        		tmp = t_2 * cos(fma(t_1, y_46_im, t_0));
        	}
        	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 = log(hypot(x_46_re, x_46_im))
        	t_2 = exp(Float64(Float64(t_1 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))
        	tmp = 0.0
        	if (x_46_im <= -4.8e-308)
        		tmp = Float64(t_2 * cos(Float64(t_0 - Float64(y_46_im * log(Float64(-1.0 / x_46_im))))));
        	else
        		tmp = Float64(t_2 * cos(fma(t_1, y_46_im, t_0)));
        	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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -4.8e-308], N[(t$95$2 * N[Cos[N[(t$95$0 - N[(y$46$im * N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Cos[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
        t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
        t_2 := e^{t_1 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
        \mathbf{if}\;x.im \leq -4.8 \cdot 10^{-308}:\\
        \;\;\;\;t_2 \cdot \cos \left(t_0 - y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t_2 \cdot \cos \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if x.im < -4.80000000000000016e-308

          1. Initial program 38.8%

            \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
          2. Step-by-step derivation
            1. Simplified79.6%

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

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

                \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\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} + -1 \cdot \left(\log \left(\frac{-1}{x.im}\right) \cdot y.im\right)\right)} \]
              2. mul-1-neg85.8%

                \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\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} + \color{blue}{\left(-\log \left(\frac{-1}{x.im}\right) \cdot y.im\right)}\right) \]
              3. unsub-neg85.8%

                \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\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} - \log \left(\frac{-1}{x.im}\right) \cdot y.im\right)} \]
              4. *-commutative85.8%

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

              \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\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} - y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)} \]

            if -4.80000000000000016e-308 < x.im

            1. Initial program 38.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. Step-by-step derivation
              1. Simplified85.9%

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;x.im \leq -4.8 \cdot 10^{-308}:\\ \;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\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} - y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\ \end{array} \]

            Alternative 3: 80.0% accurate, 1.2× speedup?

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

              1. Initial program 37.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. Step-by-step derivation
                1. Simplified85.3%

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\cos \left({1}^{0.3333333333333333} \cdot \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
                5. Step-by-step derivation
                  1. pow-base-137.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 2.04999999999999981e-40 < y.re

                1. Initial program 42.9%

                  \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                2. Step-by-step derivation
                  1. Simplified76.2%

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

                    \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\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)} \]
                3. Recombined 2 regimes into one program.
                4. Final simplification84.8%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq 2.05 \cdot 10^{-40}:\\ \;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\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)\\ \end{array} \]

                Alternative 4: 78.1% accurate, 1.3× speedup?

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

                  1. Initial program 36.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. Step-by-step derivation
                    1. Simplified85.2%

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

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

                    if 5.9999999999999996e-136 < x.re

                    1. Initial program 41.6%

                      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                    2. Step-by-step derivation
                      1. exp-diff39.3%

                        \[\leadsto \color{blue}{\frac{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re}}{e^{\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. exp-to-pow39.3%

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\frac{\cos \left(-1 \cdot \left(\log \left(\frac{1}{x.re}\right) \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)}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}} \]
                    5. Step-by-step derivation
                      1. associate-/l*74.5%

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \begin{array}{l} \mathbf{if}\;x.re \leq 6 \cdot 10^{-136}:\\ \;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\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)\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \log x.re\right)}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im - y.re \cdot \log x.re}}\\ \end{array} \]

                  Alternative 5: 79.8% accurate, 1.3× speedup?

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

                    1. Initial program 34.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. Step-by-step derivation
                      1. Simplified82.9%

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

                        \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\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)} \]
                      3. Taylor expanded in y.re around 0 85.5%

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

                      if -1.40000000000000012e-82 < y.re < 3.05000000000000019e-43

                      1. Initial program 39.0%

                        \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                      2. Step-by-step derivation
                        1. exp-diff39.0%

                          \[\leadsto \color{blue}{\frac{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re}}{e^{\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. exp-to-pow39.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 3.05000000000000019e-43 < y.re

                      1. Initial program 42.9%

                        \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                      2. Step-by-step derivation
                        1. Simplified76.2%

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

                          \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\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)} \]
                      3. Recombined 3 regimes into one program.
                      4. Final simplification84.9%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -1.4 \cdot 10^{-82}:\\ \;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{elif}\;y.re \leq 3.05 \cdot 10^{-43}:\\ \;\;\;\;\frac{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\ \mathbf{else}:\\ \;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\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)\\ \end{array} \]

                      Alternative 6: 81.3% accurate, 1.6× speedup?

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

                        1. Initial program 25.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. Step-by-step derivation
                          1. exp-diff21.6%

                            \[\leadsto \color{blue}{\frac{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re}}{e^{\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. exp-to-pow21.6%

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{\frac{\cos \left(-1 \cdot \left(\log \left(\frac{-1}{x.im}\right) \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.im}\right)\right)}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}} \]
                        5. Step-by-step derivation
                          1. associate-/l*67.0%

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} - y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im - \color{blue}{\left(-\log \left(\frac{-1}{x.im}\right) \cdot y.re\right)}}} \]
                          11. distribute-rgt-neg-in80.8%

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

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

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

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

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

                        if -1.1499999999999999 < x.im

                        1. Initial program 41.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. Step-by-step derivation
                          1. Simplified84.7%

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

                            \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\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)} \]
                          3. Taylor expanded in y.re around 0 83.4%

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

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

                        Alternative 7: 61.9% accurate, 2.0× speedup?

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

                          1. Initial program 42.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. Step-by-step derivation
                            1. exp-diff39.2%

                              \[\leadsto \color{blue}{\frac{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re}}{e^{\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. exp-to-pow39.2%

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

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

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

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

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

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

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

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

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

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

                              \[\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} \]
                            3. unpow255.3%

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

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

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

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

                          if 9.39999999999999978e36 < x.im < 1.50000000000000007e233

                          1. Initial program 36.4%

                            \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                          2. Step-by-step derivation
                            1. Simplified92.7%

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

                              \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\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)} \]
                            3. Taylor expanded in x.im around inf 80.1%

                              \[\leadsto e^{\color{blue}{\left(0.5 \cdot \frac{{x.re}^{2} \cdot y.re}{{x.im}^{2}} + -1 \cdot \left(\log \left(\frac{1}{x.im}\right) \cdot y.re\right)\right)} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                            4. Step-by-step derivation
                              1. mul-1-neg80.1%

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

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

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

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

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

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

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

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

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

                            if 1.50000000000000007e233 < x.im

                            1. Initial program 0.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. Step-by-step derivation
                              1. exp-diff0.0%

                                \[\leadsto \color{blue}{\frac{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re}}{e^{\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. exp-to-pow0.0%

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

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

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

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

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

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

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

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

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

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

                                \[\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} \]
                              3. unpow239.1%

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

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

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

                            \[\leadsto \begin{array}{l} \mathbf{if}\;x.im \leq 9.4 \cdot 10^{+36}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{elif}\;x.im \leq 1.5 \cdot 10^{+233}:\\ \;\;\;\;e^{\left(0.5 \cdot \frac{y.re \cdot \left(x.re \cdot x.re\right)}{x.im \cdot x.im} + y.re \cdot \log x.im\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \end{array} \]

                          Alternative 8: 80.9% accurate, 2.0× speedup?

                          \[\begin{array}{l} \\ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \end{array} \]
                          (FPCore (x.re x.im y.re y.im)
                           :precision binary64
                           (exp (- (* (log (hypot x.re x.im)) y.re) (* (atan2 x.im x.re) y.im))))
                          double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                          	return exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
                          }
                          
                          public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                          	return Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
                          }
                          
                          def code(x_46_re, x_46_im, y_46_re, y_46_im):
                          	return math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im)))
                          
                          function code(x_46_re, x_46_im, y_46_re, y_46_im)
                          	return exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))
                          end
                          
                          function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
                          	tmp = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
                          end
                          
                          code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
                          
                          \begin{array}{l}
                          
                          \\
                          e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}
                          \end{array}
                          
                          Derivation
                          1. Initial program 38.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. Step-by-step derivation
                            1. Simplified83.1%

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

                              \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\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)} \]
                            3. Taylor expanded in y.re around 0 81.3%

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

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

                            Alternative 9: 61.0% accurate, 4.1× speedup?

                            \[\begin{array}{l} \\ {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \end{array} \]
                            (FPCore (x.re x.im y.re y.im) :precision binary64 (pow (hypot x.im x.re) y.re))
                            double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                            	return pow(hypot(x_46_im, x_46_re), y_46_re);
                            }
                            
                            public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                            	return Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
                            }
                            
                            def code(x_46_re, x_46_im, y_46_re, y_46_im):
                            	return math.pow(math.hypot(x_46_im, x_46_re), y_46_re)
                            
                            function code(x_46_re, x_46_im, y_46_re, y_46_im)
                            	return hypot(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)
                            	tmp = hypot(x_46_im, x_46_re) ^ y_46_re;
                            end
                            
                            code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]
                            
                            \begin{array}{l}
                            
                            \\
                            {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}
                            \end{array}
                            
                            Derivation
                            1. Initial program 38.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. Step-by-step derivation
                              1. exp-diff35.8%

                                \[\leadsto \color{blue}{\frac{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re}}{e^{\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. exp-to-pow35.8%

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

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

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

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

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

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

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

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

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

                                \[\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} \]
                              3. unpow254.0%

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

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

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

                              \[\leadsto \color{blue}{1} \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \]
                            8. Final simplification65.3%

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

                            Reproduce

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