powComplex, real part

Percentage Accurate: 41.1% → 79.1%
Time: 23.5s
Alternatives: 11
Speedup: 2.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 41.1% 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: 79.1% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y.re \leq 1.3 \cdot 10^{+20}:\\
\;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_2\\

\mathbf{elif}\;y.re \leq 10^{+188}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left|\cos \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_0\right)\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y.re < -2.40000000000000015e-59

    1. Initial program 38.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. cancel-sign-sub-inv38.2%

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

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

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

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

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

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

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

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

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

    if -2.40000000000000015e-59 < y.re < 1.3e20

    1. Initial program 34.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-diff34.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3e20 < y.re < 1e188

    1. Initial program 45.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e188 < y.re

    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. Step-by-step derivation
      1. exp-diff34.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -2.4 \cdot 10^{-59}:\\ \;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\ \mathbf{elif}\;y.re \leq 1.3 \cdot 10^{+20}:\\ \;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left({\left(\sqrt[3]{\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\right)}^{3}\right)\\ \mathbf{elif}\;y.re \leq 10^{+188}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left|\cos \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\cos \left({\left(\sqrt[3]{\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\right)}^{3}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 78.8% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;y.re \leq 1.3 \cdot 10^{+20}:\\
\;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left({\left(\sqrt[3]{\mathsf{fma}\left(y.im, t\_1, t\_0\right)}\right)}^{3}\right)\\

\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(\cos t\_2 - t\_0 \cdot \sin t\_2\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y.re < -1.8e-60

    1. Initial program 38.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. cancel-sign-sub-inv38.2%

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

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

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

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

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

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

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

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

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

    if -1.8e-60 < y.re < 1.3e20

    1. Initial program 34.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-diff34.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3e20 < y.re

    1. Initial program 43.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -1.8 \cdot 10^{-60}:\\ \;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\ \mathbf{elif}\;y.re \leq 1.3 \cdot 10^{+20}:\\ \;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left({\left(\sqrt[3]{\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\right)}^{3}\right)\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) - \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 79.2% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y.re \leq 1.3 \cdot 10^{+20}:\\
\;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left({\left(\sqrt[3]{\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), t\_0\right)}\right)}^{3}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y.re < -3.40000000000000006e-6

    1. Initial program 39.4%

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

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

    if -3.40000000000000006e-6 < y.re < 1.3e20

    1. Initial program 34.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-diff34.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3e20 < y.re

    1. Initial program 43.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 80.0% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y.re \leq 1.3 \cdot 10^{+20}:\\
\;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left({\left(\sqrt[3]{\mathsf{fma}\left(y.im, t\_1, t\_0\right)}\right)}^{3}\right)\\

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


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

    1. Initial program 38.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. cancel-sign-sub-inv38.2%

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

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

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

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

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

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

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

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

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

    if -1e-59 < y.re < 1.3e20

    1. Initial program 34.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-diff34.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3e20 < y.re

    1. Initial program 43.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 74.7% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;y.re \leq 6.5 \cdot 10^{-26}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(t\_1, y.im, t\_2\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\

\mathbf{elif}\;y.re \leq 4.7 \cdot 10^{+44}:\\
\;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos t\_2\\

\mathbf{else}:\\
\;\;\;\;\cos \left({\left(\sqrt[3]{\mathsf{fma}\left(y.im, t\_1, t\_2\right)}\right)}^{3}\right) \cdot t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y.re < -6.80000000000000002e-18

    1. Initial program 37.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.80000000000000002e-18 < y.re < 6.5e-26

    1. Initial program 36.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-diff36.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.5e-26 < y.re < 4.70000000000000018e44

    1. Initial program 37.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-diff18.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.70000000000000018e44 < y.re

    1. Initial program 42.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-diff36.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 78.0% accurate, 1.1× speedup?

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

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

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

\mathbf{elif}\;y.re \leq 3.5 \cdot 10^{+20}:\\
\;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos t\_1\\

\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(y.im \cdot t\_0\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y.re < -6.80000000000000002e-18

    1. Initial program 37.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.80000000000000002e-18 < y.re < 1.85000000000000004e-25

    1. Initial program 36.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-diff36.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.85000000000000004e-25 < y.re < 3.5e20

    1. Initial program 12.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-diff12.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.5e20 < 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. Add Preprocessing
    3. Taylor expanded in y.re around 0 47.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -6.8 \cdot 10^{-18}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \frac{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{y.re}\right)\right)\\ \mathbf{elif}\;y.re \leq 1.85 \cdot 10^{-25}:\\ \;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ \mathbf{elif}\;y.re \leq 3.5 \cdot 10^{+20}:\\ \;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 76.4% accurate, 1.1× speedup?

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

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

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

\mathbf{elif}\;y.re \leq 3.4 \cdot 10^{+42}:\\
\;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos t\_2\\

\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot t\_0\right) \cdot t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y.re < -6.80000000000000002e-18

    1. Initial program 37.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.80000000000000002e-18 < y.re < 1.3e-25

    1. Initial program 36.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-diff36.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3e-25 < y.re < 3.39999999999999975e42

    1. Initial program 33.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-diff13.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.39999999999999975e42 < y.re

    1. Initial program 43.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-diff37.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \color{blue}{\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)} \]
    9. Step-by-step derivation
      1. unpow246.6%

        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \log \left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right)\right) \]
      2. unpow246.6%

        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)\right) \]
      3. hypot-undefine77.6%

        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right) \]
    10. Simplified77.6%

      \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \color{blue}{\left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification80.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -6.8 \cdot 10^{-18}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \frac{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{y.re}\right)\right)\\ \mathbf{elif}\;y.re \leq 1.3 \cdot 10^{-25}:\\ \;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ \mathbf{elif}\;y.re \leq 3.4 \cdot 10^{+42}:\\ \;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 76.2% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;y.re \leq 10^{-24}:\\
