powComplex, real part

Percentage Accurate: 40.5% → 78.9%
Time: 17.5s
Alternatives: 13
Speedup: 6.9×

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

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

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

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

\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.1 \cdot 10^{+50}:\\
\;\;\;\;\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}\\

\mathbf{elif}\;y.re \leq 7.2:\\
\;\;\;\;\frac{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{\frac{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\

\mathbf{else}:\\
\;\;\;\;{\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}\\


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

    1. Initial program 41.2%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \left({\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right)\right) \]
      8. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right)\right) \]
      9. hypot-lowering-hypot.f6488.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right)\right) \]
    5. Simplified88.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}} \]

    if -2.1e50 < y.re < 7.20000000000000018

    1. Initial program 41.7%

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

        \[\leadsto \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 \color{blue}{\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. associate-*l/N/A

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\cos \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)}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y.re around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
    6. Step-by-step derivation
      1. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\color{blue}{\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)}, \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)}\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      3. log-lowering-log.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), \color{blue}{y.im}\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      6. hypot-defineN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      7. hypot-lowering-hypot.f6483.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
    7. Simplified83.5%

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

    if 7.20000000000000018 < y.re

    1. Initial program 44.6%

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

        \[\leadsto \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 \color{blue}{\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. associate-*l/N/A

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\cos \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)}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y.re around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
    6. Step-by-step derivation
      1. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\color{blue}{\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)}, \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)}\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      3. log-lowering-log.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), \color{blue}{y.im}\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      6. hypot-defineN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      7. hypot-lowering-hypot.f6464.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
    7. Simplified64.6%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{1}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
    9. Step-by-step derivation
      1. Simplified69.2%

        \[\leadsto \frac{\color{blue}{1}}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}} \]
      2. Step-by-step derivation
        1. *-commutativeN/A

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \left({\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}\right)\right), \left(\mathsf{neg}\left(\color{blue}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\right)\right)\right) \]
        7. sqrt-pow2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \left({\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
        8. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\left(x.re \cdot x.re + x.im \cdot x.im\right), \left(\frac{y.re}{2}\right)\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
        9. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\left(x.re \cdot x.re\right), \left(x.im \cdot x.im\right)\right), \left(\frac{y.re}{2}\right)\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
        10. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \left(x.im \cdot x.im\right)\right), \left(\frac{y.re}{2}\right)\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
        11. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \left(\frac{y.re}{2}\right)\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
        12. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
        13. neg-sub0N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \left(0 - \color{blue}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\right)\right) \]
        14. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)}\right)\right) \]
        15. exp-lowering-exp.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{exp.f64}\left(\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right) \]
        16. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{exp.f64}\left(\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)\right)\right) \]
        17. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.im\right)\right)\right)\right) \]
        18. atan2-lowering-atan2.f6458.5%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)\right)\right) \]
      3. Applied egg-rr58.5%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{1}\right)\right) \]
      5. Step-by-step derivation
        1. Simplified77.0%

          \[\leadsto \frac{0 - {\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}}{0 - \color{blue}{1}} \]
      6. Recombined 3 regimes into one program.
      7. Final simplification82.8%

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

      Alternative 2: 76.4% accurate, 1.0× speedup?

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

        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-diffN/A

            \[\leadsto \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 \color{blue}{\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. associate-*l/N/A

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

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

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

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

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

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

        if 10.5999999999999996 < y.re

        1. Initial program 44.6%

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

            \[\leadsto \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 \color{blue}{\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. associate-*l/N/A

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{\cos \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)}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}} \]
        4. Add Preprocessing
        5. Taylor expanded in y.re around 0

          \[\leadsto \mathsf{/.f64}\left(\color{blue}{\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
        6. Step-by-step derivation
          1. cos-lowering-cos.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\color{blue}{\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)}, \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)}\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
          3. log-lowering-log.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), \color{blue}{y.im}\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
          4. unpow2N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
          5. unpow2N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
          6. hypot-defineN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
          7. hypot-lowering-hypot.f6464.6%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
        7. Simplified64.6%

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

          \[\leadsto \mathsf{/.f64}\left(\color{blue}{1}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
        9. Step-by-step derivation
          1. Simplified69.2%

            \[\leadsto \frac{\color{blue}{1}}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}} \]
          2. Step-by-step derivation
            1. *-commutativeN/A

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \left({\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}\right)\right), \left(\mathsf{neg}\left(\color{blue}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\right)\right)\right) \]
            7. sqrt-pow2N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \left({\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
            8. pow-lowering-pow.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\left(x.re \cdot x.re + x.im \cdot x.im\right), \left(\frac{y.re}{2}\right)\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
            9. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\left(x.re \cdot x.re\right), \left(x.im \cdot x.im\right)\right), \left(\frac{y.re}{2}\right)\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
            10. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \left(x.im \cdot x.im\right)\right), \left(\frac{y.re}{2}\right)\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
            11. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \left(\frac{y.re}{2}\right)\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
            12. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
            13. neg-sub0N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \left(0 - \color{blue}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\right)\right) \]
            14. --lowering--.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)}\right)\right) \]
            15. exp-lowering-exp.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{exp.f64}\left(\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right) \]
            16. *-commutativeN/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{exp.f64}\left(\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)\right)\right) \]
            17. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.im\right)\right)\right)\right) \]
            18. atan2-lowering-atan2.f6458.5%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)\right)\right) \]
          3. Applied egg-rr58.5%

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

            \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{1}\right)\right) \]
          5. Step-by-step derivation
            1. Simplified77.0%

              \[\leadsto \frac{0 - {\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}}{0 - \color{blue}{1}} \]
          6. Recombined 2 regimes into one program.
          7. Final simplification81.6%

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

          Alternative 3: 74.8% accurate, 1.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{if}\;y.im \leq 7.5 \cdot 10^{+47}:\\ \;\;\;\;\frac{1}{\frac{t\_0}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{t\_0}\\ \end{array} \end{array} \]
          (FPCore (x.re x.im y.re y.im)
           :precision binary64
           (let* ((t_0 (exp (* y.im (atan2 x.im x.re)))))
             (if (<= y.im 7.5e+47)
               (/ 1.0 (/ t_0 (pow (hypot x.re x.im) y.re)))
               (/ (cos (* y.im (log (hypot 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 = exp((y_46_im * atan2(x_46_im, x_46_re)));
          	double tmp;
          	if (y_46_im <= 7.5e+47) {
          		tmp = 1.0 / (t_0 / pow(hypot(x_46_re, x_46_im), y_46_re));
          	} else {
          		tmp = cos((y_46_im * log(hypot(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.exp((y_46_im * Math.atan2(x_46_im, x_46_re)));
          	double tmp;
          	if (y_46_im <= 7.5e+47) {
          		tmp = 1.0 / (t_0 / Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re));
          	} else {
          		tmp = Math.cos((y_46_im * Math.log(Math.hypot(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.exp((y_46_im * math.atan2(x_46_im, x_46_re)))
          	tmp = 0
          	if y_46_im <= 7.5e+47:
          		tmp = 1.0 / (t_0 / math.pow(math.hypot(x_46_re, x_46_im), y_46_re))
          	else:
          		tmp = math.cos((y_46_im * math.log(math.hypot(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 = exp(Float64(y_46_im * atan(x_46_im, x_46_re)))
          	tmp = 0.0
          	if (y_46_im <= 7.5e+47)
          		tmp = Float64(1.0 / Float64(t_0 / (hypot(x_46_re, x_46_im) ^ y_46_re)));
          	else
          		tmp = Float64(cos(Float64(y_46_im * log(hypot(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 = exp((y_46_im * atan2(x_46_im, x_46_re)));
          	tmp = 0.0;
          	if (y_46_im <= 7.5e+47)
          		tmp = 1.0 / (t_0 / (hypot(x_46_re, x_46_im) ^ y_46_re));
          	else
          		tmp = cos((y_46_im * log(hypot(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[Exp[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, 7.5e+47], N[(1.0 / N[(t$95$0 / N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
          \mathbf{if}\;y.im \leq 7.5 \cdot 10^{+47}:\\
          \;\;\;\;\frac{1}{\frac{t\_0}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{t\_0}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y.im < 7.4999999999999999e47

            1. Initial program 43.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. exp-diffN/A

                \[\leadsto \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 \color{blue}{\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. associate-*l/N/A

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

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

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

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

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

              \[\leadsto \color{blue}{\frac{\cos \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)}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}} \]
            4. Add Preprocessing
            5. Taylor expanded in y.re around 0

              \[\leadsto \mathsf{/.f64}\left(\color{blue}{\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
            6. Step-by-step derivation
              1. cos-lowering-cos.f64N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\color{blue}{\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)}, \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
              2. *-lowering-*.f64N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)}\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
              3. log-lowering-log.f64N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), \color{blue}{y.im}\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
              4. unpow2N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
              5. unpow2N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
              6. hypot-defineN/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
              7. hypot-lowering-hypot.f6478.9%

                \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
            7. Simplified78.9%

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

              \[\leadsto \mathsf{/.f64}\left(\color{blue}{1}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
            9. Step-by-step derivation
              1. Simplified80.8%

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

              if 7.4999999999999999e47 < y.im

              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-diffN/A

                  \[\leadsto \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 \color{blue}{\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. associate-*l/N/A

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

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

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

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

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

                \[\leadsto \color{blue}{\frac{\cos \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)}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}} \]
              4. Add Preprocessing
              5. Taylor expanded in y.re around 0

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

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

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

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

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

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

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right)\right), \left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right) \]
                7. hypot-defineN/A

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

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

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{exp.f64}\left(\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right) \]
                10. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right) \]
                11. atan2-lowering-atan2.f6480.9%

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right) \]
              7. Simplified80.9%

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

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

            Alternative 4: 78.0% accurate, 2.0× speedup?

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

              1. Initial program 41.2%

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \left({\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re}\right)\right) \]
                5. pow-lowering-pow.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right)\right) \]
                6. unpow2N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right)\right) \]
                7. unpow2N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right)\right) \]
                8. hypot-defineN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right)\right) \]
                9. hypot-lowering-hypot.f6488.3%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right)\right) \]
              5. Simplified88.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}} \]

              if -2.9e50 < y.re < 1.2e-5

              1. Initial program 41.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. exp-diffN/A

                  \[\leadsto \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 \color{blue}{\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. associate-*l/N/A

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

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

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

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

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

                \[\leadsto \color{blue}{\frac{\cos \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)}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}} \]
              4. Add Preprocessing
              5. Taylor expanded in y.re around 0

                \[\leadsto \mathsf{/.f64}\left(\color{blue}{\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
              6. Step-by-step derivation
                1. cos-lowering-cos.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\color{blue}{\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)}, \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                2. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)}\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                3. log-lowering-log.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), \color{blue}{y.im}\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                4. unpow2N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                5. unpow2N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                6. hypot-defineN/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                7. hypot-lowering-hypot.f6483.2%

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
              7. Simplified83.2%

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

                \[\leadsto \mathsf{/.f64}\left(\color{blue}{1}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
              9. Step-by-step derivation
                1. Simplified82.5%

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

                if 1.2e-5 < y.re

                1. Initial program 44.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. exp-diffN/A

                    \[\leadsto \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 \color{blue}{\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. associate-*l/N/A

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

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

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

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

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

                  \[\leadsto \color{blue}{\frac{\cos \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)}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}} \]
                4. Add Preprocessing
                5. Taylor expanded in y.re around 0

                  \[\leadsto \mathsf{/.f64}\left(\color{blue}{\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                6. Step-by-step derivation
                  1. cos-lowering-cos.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\color{blue}{\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)}, \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                  2. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)}\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                  3. log-lowering-log.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), \color{blue}{y.im}\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                  4. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                  5. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                  6. hypot-defineN/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                  7. hypot-lowering-hypot.f6466.2%

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                7. Simplified66.2%

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

                  \[\leadsto \mathsf{/.f64}\left(\color{blue}{1}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                9. Step-by-step derivation
                  1. Simplified68.8%

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

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

                      \[\leadsto \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right) \]
                    2. +-commutativeN/A

                      \[\leadsto \mathsf{pow.f64}\left(\left(\sqrt{{x.re}^{2} + {x.im}^{2}}\right), y.re\right) \]
                    3. unpow2N/A

                      \[\leadsto \mathsf{pow.f64}\left(\left(\sqrt{x.re \cdot x.re + {x.im}^{2}}\right), y.re\right) \]
                    4. unpow2N/A

                      \[\leadsto \mathsf{pow.f64}\left(\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right), y.re\right) \]
                    5. hypot-defineN/A

                      \[\leadsto \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re\right) \]
                    6. hypot-lowering-hypot.f6476.3%

                      \[\leadsto \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right) \]
                  4. Simplified76.3%

                    \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}} \]
                10. Recombined 3 regimes into one program.
                11. Final simplification82.0%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -2.9 \cdot 10^{+50}:\\ \;\;\;\;\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}\\ \mathbf{elif}\;y.re \leq 1.2 \cdot 10^{-5}:\\ \;\;\;\;\frac{1}{\frac{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\ \end{array} \]
                12. Add Preprocessing

                Alternative 5: 76.4% accurate, 2.0× speedup?

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

                  1. Initial program 40.4%

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

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

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \left({\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re}\right)\right) \]
                    5. pow-lowering-pow.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right)\right) \]
                    6. unpow2N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right)\right) \]
                    7. unpow2N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right)\right) \]
                    8. hypot-defineN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right)\right) \]
                    9. hypot-lowering-hypot.f6488.6%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right)\right) \]
                  5. Simplified88.6%

                    \[\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}} \]

                  if -5.8000000000000001e31 < y.re < 8.99999999999999959e-7

                  1. Initial program 42.2%

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

                      \[\leadsto \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 \color{blue}{\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. associate-*l/N/A

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

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

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

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

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

                    \[\leadsto \color{blue}{\frac{\cos \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)}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}} \]
                  4. Add Preprocessing
                  5. Taylor expanded in y.re around 0

                    \[\leadsto \mathsf{/.f64}\left(\color{blue}{\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                  6. Step-by-step derivation
                    1. cos-lowering-cos.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\color{blue}{\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)}, \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                    2. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)}\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                    3. log-lowering-log.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), \color{blue}{y.im}\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                    4. unpow2N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                    5. unpow2N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                    6. hypot-defineN/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                    7. hypot-lowering-hypot.f6483.1%

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                  7. Simplified83.1%

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

                    \[\leadsto \mathsf{/.f64}\left(\color{blue}{1}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                  9. Step-by-step derivation
                    1. Simplified82.3%

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

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

                        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{exp.f64}\left(\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right) \]
                      2. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right) \]
                      3. atan2-lowering-atan2.f6481.3%

                        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right) \]
                    4. Simplified81.3%

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

                    if 8.99999999999999959e-7 < y.re

                    1. Initial program 44.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. exp-diffN/A

                        \[\leadsto \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 \color{blue}{\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. associate-*l/N/A

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

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

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

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

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

                      \[\leadsto \color{blue}{\frac{\cos \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)}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}} \]
                    4. Add Preprocessing
                    5. Taylor expanded in y.re around 0

                      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                    6. Step-by-step derivation
                      1. cos-lowering-cos.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\color{blue}{\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)}, \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                      2. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)}\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                      3. log-lowering-log.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), \color{blue}{y.im}\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                      4. unpow2N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                      5. unpow2N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                      6. hypot-defineN/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                      7. hypot-lowering-hypot.f6466.2%

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                    7. Simplified66.2%

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

                      \[\leadsto \mathsf{/.f64}\left(\color{blue}{1}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                    9. Step-by-step derivation
                      1. Simplified68.8%

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

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

                          \[\leadsto \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right) \]
                        2. +-commutativeN/A

                          \[\leadsto \mathsf{pow.f64}\left(\left(\sqrt{{x.re}^{2} + {x.im}^{2}}\right), y.re\right) \]
                        3. unpow2N/A

                          \[\leadsto \mathsf{pow.f64}\left(\left(\sqrt{x.re \cdot x.re + {x.im}^{2}}\right), y.re\right) \]
                        4. unpow2N/A

                          \[\leadsto \mathsf{pow.f64}\left(\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right), y.re\right) \]
                        5. hypot-defineN/A

                          \[\leadsto \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re\right) \]
                        6. hypot-lowering-hypot.f6476.3%

                          \[\leadsto \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right) \]
                      4. Simplified76.3%

                        \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}} \]
                    10. Recombined 3 regimes into one program.
                    11. Add Preprocessing

                    Alternative 6: 74.7% accurate, 3.8× speedup?

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

                      1. Initial program 34.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. exp-diffN/A

                          \[\leadsto \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 \color{blue}{\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. associate-*l/N/A

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

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

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

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

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

                        \[\leadsto \color{blue}{\frac{\cos \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)}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}} \]
                      4. Add Preprocessing
                      5. Taylor expanded in y.re around 0

                        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                      6. Step-by-step derivation
                        1. cos-lowering-cos.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\color{blue}{\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)}, \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                        2. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)}\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                        3. log-lowering-log.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), \color{blue}{y.im}\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                        4. unpow2N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                        5. unpow2N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                        6. hypot-defineN/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                        7. hypot-lowering-hypot.f6463.4%

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                      7. Simplified63.4%

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

                        \[\leadsto \mathsf{/.f64}\left(\color{blue}{1}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                      9. Step-by-step derivation
                        1. Simplified63.5%

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

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

                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{exp.f64}\left(\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right) \]
                          2. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right) \]
                          3. atan2-lowering-atan2.f6468.7%

                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right) \]
                        4. Simplified68.7%

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

                        if -2.45000000000000013e61 < y.im < 55000

                        1. Initial program 48.7%

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

                            \[\leadsto \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 \color{blue}{\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. associate-*l/N/A

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

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

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

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

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

                          \[\leadsto \color{blue}{\frac{\cos \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)}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}} \]
                        4. Add Preprocessing
                        5. Taylor expanded in y.re around 0

                          \[\leadsto \mathsf{/.f64}\left(\color{blue}{\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                        6. Step-by-step derivation
                          1. cos-lowering-cos.f64N/A

                            \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\color{blue}{\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)}, \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                          2. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)}\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                          3. log-lowering-log.f64N/A

                            \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), \color{blue}{y.im}\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                          4. unpow2N/A

                            \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                          5. unpow2N/A

                            \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                          6. hypot-defineN/A

                            \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                          7. hypot-lowering-hypot.f6489.2%

                            \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                        7. Simplified89.2%

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

                          \[\leadsto \mathsf{/.f64}\left(\color{blue}{1}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                        9. Step-by-step derivation
                          1. Simplified89.7%

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

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

                              \[\leadsto \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right) \]
                            2. +-commutativeN/A

                              \[\leadsto \mathsf{pow.f64}\left(\left(\sqrt{{x.re}^{2} + {x.im}^{2}}\right), y.re\right) \]
                            3. unpow2N/A

                              \[\leadsto \mathsf{pow.f64}\left(\left(\sqrt{x.re \cdot x.re + {x.im}^{2}}\right), y.re\right) \]
                            4. unpow2N/A

                              \[\leadsto \mathsf{pow.f64}\left(\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right), y.re\right) \]
                            5. hypot-defineN/A

                              \[\leadsto \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re\right) \]
                            6. hypot-lowering-hypot.f6490.2%

                              \[\leadsto \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right) \]
                          4. Simplified90.2%

                            \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}} \]
                        10. Recombined 2 regimes into one program.
                        11. Add Preprocessing

                        Alternative 7: 65.9% accurate, 3.9× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}\\ \mathbf{if}\;y.im \leq -4.6 \cdot 10^{+76}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.im \leq 8 \cdot 10^{-5}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                        (FPCore (x.re x.im y.re y.im)
                         :precision binary64
                         (let* ((t_0 (pow (+ (* x.re x.re) (* x.im x.im)) (/ y.re 2.0))))
                           (if (<= y.im -4.6e+76)
                             t_0
                             (if (<= y.im 8e-5) (pow (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 = pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0));
                        	double tmp;
                        	if (y_46_im <= -4.6e+76) {
                        		tmp = t_0;
                        	} else if (y_46_im <= 8e-5) {
                        		tmp = pow(hypot(x_46_re, x_46_im), y_46_re);
                        	} else {
                        		tmp = 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(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0));
                        	double tmp;
                        	if (y_46_im <= -4.6e+76) {
                        		tmp = t_0;
                        	} else if (y_46_im <= 8e-5) {
                        		tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
                        	} else {
                        		tmp = t_0;
                        	}
                        	return tmp;
                        }
                        
                        def code(x_46_re, x_46_im, y_46_re, y_46_im):
                        	t_0 = math.pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0))
                        	tmp = 0
                        	if y_46_im <= -4.6e+76:
                        		tmp = t_0
                        	elif y_46_im <= 8e-5:
                        		tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re)
                        	else:
                        		tmp = t_0
                        	return tmp
                        
                        function code(x_46_re, x_46_im, y_46_re, y_46_im)
                        	t_0 = Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)) ^ Float64(y_46_re / 2.0)
                        	tmp = 0.0
                        	if (y_46_im <= -4.6e+76)
                        		tmp = t_0;
                        	elseif (y_46_im <= 8e-5)
                        		tmp = hypot(x_46_re, x_46_im) ^ y_46_re;
                        	else
                        		tmp = t_0;
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                        	t_0 = ((x_46_re * x_46_re) + (x_46_im * x_46_im)) ^ (y_46_re / 2.0);
                        	tmp = 0.0;
                        	if (y_46_im <= -4.6e+76)
                        		tmp = t_0;
                        	elseif (y_46_im <= 8e-5)
                        		tmp = hypot(x_46_re, x_46_im) ^ y_46_re;
                        	else
                        		tmp = t_0;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -4.6e+76], t$95$0, If[LessEqual[y$46$im, 8e-5], N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision], t$95$0]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_0 := {\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}\\
                        \mathbf{if}\;y.im \leq -4.6 \cdot 10^{+76}:\\
                        \;\;\;\;t\_0\\
                        
                        \mathbf{elif}\;y.im \leq 8 \cdot 10^{-5}:\\
                        \;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;t\_0\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if y.im < -4.60000000000000002e76 or 8.00000000000000065e-5 < y.im

                          1. Initial program 33.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-diffN/A

                              \[\leadsto \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 \color{blue}{\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. associate-*l/N/A

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

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

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

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

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

                            \[\leadsto \color{blue}{\frac{\cos \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)}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}} \]
                          4. Add Preprocessing
                          5. Taylor expanded in y.re around 0

                            \[\leadsto \mathsf{/.f64}\left(\color{blue}{\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                          6. Step-by-step derivation
                            1. cos-lowering-cos.f64N/A

                              \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\color{blue}{\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)}, \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                            2. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)}\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                            3. log-lowering-log.f64N/A

                              \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), \color{blue}{y.im}\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                            4. unpow2N/A

                              \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                            5. unpow2N/A

                              \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                            6. hypot-defineN/A

                              \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                            7. hypot-lowering-hypot.f6463.8%

                              \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                          7. Simplified63.8%

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

                            \[\leadsto \mathsf{/.f64}\left(\color{blue}{1}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                          9. Step-by-step derivation
                            1. Simplified63.1%

                              \[\leadsto \frac{\color{blue}{1}}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}} \]
                            2. Step-by-step derivation
                              1. *-commutativeN/A

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

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

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

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

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

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \left({\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}\right)\right), \left(\mathsf{neg}\left(\color{blue}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\right)\right)\right) \]
                              7. sqrt-pow2N/A

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \left({\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
                              8. pow-lowering-pow.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\left(x.re \cdot x.re + x.im \cdot x.im\right), \left(\frac{y.re}{2}\right)\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
                              9. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\left(x.re \cdot x.re\right), \left(x.im \cdot x.im\right)\right), \left(\frac{y.re}{2}\right)\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
                              10. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \left(x.im \cdot x.im\right)\right), \left(\frac{y.re}{2}\right)\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
                              11. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \left(\frac{y.re}{2}\right)\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
                              12. /-lowering-/.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
                              13. neg-sub0N/A

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \left(0 - \color{blue}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\right)\right) \]
                              14. --lowering--.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)}\right)\right) \]
                              15. exp-lowering-exp.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{exp.f64}\left(\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right) \]
                              16. *-commutativeN/A

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{exp.f64}\left(\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)\right)\right) \]
                              17. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.im\right)\right)\right)\right) \]
                              18. atan2-lowering-atan2.f6451.3%

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)\right)\right) \]
                            3. Applied egg-rr51.3%

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

                              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{1}\right)\right) \]
                            5. Step-by-step derivation
                              1. Simplified44.3%

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

                              if -4.60000000000000002e76 < y.im < 8.00000000000000065e-5

                              1. Initial program 49.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. exp-diffN/A

                                  \[\leadsto \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 \color{blue}{\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. associate-*l/N/A

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

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

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

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

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

                                \[\leadsto \color{blue}{\frac{\cos \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)}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}} \]
                              4. Add Preprocessing
                              5. Taylor expanded in y.re around 0

                                \[\leadsto \mathsf{/.f64}\left(\color{blue}{\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                              6. Step-by-step derivation
                                1. cos-lowering-cos.f64N/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\color{blue}{\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)}, \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                                2. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)}\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                                3. log-lowering-log.f64N/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), \color{blue}{y.im}\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                                4. unpow2N/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                                5. unpow2N/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                                6. hypot-defineN/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                                7. hypot-lowering-hypot.f6488.1%

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                              7. Simplified88.1%

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

                                \[\leadsto \mathsf{/.f64}\left(\color{blue}{1}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                              9. Step-by-step derivation
                                1. Simplified89.3%

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

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

                                    \[\leadsto \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right) \]
                                  2. +-commutativeN/A

                                    \[\leadsto \mathsf{pow.f64}\left(\left(\sqrt{{x.re}^{2} + {x.im}^{2}}\right), y.re\right) \]
                                  3. unpow2N/A

                                    \[\leadsto \mathsf{pow.f64}\left(\left(\sqrt{x.re \cdot x.re + {x.im}^{2}}\right), y.re\right) \]
                                  4. unpow2N/A

                                    \[\leadsto \mathsf{pow.f64}\left(\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right), y.re\right) \]
                                  5. hypot-defineN/A

                                    \[\leadsto \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re\right) \]
                                  6. hypot-lowering-hypot.f6487.0%

                                    \[\leadsto \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right) \]
                                4. Simplified87.0%

                                  \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}} \]
                              10. Recombined 2 regimes into one program.
                              11. Final simplification68.0%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -4.6 \cdot 10^{+76}:\\ \;\;\;\;{\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}\\ \mathbf{elif}\;y.im \leq 8 \cdot 10^{-5}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;{\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}\\ \end{array} \]
                              12. Add Preprocessing

                              Alternative 8: 60.1% accurate, 6.9× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}\\ \mathbf{if}\;y.re \leq -7.5 \cdot 10^{-136}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 2.2 \cdot 10^{-102}:\\ \;\;\;\;1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                              (FPCore (x.re x.im y.re y.im)
                               :precision binary64
                               (let* ((t_0 (pow (+ (* x.re x.re) (* x.im x.im)) (/ y.re 2.0))))
                                 (if (<= y.re -7.5e-136)
                                   t_0
                                   (if (<= y.re 2.2e-102) (- 1.0 (* y.im (atan2 x.im x.re))) t_0))))
                              double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                              	double t_0 = pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0));
                              	double tmp;
                              	if (y_46_re <= -7.5e-136) {
                              		tmp = t_0;
                              	} else if (y_46_re <= 2.2e-102) {
                              		tmp = 1.0 - (y_46_im * atan2(x_46_im, x_46_re));
                              	} else {
                              		tmp = t_0;
                              	}
                              	return tmp;
                              }
                              
                              real(8) function code(x_46re, x_46im, y_46re, y_46im)
                                  real(8), intent (in) :: x_46re
                                  real(8), intent (in) :: x_46im
                                  real(8), intent (in) :: y_46re
                                  real(8), intent (in) :: y_46im
                                  real(8) :: t_0
                                  real(8) :: tmp
                                  t_0 = ((x_46re * x_46re) + (x_46im * x_46im)) ** (y_46re / 2.0d0)
                                  if (y_46re <= (-7.5d-136)) then
                                      tmp = t_0
                                  else if (y_46re <= 2.2d-102) then
                                      tmp = 1.0d0 - (y_46im * atan2(x_46im, x_46re))
                                  else
                                      tmp = t_0
                                  end if
                                  code = tmp
                              end function
                              
                              public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                              	double t_0 = Math.pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0));
                              	double tmp;
                              	if (y_46_re <= -7.5e-136) {
                              		tmp = t_0;
                              	} else if (y_46_re <= 2.2e-102) {
                              		tmp = 1.0 - (y_46_im * Math.atan2(x_46_im, x_46_re));
                              	} else {
                              		tmp = t_0;
                              	}
                              	return tmp;
                              }
                              
                              def code(x_46_re, x_46_im, y_46_re, y_46_im):
                              	t_0 = math.pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0))
                              	tmp = 0
                              	if y_46_re <= -7.5e-136:
                              		tmp = t_0
                              	elif y_46_re <= 2.2e-102:
                              		tmp = 1.0 - (y_46_im * math.atan2(x_46_im, x_46_re))
                              	else:
                              		tmp = t_0
                              	return tmp
                              
                              function code(x_46_re, x_46_im, y_46_re, y_46_im)
                              	t_0 = Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)) ^ Float64(y_46_re / 2.0)
                              	tmp = 0.0
                              	if (y_46_re <= -7.5e-136)
                              		tmp = t_0;
                              	elseif (y_46_re <= 2.2e-102)
                              		tmp = Float64(1.0 - Float64(y_46_im * atan(x_46_im, x_46_re)));
                              	else
                              		tmp = t_0;
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                              	t_0 = ((x_46_re * x_46_re) + (x_46_im * x_46_im)) ^ (y_46_re / 2.0);
                              	tmp = 0.0;
                              	if (y_46_re <= -7.5e-136)
                              		tmp = t_0;
                              	elseif (y_46_re <= 2.2e-102)
                              		tmp = 1.0 - (y_46_im * atan2(x_46_im, x_46_re));
                              	else
                              		tmp = t_0;
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -7.5e-136], t$95$0, If[LessEqual[y$46$re, 2.2e-102], N[(1.0 - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              t_0 := {\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}\\
                              \mathbf{if}\;y.re \leq -7.5 \cdot 10^{-136}:\\
                              \;\;\;\;t\_0\\
                              
                              \mathbf{elif}\;y.re \leq 2.2 \cdot 10^{-102}:\\
                              \;\;\;\;1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;t\_0\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if y.re < -7.5000000000000003e-136 or 2.20000000000000013e-102 < y.re

                                1. Initial program 40.7%

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

                                    \[\leadsto \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 \color{blue}{\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. associate-*l/N/A

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

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

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

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

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

                                  \[\leadsto \color{blue}{\frac{\cos \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)}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}} \]
                                4. Add Preprocessing
                                5. Taylor expanded in y.re around 0

                                  \[\leadsto \mathsf{/.f64}\left(\color{blue}{\cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                                6. Step-by-step derivation
                                  1. cos-lowering-cos.f64N/A

                                    \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\color{blue}{\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)}, \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                                  2. *-lowering-*.f64N/A

                                    \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)}\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                                  3. log-lowering-log.f64N/A

                                    \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), \color{blue}{y.im}\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                                  4. unpow2N/A

                                    \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                                  5. unpow2N/A

                                    \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                                  6. hypot-defineN/A

                                    \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                                  7. hypot-lowering-hypot.f6475.3%

                                    \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                                7. Simplified75.3%

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

                                  \[\leadsto \mathsf{/.f64}\left(\color{blue}{1}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
                                9. Step-by-step derivation
                                  1. Simplified75.2%

                                    \[\leadsto \frac{\color{blue}{1}}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}} \]
                                  2. Step-by-step derivation
                                    1. *-commutativeN/A

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

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

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

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

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

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \left({\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}\right)\right), \left(\mathsf{neg}\left(\color{blue}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\right)\right)\right) \]
                                    7. sqrt-pow2N/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \left({\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
                                    8. pow-lowering-pow.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\left(x.re \cdot x.re + x.im \cdot x.im\right), \left(\frac{y.re}{2}\right)\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
                                    9. +-lowering-+.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\left(x.re \cdot x.re\right), \left(x.im \cdot x.im\right)\right), \left(\frac{y.re}{2}\right)\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
                                    10. *-lowering-*.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \left(x.im \cdot x.im\right)\right), \left(\frac{y.re}{2}\right)\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
                                    11. *-lowering-*.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \left(\frac{y.re}{2}\right)\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
                                    12. /-lowering-/.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \left(\mathsf{neg}\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\right) \]
                                    13. neg-sub0N/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \left(0 - \color{blue}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\right)\right) \]
                                    14. --lowering--.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\left(e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)}\right)\right) \]
                                    15. exp-lowering-exp.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{exp.f64}\left(\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right) \]
                                    16. *-commutativeN/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{exp.f64}\left(\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)\right)\right) \]
                                    17. *-lowering-*.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.im\right)\right)\right)\right) \]
                                    18. atan2-lowering-atan2.f6464.5%

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)\right)\right) \]
                                  3. Applied egg-rr64.5%

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

                                    \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{1}\right)\right) \]
                                  5. Step-by-step derivation
                                    1. Simplified70.5%

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

                                    if -7.5000000000000003e-136 < y.re < 2.20000000000000013e-102

                                    1. Initial program 45.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(x.re\right)\right)\right), \mathsf{exp.f64}\left(\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right) \]
                                      6. *-lowering-*.f64N/A

                                        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(x.re\right)\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right) \]
                                      7. atan2-lowering-atan2.f6445.3%

                                        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(x.re\right)\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right) \]
                                    8. Simplified45.3%

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

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

                                        \[\leadsto 1 + \left(\mathsf{neg}\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
                                      2. unsub-negN/A

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

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

                                        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(y.im, \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right)\right) \]
                                      5. atan2-lowering-atan2.f6445.7%

                                        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(y.im, \mathsf{atan2.f64}\left(x.im, \color{blue}{x.re}\right)\right)\right) \]
                                    11. Simplified45.7%

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

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -7.5 \cdot 10^{-136}:\\ \;\;\;\;{\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}\\ \mathbf{elif}\;y.re \leq 2.2 \cdot 10^{-102}:\\ \;\;\;\;1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{else}:\\ \;\;\;\;{\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}\\ \end{array} \]
                                  8. Add Preprocessing

                                  Alternative 9: 31.4% accurate, 7.0× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq 2.15 \cdot 10^{-102}:\\ \;\;\;\;1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{else}:\\ \;\;\;\;1 + y.re \cdot \left(\log \left(x.re \cdot x.re + x.im \cdot x.im\right) \cdot 0.5\right)\\ \end{array} \end{array} \]
                                  (FPCore (x.re x.im y.re y.im)
                                   :precision binary64
                                   (if (<= y.re 2.15e-102)
                                     (- 1.0 (* y.im (atan2 x.im x.re)))
                                     (+ 1.0 (* y.re (* (log (+ (* x.re x.re) (* x.im x.im))) 0.5)))))
                                  double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                  	double tmp;
                                  	if (y_46_re <= 2.15e-102) {
                                  		tmp = 1.0 - (y_46_im * atan2(x_46_im, x_46_re));
                                  	} else {
                                  		tmp = 1.0 + (y_46_re * (log(((x_46_re * x_46_re) + (x_46_im * x_46_im))) * 0.5));
                                  	}
                                  	return tmp;
                                  }
                                  
                                  real(8) function code(x_46re, x_46im, y_46re, y_46im)
                                      real(8), intent (in) :: x_46re
                                      real(8), intent (in) :: x_46im
                                      real(8), intent (in) :: y_46re
                                      real(8), intent (in) :: y_46im
                                      real(8) :: tmp
                                      if (y_46re <= 2.15d-102) then
                                          tmp = 1.0d0 - (y_46im * atan2(x_46im, x_46re))
                                      else
                                          tmp = 1.0d0 + (y_46re * (log(((x_46re * x_46re) + (x_46im * x_46im))) * 0.5d0))
                                      end if
                                      code = tmp
                                  end function
                                  
                                  public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                  	double tmp;
                                  	if (y_46_re <= 2.15e-102) {
                                  		tmp = 1.0 - (y_46_im * Math.atan2(x_46_im, x_46_re));
                                  	} else {
                                  		tmp = 1.0 + (y_46_re * (Math.log(((x_46_re * x_46_re) + (x_46_im * x_46_im))) * 0.5));
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                  	tmp = 0
                                  	if y_46_re <= 2.15e-102:
                                  		tmp = 1.0 - (y_46_im * math.atan2(x_46_im, x_46_re))
                                  	else:
                                  		tmp = 1.0 + (y_46_re * (math.log(((x_46_re * x_46_re) + (x_46_im * x_46_im))) * 0.5))
                                  	return tmp
                                  
                                  function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                  	tmp = 0.0
                                  	if (y_46_re <= 2.15e-102)
                                  		tmp = Float64(1.0 - Float64(y_46_im * atan(x_46_im, x_46_re)));
                                  	else
                                  		tmp = Float64(1.0 + Float64(y_46_re * Float64(log(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))) * 0.5)));
                                  	end
                                  	return tmp
                                  end
                                  
                                  function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                  	tmp = 0.0;
                                  	if (y_46_re <= 2.15e-102)
                                  		tmp = 1.0 - (y_46_im * atan2(x_46_im, x_46_re));
                                  	else
                                  		tmp = 1.0 + (y_46_re * (log(((x_46_re * x_46_re) + (x_46_im * x_46_im))) * 0.5));
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 2.15e-102], N[(1.0 - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y$46$re * N[(N[Log[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;y.re \leq 2.15 \cdot 10^{-102}:\\
                                  \;\;\;\;1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;1 + y.re \cdot \left(\log \left(x.re \cdot x.re + x.im \cdot x.im\right) \cdot 0.5\right)\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if y.re < 2.1499999999999999e-102

                                    1. Initial program 41.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(x.re\right)\right)\right), \mathsf{exp.f64}\left(\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right) \]
                                      6. *-lowering-*.f64N/A

                                        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(x.re\right)\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right) \]
                                      7. atan2-lowering-atan2.f6435.4%

                                        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(x.re\right)\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right) \]
                                    8. Simplified35.4%

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

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

                                        \[\leadsto 1 + \left(\mathsf{neg}\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
                                      2. unsub-negN/A

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

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

                                        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(y.im, \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right)\right) \]
                                      5. atan2-lowering-atan2.f6429.5%

                                        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(y.im, \mathsf{atan2.f64}\left(x.im, \color{blue}{x.re}\right)\right)\right) \]
                                    11. Simplified29.5%

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

                                    if 2.1499999999999999e-102 < y.re

                                    1. Initial program 44.2%

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

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

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

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

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

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \left({\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re}\right)\right) \]
                                      5. pow-lowering-pow.f64N/A

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right)\right) \]
                                      6. unpow2N/A

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right)\right) \]
                                      7. unpow2N/A

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right)\right) \]
                                      8. hypot-defineN/A

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right)\right) \]
                                      9. hypot-lowering-hypot.f6454.1%

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right)\right) \]
                                    5. Simplified54.1%

                                      \[\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}} \]
                                    6. Taylor expanded in y.re around 0

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

                                        \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(y.re \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)}\right) \]
                                      2. *-lowering-*.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}\right)\right) \]
                                      3. log-lowering-log.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right) \]
                                      4. sqrt-lowering-sqrt.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\left({x.im}^{2} + {x.re}^{2}\right)\right)\right)\right)\right) \]
                                      5. +-lowering-+.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left({x.im}^{2}\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
                                      6. unpow2N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x.im \cdot x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
                                      7. *-lowering-*.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
                                      8. unpow2N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left(x.re \cdot x.re\right)\right)\right)\right)\right)\right) \]
                                      9. *-lowering-*.f6433.8%

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right)\right)\right)\right)\right) \]
                                    8. Simplified33.8%

                                      \[\leadsto \color{blue}{1 + y.re \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)} \]
                                    9. Step-by-step derivation
                                      1. +-commutativeN/A

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

                                        \[\leadsto \mathsf{+.f64}\left(\left(y.re \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right), \color{blue}{1}\right) \]
                                      3. *-lowering-*.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right), 1\right) \]
                                      4. pow1/2N/A

                                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(y.re, \log \left({\left(x.im \cdot x.im + x.re \cdot x.re\right)}^{\frac{1}{2}}\right)\right), 1\right) \]
                                      5. +-commutativeN/A

                                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(y.re, \log \left({\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\frac{1}{2}}\right)\right), 1\right) \]
                                      6. pow-to-expN/A

                                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(y.re, \log \left(e^{\log \left(x.re \cdot x.re + x.im \cdot x.im\right) \cdot \frac{1}{2}}\right)\right), 1\right) \]
                                      7. rem-log-expN/A

                                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(y.re, \left(\log \left(x.re \cdot x.re + x.im \cdot x.im\right) \cdot \frac{1}{2}\right)\right), 1\right) \]
                                      8. *-lowering-*.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{*.f64}\left(\log \left(x.re \cdot x.re + x.im \cdot x.im\right), \frac{1}{2}\right)\right), 1\right) \]
                                      9. log-lowering-log.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(x.re \cdot x.re + x.im \cdot x.im\right)\right), \frac{1}{2}\right)\right), 1\right) \]
                                      10. +-lowering-+.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\left(x.re \cdot x.re\right), \left(x.im \cdot x.im\right)\right)\right), \frac{1}{2}\right)\right), 1\right) \]
                                      11. *-lowering-*.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \left(x.im \cdot x.im\right)\right)\right), \frac{1}{2}\right)\right), 1\right) \]
                                      12. *-lowering-*.f6433.8%

                                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right), \frac{1}{2}\right)\right), 1\right) \]
                                    10. Applied egg-rr33.8%

                                      \[\leadsto \color{blue}{y.re \cdot \left(\log \left(x.re \cdot x.re + x.im \cdot x.im\right) \cdot 0.5\right) + 1} \]
                                  3. Recombined 2 regimes into one program.
                                  4. Final simplification31.0%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq 2.15 \cdot 10^{-102}:\\ \;\;\;\;1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{else}:\\ \;\;\;\;1 + y.re \cdot \left(\log \left(x.re \cdot x.re + x.im \cdot x.im\right) \cdot 0.5\right)\\ \end{array} \]
                                  5. Add Preprocessing

                                  Alternative 10: 27.7% accurate, 7.0× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq 1.8 \cdot 10^{-23}:\\ \;\;\;\;1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{else}:\\ \;\;\;\;1 + y.re \cdot \log \left(x.re + \frac{\left(x.im \cdot x.im\right) \cdot 0.5}{x.re}\right)\\ \end{array} \end{array} \]
                                  (FPCore (x.re x.im y.re y.im)
                                   :precision binary64
                                   (if (<= y.re 1.8e-23)
                                     (- 1.0 (* y.im (atan2 x.im x.re)))
                                     (+ 1.0 (* y.re (log (+ x.re (/ (* (* x.im x.im) 0.5) x.re)))))))
                                  double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                  	double tmp;
                                  	if (y_46_re <= 1.8e-23) {
                                  		tmp = 1.0 - (y_46_im * atan2(x_46_im, x_46_re));
                                  	} else {
                                  		tmp = 1.0 + (y_46_re * log((x_46_re + (((x_46_im * x_46_im) * 0.5) / x_46_re))));
                                  	}
                                  	return tmp;
                                  }
                                  
                                  real(8) function code(x_46re, x_46im, y_46re, y_46im)
                                      real(8), intent (in) :: x_46re
                                      real(8), intent (in) :: x_46im
                                      real(8), intent (in) :: y_46re
                                      real(8), intent (in) :: y_46im
                                      real(8) :: tmp
                                      if (y_46re <= 1.8d-23) then
                                          tmp = 1.0d0 - (y_46im * atan2(x_46im, x_46re))
                                      else
                                          tmp = 1.0d0 + (y_46re * log((x_46re + (((x_46im * x_46im) * 0.5d0) / x_46re))))
                                      end if
                                      code = tmp
                                  end function
                                  
                                  public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                  	double tmp;
                                  	if (y_46_re <= 1.8e-23) {
                                  		tmp = 1.0 - (y_46_im * Math.atan2(x_46_im, x_46_re));
                                  	} else {
                                  		tmp = 1.0 + (y_46_re * Math.log((x_46_re + (((x_46_im * x_46_im) * 0.5) / x_46_re))));
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                  	tmp = 0
                                  	if y_46_re <= 1.8e-23:
                                  		tmp = 1.0 - (y_46_im * math.atan2(x_46_im, x_46_re))
                                  	else:
                                  		tmp = 1.0 + (y_46_re * math.log((x_46_re + (((x_46_im * x_46_im) * 0.5) / x_46_re))))
                                  	return tmp
                                  
                                  function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                  	tmp = 0.0
                                  	if (y_46_re <= 1.8e-23)
                                  		tmp = Float64(1.0 - Float64(y_46_im * atan(x_46_im, x_46_re)));
                                  	else
                                  		tmp = Float64(1.0 + Float64(y_46_re * log(Float64(x_46_re + Float64(Float64(Float64(x_46_im * x_46_im) * 0.5) / x_46_re)))));
                                  	end
                                  	return tmp
                                  end
                                  
                                  function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                  	tmp = 0.0;
                                  	if (y_46_re <= 1.8e-23)
                                  		tmp = 1.0 - (y_46_im * atan2(x_46_im, x_46_re));
                                  	else
                                  		tmp = 1.0 + (y_46_re * log((x_46_re + (((x_46_im * x_46_im) * 0.5) / x_46_re))));
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 1.8e-23], N[(1.0 - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y$46$re * N[Log[N[(x$46$re + N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] * 0.5), $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;y.re \leq 1.8 \cdot 10^{-23}:\\
                                  \;\;\;\;1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;1 + y.re \cdot \log \left(x.re + \frac{\left(x.im \cdot x.im\right) \cdot 0.5}{x.re}\right)\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if y.re < 1.7999999999999999e-23

                                    1. Initial program 41.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(x.re\right)\right)\right), \mathsf{exp.f64}\left(\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right) \]
                                      6. *-lowering-*.f64N/A

                                        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(x.re\right)\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right) \]
                                      7. atan2-lowering-atan2.f6435.2%

                                        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(x.re\right)\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right) \]
                                    8. Simplified35.2%

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

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

                                        \[\leadsto 1 + \left(\mathsf{neg}\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
                                      2. unsub-negN/A

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

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

                                        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(y.im, \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right)\right) \]
                                      5. atan2-lowering-atan2.f6430.6%

                                        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(y.im, \mathsf{atan2.f64}\left(x.im, \color{blue}{x.re}\right)\right)\right) \]
                                    11. Simplified30.6%

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

                                    if 1.7999999999999999e-23 < y.re

                                    1. Initial program 44.3%

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

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

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

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

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

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \left({\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re}\right)\right) \]
                                      5. pow-lowering-pow.f64N/A

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right)\right) \]
                                      6. unpow2N/A

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right)\right) \]
                                      7. unpow2N/A

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right)\right) \]
                                      8. hypot-defineN/A

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right)\right) \]
                                      9. hypot-lowering-hypot.f6458.5%

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right)\right) \]
                                    5. Simplified58.5%

                                      \[\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}} \]
                                    6. Taylor expanded in y.re around 0

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

                                        \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(y.re \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)}\right) \]
                                      2. *-lowering-*.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}\right)\right) \]
                                      3. log-lowering-log.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right) \]
                                      4. sqrt-lowering-sqrt.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\left({x.im}^{2} + {x.re}^{2}\right)\right)\right)\right)\right) \]
                                      5. +-lowering-+.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left({x.im}^{2}\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
                                      6. unpow2N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x.im \cdot x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
                                      7. *-lowering-*.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
                                      8. unpow2N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left(x.re \cdot x.re\right)\right)\right)\right)\right)\right) \]
                                      9. *-lowering-*.f6430.9%

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right)\right)\right)\right)\right) \]
                                    8. Simplified30.9%

                                      \[\leadsto \color{blue}{1 + y.re \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)} \]
                                    9. Taylor expanded in x.im around 0

                                      \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\color{blue}{\left(x.re + \frac{1}{2} \cdot \frac{{x.im}^{2}}{x.re}\right)}\right)\right)\right) \]
                                    10. Step-by-step derivation
                                      1. +-lowering-+.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{+.f64}\left(x.re, \left(\frac{1}{2} \cdot \frac{{x.im}^{2}}{x.re}\right)\right)\right)\right)\right) \]
                                      2. associate-*r/N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{+.f64}\left(x.re, \left(\frac{\frac{1}{2} \cdot {x.im}^{2}}{x.re}\right)\right)\right)\right)\right) \]
                                      3. /-lowering-/.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{+.f64}\left(x.re, \mathsf{/.f64}\left(\left(\frac{1}{2} \cdot {x.im}^{2}\right), x.re\right)\right)\right)\right)\right) \]
                                      4. *-lowering-*.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{+.f64}\left(x.re, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left({x.im}^{2}\right)\right), x.re\right)\right)\right)\right)\right) \]
                                      5. unpow2N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{+.f64}\left(x.re, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(x.im \cdot x.im\right)\right), x.re\right)\right)\right)\right)\right) \]
                                      6. *-lowering-*.f6418.5%

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{+.f64}\left(x.re, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x.im, x.im\right)\right), x.re\right)\right)\right)\right)\right) \]
                                    11. Simplified18.5%

                                      \[\leadsto 1 + y.re \cdot \log \color{blue}{\left(x.re + \frac{0.5 \cdot \left(x.im \cdot x.im\right)}{x.re}\right)} \]
                                  3. Recombined 2 regimes into one program.
                                  4. Final simplification27.3%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq 1.8 \cdot 10^{-23}:\\ \;\;\;\;1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{else}:\\ \;\;\;\;1 + y.re \cdot \log \left(x.re + \frac{\left(x.im \cdot x.im\right) \cdot 0.5}{x.re}\right)\\ \end{array} \]
                                  5. Add Preprocessing

                                  Alternative 11: 27.5% accurate, 7.0× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq 2.6 \cdot 10^{+82}:\\ \;\;\;\;1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{else}:\\ \;\;\;\;1 + y.re \cdot \log \left(x.im + \frac{\left(x.re \cdot x.re\right) \cdot 0.5}{x.im}\right)\\ \end{array} \end{array} \]
                                  (FPCore (x.re x.im y.re y.im)
                                   :precision binary64
                                   (if (<= y.re 2.6e+82)
                                     (- 1.0 (* y.im (atan2 x.im x.re)))
                                     (+ 1.0 (* y.re (log (+ x.im (/ (* (* x.re x.re) 0.5) x.im)))))))
                                  double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                  	double tmp;
                                  	if (y_46_re <= 2.6e+82) {
                                  		tmp = 1.0 - (y_46_im * atan2(x_46_im, x_46_re));
                                  	} else {
                                  		tmp = 1.0 + (y_46_re * log((x_46_im + (((x_46_re * x_46_re) * 0.5) / x_46_im))));
                                  	}
                                  	return tmp;
                                  }
                                  
                                  real(8) function code(x_46re, x_46im, y_46re, y_46im)
                                      real(8), intent (in) :: x_46re
                                      real(8), intent (in) :: x_46im
                                      real(8), intent (in) :: y_46re
                                      real(8), intent (in) :: y_46im
                                      real(8) :: tmp
                                      if (y_46re <= 2.6d+82) then
                                          tmp = 1.0d0 - (y_46im * atan2(x_46im, x_46re))
                                      else
                                          tmp = 1.0d0 + (y_46re * log((x_46im + (((x_46re * x_46re) * 0.5d0) / x_46im))))
                                      end if
                                      code = tmp
                                  end function
                                  
                                  public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                  	double tmp;
                                  	if (y_46_re <= 2.6e+82) {
                                  		tmp = 1.0 - (y_46_im * Math.atan2(x_46_im, x_46_re));
                                  	} else {
                                  		tmp = 1.0 + (y_46_re * Math.log((x_46_im + (((x_46_re * x_46_re) * 0.5) / x_46_im))));
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                  	tmp = 0
                                  	if y_46_re <= 2.6e+82:
                                  		tmp = 1.0 - (y_46_im * math.atan2(x_46_im, x_46_re))
                                  	else:
                                  		tmp = 1.0 + (y_46_re * math.log((x_46_im + (((x_46_re * x_46_re) * 0.5) / x_46_im))))
                                  	return tmp
                                  
                                  function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                  	tmp = 0.0
                                  	if (y_46_re <= 2.6e+82)
                                  		tmp = Float64(1.0 - Float64(y_46_im * atan(x_46_im, x_46_re)));
                                  	else
                                  		tmp = Float64(1.0 + Float64(y_46_re * log(Float64(x_46_im + Float64(Float64(Float64(x_46_re * x_46_re) * 0.5) / x_46_im)))));
                                  	end
                                  	return tmp
                                  end
                                  
                                  function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                  	tmp = 0.0;
                                  	if (y_46_re <= 2.6e+82)
                                  		tmp = 1.0 - (y_46_im * atan2(x_46_im, x_46_re));
                                  	else
                                  		tmp = 1.0 + (y_46_re * log((x_46_im + (((x_46_re * x_46_re) * 0.5) / x_46_im))));
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 2.6e+82], N[(1.0 - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y$46$re * N[Log[N[(x$46$im + N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] * 0.5), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;y.re \leq 2.6 \cdot 10^{+82}:\\
                                  \;\;\;\;1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;1 + y.re \cdot \log \left(x.im + \frac{\left(x.re \cdot x.re\right) \cdot 0.5}{x.im}\right)\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if y.re < 2.5999999999999998e82

                                    1. Initial program 41.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(x.re\right)\right)\right), \mathsf{exp.f64}\left(\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right) \]
                                      6. *-lowering-*.f64N/A

                                        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(x.re\right)\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right) \]
                                      7. atan2-lowering-atan2.f6433.2%

                                        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(x.re\right)\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right) \]
                                    8. Simplified33.2%

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

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

                                        \[\leadsto 1 + \left(\mathsf{neg}\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
                                      2. unsub-negN/A

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

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

                                        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(y.im, \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right)\right) \]
                                      5. atan2-lowering-atan2.f6428.2%

                                        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(y.im, \mathsf{atan2.f64}\left(x.im, \color{blue}{x.re}\right)\right)\right) \]
                                    11. Simplified28.2%

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

                                    if 2.5999999999999998e82 < y.re

                                    1. Initial program 45.8%

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

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

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

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

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

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \left({\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re}\right)\right) \]
                                      5. pow-lowering-pow.f64N/A

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right)\right) \]
                                      6. unpow2N/A

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right)\right) \]
                                      7. unpow2N/A

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right)\right) \]
                                      8. hypot-defineN/A

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right)\right) \]
                                      9. hypot-lowering-hypot.f6458.4%

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right)\right) \]
                                    5. Simplified58.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}} \]
                                    6. Taylor expanded in y.re around 0

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

                                        \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(y.re \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)}\right) \]
                                      2. *-lowering-*.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}\right)\right) \]
                                      3. log-lowering-log.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right) \]
                                      4. sqrt-lowering-sqrt.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\left({x.im}^{2} + {x.re}^{2}\right)\right)\right)\right)\right) \]
                                      5. +-lowering-+.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left({x.im}^{2}\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
                                      6. unpow2N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x.im \cdot x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
                                      7. *-lowering-*.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
                                      8. unpow2N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left(x.re \cdot x.re\right)\right)\right)\right)\right)\right) \]
                                      9. *-lowering-*.f6427.6%

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right)\right)\right)\right)\right) \]
                                    8. Simplified27.6%

                                      \[\leadsto \color{blue}{1 + y.re \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)} \]
                                    9. Taylor expanded in x.re around 0

                                      \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\color{blue}{\left(x.im + \frac{1}{2} \cdot \frac{{x.re}^{2}}{x.im}\right)}\right)\right)\right) \]
                                    10. Step-by-step derivation
                                      1. +-lowering-+.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{+.f64}\left(x.im, \left(\frac{1}{2} \cdot \frac{{x.re}^{2}}{x.im}\right)\right)\right)\right)\right) \]
                                      2. associate-*r/N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{+.f64}\left(x.im, \left(\frac{\frac{1}{2} \cdot {x.re}^{2}}{x.im}\right)\right)\right)\right)\right) \]
                                      3. /-lowering-/.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{+.f64}\left(x.im, \mathsf{/.f64}\left(\left(\frac{1}{2} \cdot {x.re}^{2}\right), x.im\right)\right)\right)\right)\right) \]
                                      4. *-lowering-*.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{+.f64}\left(x.im, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left({x.re}^{2}\right)\right), x.im\right)\right)\right)\right)\right) \]
                                      5. unpow2N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{+.f64}\left(x.im, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(x.re \cdot x.re\right)\right), x.im\right)\right)\right)\right)\right) \]
                                      6. *-lowering-*.f6412.3%

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y.re, \mathsf{log.f64}\left(\mathsf{+.f64}\left(x.im, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x.re, x.re\right)\right), x.im\right)\right)\right)\right)\right) \]
                                    11. Simplified12.3%

                                      \[\leadsto 1 + y.re \cdot \log \color{blue}{\left(x.im + \frac{0.5 \cdot \left(x.re \cdot x.re\right)}{x.im}\right)} \]
                                  3. Recombined 2 regimes into one program.
                                  4. Final simplification25.2%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq 2.6 \cdot 10^{+82}:\\ \;\;\;\;1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{else}:\\ \;\;\;\;1 + y.re \cdot \log \left(x.im + \frac{\left(x.re \cdot x.re\right) \cdot 0.5}{x.im}\right)\\ \end{array} \]
                                  5. Add Preprocessing

                                  Alternative 12: 25.8% accurate, 7.8× speedup?

                                  \[\begin{array}{l} \\ 1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re} \end{array} \]
                                  (FPCore (x.re x.im y.re y.im)
                                   :precision binary64
                                   (- 1.0 (* y.im (atan2 x.im x.re))))
                                  double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                  	return 1.0 - (y_46_im * atan2(x_46_im, x_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
                                      code = 1.0d0 - (y_46im * atan2(x_46im, x_46re))
                                  end function
                                  
                                  public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                  	return 1.0 - (y_46_im * Math.atan2(x_46_im, x_46_re));
                                  }
                                  
                                  def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                  	return 1.0 - (y_46_im * math.atan2(x_46_im, x_46_re))
                                  
                                  function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                  	return Float64(1.0 - Float64(y_46_im * atan(x_46_im, x_46_re)))
                                  end
                                  
                                  function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                  	tmp = 1.0 - (y_46_im * atan2(x_46_im, x_46_re));
                                  end
                                  
                                  code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}
                                  \end{array}
                                  
                                  Derivation
                                  1. Initial program 42.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(x.re\right)\right)\right), \mathsf{exp.f64}\left(\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right) \]
                                    6. *-lowering-*.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(x.re\right)\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right) \]
                                    7. atan2-lowering-atan2.f6428.3%

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(x.re\right)\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right) \]
                                  8. Simplified28.3%

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

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

                                      \[\leadsto 1 + \left(\mathsf{neg}\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
                                    2. unsub-negN/A

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

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

                                      \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(y.im, \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right)\right) \]
                                    5. atan2-lowering-atan2.f6423.4%

                                      \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(y.im, \mathsf{atan2.f64}\left(x.im, \color{blue}{x.re}\right)\right)\right) \]
                                  11. Simplified23.4%

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

                                  Alternative 13: 25.7% accurate, 829.0× speedup?

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

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

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

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

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

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

                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \left({\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re}\right)\right) \]
                                    5. pow-lowering-pow.f64N/A

                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right)\right) \]
                                    6. unpow2N/A

                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right)\right) \]
                                    7. unpow2N/A

                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right)\right) \]
                                    8. hypot-defineN/A

                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right)\right) \]
                                    9. hypot-lowering-hypot.f6456.7%

                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right)\right) \]
                                  5. Simplified56.7%

                                    \[\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}} \]
                                  6. Taylor expanded in y.re around 0

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

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

                                    Reproduce

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