\;\;\;\;t\_3 \cdot t\_1\\

\mathbf{elif}\;y.re \leq 3.4 \cdot 10^{+42}:\\
\;\;\;\;t\_3 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y.re < -6.80000000000000002e-18

    1. Initial program 37.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.80000000000000002e-18 < y.re < 9.99999999999999924e-25

    1. Initial program 36.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-diff36.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \log \left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right)\right) \]
      2. unpow220.2%

        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)\right) \]
      3. hypot-undefine46.7%

        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right) \]
    10. Simplified80.5%

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

    if 9.99999999999999924e-25 < y.re < 3.39999999999999975e42

    1. Initial program 33.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-diff13.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.39999999999999975e42 < y.re

    1. Initial program 43.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-diff37.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \color{blue}{\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)} \]
    9. Step-by-step derivation
      1. unpow246.6%

        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \log \left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right)\right) \]
      2. unpow246.6%

        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)\right) \]
      3. hypot-undefine77.6%

        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right) \]
    10. Simplified77.6%

      \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \color{blue}{\left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification80.5%

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

Alternative 9: 76.3% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\\ t_1 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ t_2 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ t_3 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{if}\;y.re \leq -6.8 \cdot 10^{-18}:\\ \;\;\;\;t\_2 \cdot t\_3\\ \mathbf{elif}\;y.re \leq 2.9 \cdot 10^{-25}:\\ \;\;\;\;t\_0 \cdot t\_1\\ \mathbf{elif}\;y.re \leq 3.7 \cdot 10^{+42}:\\ \;\;\;\;t\_0 \cdot t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot t\_2\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (pow (exp (- y.im)) (atan2 x.im x.re)))
        (t_1 (cos (* y.im (log (hypot x.im x.re)))))
        (t_2 (pow (hypot x.im x.re) y.re))
        (t_3 (cos (* y.re (atan2 x.im x.re)))))
   (if (<= y.re -6.8e-18)
     (* t_2 t_3)
     (if (<= y.re 2.9e-25)
       (* t_0 t_1)
       (if (<= y.re 3.7e+42) (* t_0 t_3) (* t_1 t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = pow(exp(-y_46_im), atan2(x_46_im, x_46_re));
	double t_1 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
	double t_2 = pow(hypot(x_46_im, x_46_re), y_46_re);
	double t_3 = cos((y_46_re * atan2(x_46_im, x_46_re)));
	double tmp;
	if (y_46_re <= -6.8e-18) {
		tmp = t_2 * t_3;
	} else if (y_46_re <= 2.9e-25) {
		tmp = t_0 * t_1;
	} else if (y_46_re <= 3.7e+42) {
		tmp = t_0 * t_3;
	} else {
		tmp = t_1 * t_2;
	}
	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.exp(-y_46_im), Math.atan2(x_46_im, x_46_re));
	double t_1 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
	double t_2 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
	double t_3 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
	double tmp;
	if (y_46_re <= -6.8e-18) {
		tmp = t_2 * t_3;
	} else if (y_46_re <= 2.9e-25) {
		tmp = t_0 * t_1;
	} else if (y_46_re <= 3.7e+42) {
		tmp = t_0 * t_3;
	} else {
		tmp = t_1 * t_2;
	}
	return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	t_0 = math.pow(math.exp(-y_46_im), math.atan2(x_46_im, x_46_re))
	t_1 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re))))
	t_2 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re)
	t_3 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re)))
	tmp = 0
	if y_46_re <= -6.8e-18:
		tmp = t_2 * t_3
	elif y_46_re <= 2.9e-25:
		tmp = t_0 * t_1
	elif y_46_re <= 3.7e+42:
		tmp = t_0 * t_3
	else:
		tmp = t_1 * t_2
	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)
	t_1 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))
	t_2 = hypot(x_46_im, x_46_re) ^ y_46_re
	t_3 = cos(Float64(y_46_re * atan(x_46_im, x_46_re)))
	tmp = 0.0
	if (y_46_re <= -6.8e-18)
		tmp = Float64(t_2 * t_3);
	elseif (y_46_re <= 2.9e-25)
		tmp = Float64(t_0 * t_1);
	elseif (y_46_re <= 3.7e+42)
		tmp = Float64(t_0 * t_3);
	else
		tmp = Float64(t_1 * t_2);
	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);
	t_1 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
	t_2 = hypot(x_46_im, x_46_re) ^ y_46_re;
	t_3 = cos((y_46_re * atan2(x_46_im, x_46_re)));
	tmp = 0.0;
	if (y_46_re <= -6.8e-18)
		tmp = t_2 * t_3;
	elseif (y_46_re <= 2.9e-25)
		tmp = t_0 * t_1;
	elseif (y_46_re <= 3.7e+42)
		tmp = t_0 * t_3;
	else
		tmp = t_1 * t_2;
	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[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$3 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -6.8e-18], N[(t$95$2 * t$95$3), $MachinePrecision], If[LessEqual[y$46$re, 2.9e-25], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 3.7e+42], N[(t$95$0 * t$95$3), $MachinePrecision], N[(t$95$1 * t$95$2), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y.re \leq 2.9 \cdot 10^{-25}:\\
\;\;\;\;t\_0 \cdot t\_1\\

\mathbf{elif}\;y.re \leq 3.7 \cdot 10^{+42}:\\
\;\;\;\;t\_0 \cdot t\_3\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y.re < -6.80000000000000002e-18

    1. Initial program 37.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.80000000000000002e-18 < y.re < 2.9000000000000001e-25

    1. Initial program 36.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-diff36.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \log \left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right)\right) \]
      2. unpow220.2%

        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)\right) \]
      3. hypot-undefine46.7%

        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right) \]
    10. Simplified80.5%

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

    if 2.9000000000000001e-25 < y.re < 3.69999999999999996e42

    1. Initial program 33.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-diff13.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.69999999999999996e42 < y.re

    1. Initial program 43.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-diff37.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \color{blue}{\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)} \]
    9. Step-by-step derivation
      1. unpow246.6%

        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \log \left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right)\right) \]
      2. unpow246.6%

        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)\right) \]
      3. hypot-undefine77.6%

        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right) \]
    10. Simplified77.6%

      \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \color{blue}{\left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification79.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -6.8 \cdot 10^{-18}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{elif}\;y.re \leq 2.9 \cdot 10^{-25}:\\ \;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{elif}\;y.re \leq 3.7 \cdot 10^{+42}:\\ \;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 75.2% accurate, 1.6× speedup?

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

\mathbf{elif}\;y.re \leq 3.4 \cdot 10^{+42}:\\
\;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_1\\

\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y.re < -1.00000000000000001e-50

    1. Initial program 37.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000001e-50 < y.re < 3.39999999999999975e42

    1. Initial program 36.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.39999999999999975e42 < y.re

    1. Initial program 43.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-diff37.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \color{blue}{\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)} \]
    9. Step-by-step derivation
      1. unpow246.6%

        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \log \left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right)\right) \]
      2. unpow246.6%

        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)\right) \]
      3. hypot-undefine77.6%

        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right) \]
    10. Simplified77.6%

      \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \color{blue}{\left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.9%

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

Alternative 11: 61.1% accurate, 2.0× speedup?

\[\begin{array}{l} \\ {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (* (pow (hypot x.im x.re) y.re) (cos (* y.re (atan2 x.im x.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	return pow(hypot(x_46_im, x_46_re), y_46_re) * cos((y_46_re * atan2(x_46_im, x_46_re)));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	return Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	return math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.cos((y_46_re * math.atan2(x_46_im, x_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	return Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * cos(Float64(y_46_re * atan(x_46_im, x_46_re))))
end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
	tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * cos((y_46_re * atan2(x_46_im, x_46_re)));
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)
\end{array}
Derivation
  1. Initial program 38.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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