powComplex, real part

Percentage Accurate: 40.5% → 81.8%
Time: 23.6s
Alternatives: 10
Speedup: 4.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 10 alternatives:

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

Initial Program: 40.5% accurate, 1.0× speedup?

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

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

Alternative 1: 81.8% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;y.im \leq 2.5 \cdot 10^{+95}:\\
\;\;\;\;t_0 \cdot \cos \left({\left(\sqrt[3]{t_2}\right)}^{3}\right)\\

\mathbf{elif}\;y.im \leq 3.2 \cdot 10^{+164}:\\
\;\;\;\;t_0 \cdot \left(1 + -0.5 \cdot {t_2}^{2}\right)\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y.im < -5.0000000000000003e129 or 3.1999999999999998e164 < y.im

    1. Initial program 33.8%

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

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

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

      if -5.0000000000000003e129 < y.im < 2.50000000000000012e95

      1. Initial program 40.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. Simplified80.1%

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

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

            \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\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. *-commutative40.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 2.50000000000000012e95 < y.im < 3.1999999999999998e164

        1. Initial program 42.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -5 \cdot 10^{+129}:\\ \;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{elif}\;y.im \leq 2.5 \cdot 10^{+95}:\\ \;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left({\left(\sqrt[3]{y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right)}^{3}\right)\\ \mathbf{elif}\;y.im \leq 3.2 \cdot 10^{+164}:\\ \;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \left(1 + -0.5 \cdot {\left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \end{array} \]

        Alternative 2: 80.9% accurate, 1.1× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{if}\;y.im \leq -3.6 \cdot 10^{+153} \lor \neg \left(y.im \leq 3.2 \cdot 10^{+164}\right):\\ \;\;\;\;t_0 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(1 + -0.5 \cdot {\left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}^{2}\right)\\ \end{array} \end{array} \]
        (FPCore (x.re x.im y.re y.im)
         :precision binary64
         (let* ((t_0
                 (exp
                  (- (* (log (hypot x.re x.im)) y.re) (* y.im (atan2 x.im x.re))))))
           (if (or (<= y.im -3.6e+153) (not (<= y.im 3.2e+164)))
             (* t_0 (cos (* y.re (atan2 x.im x.re))))
             (* t_0 (+ 1.0 (* -0.5 (pow (* y.im (log (hypot x.im x.re))) 2.0)))))))
        double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
        	double t_0 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
        	double tmp;
        	if ((y_46_im <= -3.6e+153) || !(y_46_im <= 3.2e+164)) {
        		tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re)));
        	} else {
        		tmp = t_0 * (1.0 + (-0.5 * pow((y_46_im * log(hypot(x_46_im, x_46_re))), 2.0)));
        	}
        	return tmp;
        }
        
        public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
        	double t_0 = Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
        	double tmp;
        	if ((y_46_im <= -3.6e+153) || !(y_46_im <= 3.2e+164)) {
        		tmp = t_0 * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
        	} else {
        		tmp = t_0 * (1.0 + (-0.5 * Math.pow((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))), 2.0)));
        	}
        	return tmp;
        }
        
        def code(x_46_re, x_46_im, y_46_re, y_46_im):
        	t_0 = math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * math.atan2(x_46_im, x_46_re))))
        	tmp = 0
        	if (y_46_im <= -3.6e+153) or not (y_46_im <= 3.2e+164):
        		tmp = t_0 * math.cos((y_46_re * math.atan2(x_46_im, x_46_re)))
        	else:
        		tmp = t_0 * (1.0 + (-0.5 * math.pow((y_46_im * math.log(math.hypot(x_46_im, x_46_re))), 2.0)))
        	return tmp
        
        function code(x_46_re, x_46_im, y_46_re, y_46_im)
        	t_0 = exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re))))
        	tmp = 0.0
        	if ((y_46_im <= -3.6e+153) || !(y_46_im <= 3.2e+164))
        		tmp = Float64(t_0 * cos(Float64(y_46_re * atan(x_46_im, x_46_re))));
        	else
        		tmp = Float64(t_0 * Float64(1.0 + Float64(-0.5 * (Float64(y_46_im * log(hypot(x_46_im, x_46_re))) ^ 2.0))));
        	end
        	return tmp
        end
        
        function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
        	t_0 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
        	tmp = 0.0;
        	if ((y_46_im <= -3.6e+153) || ~((y_46_im <= 3.2e+164)))
        		tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re)));
        	else
        		tmp = t_0 * (1.0 + (-0.5 * ((y_46_im * log(hypot(x_46_im, x_46_re))) ^ 2.0)));
        	end
        	tmp_2 = tmp;
        end
        
        code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$im, -3.6e+153], N[Not[LessEqual[y$46$im, 3.2e+164]], $MachinePrecision]], N[(t$95$0 * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(1.0 + N[(-0.5 * N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
        \mathbf{if}\;y.im \leq -3.6 \cdot 10^{+153} \lor \neg \left(y.im \leq 3.2 \cdot 10^{+164}\right):\\
        \;\;\;\;t_0 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t_0 \cdot \left(1 + -0.5 \cdot {\left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}^{2}\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y.im < -3.6000000000000001e153 or 3.1999999999999998e164 < y.im

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

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

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

            if -3.6000000000000001e153 < y.im < 3.1999999999999998e164

            1. Initial program 40.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. Simplified77.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 3: 82.2% accurate, 1.2× speedup?

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

              1. Initial program 39.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. Simplified76.6%

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

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

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

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

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

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

                if 1.02000000000000003e165 < y.im

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

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

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

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

                Alternative 4: 81.4% accurate, 1.3× speedup?

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

                  1. Initial program 36.9%

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

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

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

                    if -2.0000000000000001e26 < y.im

                    1. Initial program 39.4%

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

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

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

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

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

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

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

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

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

                    Alternative 5: 81.7% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

                      Alternative 6: 73.1% accurate, 2.6× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{if}\;x.re \leq -5 \cdot 10^{-310}:\\ \;\;\;\;e^{\log \left(\frac{-1}{x.re}\right) \cdot \left(-y.re\right) - t_0}\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log x.re - t_0}\\ \end{array} \end{array} \]
                      (FPCore (x.re x.im y.re y.im)
                       :precision binary64
                       (let* ((t_0 (* y.im (atan2 x.im x.re))))
                         (if (<= x.re -5e-310)
                           (exp (- (* (log (/ -1.0 x.re)) (- y.re)) t_0))
                           (exp (- (* y.re (log 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 = y_46_im * atan2(x_46_im, x_46_re);
                      	double tmp;
                      	if (x_46_re <= -5e-310) {
                      		tmp = exp(((log((-1.0 / x_46_re)) * -y_46_re) - t_0));
                      	} else {
                      		tmp = exp(((y_46_re * log(x_46_re)) - t_0));
                      	}
                      	return tmp;
                      }
                      
                      real(8) function code(x_46re, x_46im, y_46re, y_46im)
                          real(8), intent (in) :: x_46re
                          real(8), intent (in) :: x_46im
                          real(8), intent (in) :: y_46re
                          real(8), intent (in) :: y_46im
                          real(8) :: t_0
                          real(8) :: tmp
                          t_0 = y_46im * atan2(x_46im, x_46re)
                          if (x_46re <= (-5d-310)) then
                              tmp = exp(((log(((-1.0d0) / x_46re)) * -y_46re) - t_0))
                          else
                              tmp = exp(((y_46re * log(x_46re)) - t_0))
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                      	double t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
                      	double tmp;
                      	if (x_46_re <= -5e-310) {
                      		tmp = Math.exp(((Math.log((-1.0 / x_46_re)) * -y_46_re) - t_0));
                      	} else {
                      		tmp = Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
                      	}
                      	return tmp;
                      }
                      
                      def code(x_46_re, x_46_im, y_46_re, y_46_im):
                      	t_0 = y_46_im * math.atan2(x_46_im, x_46_re)
                      	tmp = 0
                      	if x_46_re <= -5e-310:
                      		tmp = math.exp(((math.log((-1.0 / x_46_re)) * -y_46_re) - t_0))
                      	else:
                      		tmp = math.exp(((y_46_re * math.log(x_46_re)) - t_0))
                      	return tmp
                      
                      function code(x_46_re, x_46_im, y_46_re, y_46_im)
                      	t_0 = Float64(y_46_im * atan(x_46_im, x_46_re))
                      	tmp = 0.0
                      	if (x_46_re <= -5e-310)
                      		tmp = exp(Float64(Float64(log(Float64(-1.0 / x_46_re)) * Float64(-y_46_re)) - t_0));
                      	else
                      		tmp = exp(Float64(Float64(y_46_re * log(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 = y_46_im * atan2(x_46_im, x_46_re);
                      	tmp = 0.0;
                      	if (x_46_re <= -5e-310)
                      		tmp = exp(((log((-1.0 / x_46_re)) * -y_46_re) - t_0));
                      	else
                      		tmp = exp(((y_46_re * log(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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -5e-310], N[Exp[N[(N[(N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision] * (-y$46$re)), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
                      \mathbf{if}\;x.re \leq -5 \cdot 10^{-310}:\\
                      \;\;\;\;e^{\log \left(\frac{-1}{x.re}\right) \cdot \left(-y.re\right) - t_0}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;e^{y.re \cdot \log x.re - t_0}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if x.re < -4.999999999999985e-310

                        1. Initial program 36.9%

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

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

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

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

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

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

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

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

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

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

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

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

                          if -4.999999999999985e-310 < x.re

                          1. Initial program 40.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. Simplified76.3%

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

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

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

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

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

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

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

                              \[\leadsto e^{\color{blue}{y.re \cdot \log x.re} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1 \]
                            7. Step-by-step derivation
                              1. *-commutative73.9%

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

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

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

                          Alternative 7: 72.4% accurate, 2.6× speedup?

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

                            1. Initial program 34.0%

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

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

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

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

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

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

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

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

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

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

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

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

                              if -4.999999999999985e-310 < x.im

                              1. Initial program 43.7%

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

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

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

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

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

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

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

                                  \[\leadsto e^{\color{blue}{y.re \cdot \log x.im} - \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) \]
                                6. Step-by-step derivation
                                  1. *-commutative81.3%

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

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

                                  \[\leadsto e^{\log x.im \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{1} \]
                              3. Recombined 2 regimes into one program.
                              4. Final simplification72.8%

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

                              Alternative 8: 62.7% accurate, 2.7× speedup?

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

                                1. Initial program 35.6%

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

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

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

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

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

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

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

                                    \[\leadsto \color{blue}{e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \]
                                  7. Step-by-step derivation
                                    1. distribute-rgt-neg-in49.3%

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

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

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

                                  if 2.35000000000000006e-240 < x.im

                                  1. Initial program 42.9%

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

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

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

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

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

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

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

                                      \[\leadsto e^{\color{blue}{y.re \cdot \log x.im} - \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) \]
                                    6. Step-by-step derivation
                                      1. *-commutative81.6%

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

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

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

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;x.im \leq 2.35 \cdot 10^{-240}:\\ \;\;\;\;{\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log x.im - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \end{array} \]

                                  Alternative 9: 53.9% accurate, 2.7× speedup?

                                  \[\begin{array}{l} \\ {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)} \end{array} \]
                                  (FPCore (x.re x.im y.re y.im)
                                   :precision binary64
                                   (pow (exp y.im) (- (atan2 x.im x.re))))
                                  double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                  	return pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
                                  }
                                  
                                  real(8) function code(x_46re, x_46im, y_46re, y_46im)
                                      real(8), intent (in) :: x_46re
                                      real(8), intent (in) :: x_46im
                                      real(8), intent (in) :: y_46re
                                      real(8), intent (in) :: y_46im
                                      code = exp(y_46im) ** -atan2(x_46im, x_46re)
                                  end function
                                  
                                  public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                  	return Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re));
                                  }
                                  
                                  def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                  	return math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re))
                                  
                                  function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                  	return exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re))
                                  end
                                  
                                  function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                  	tmp = exp(y_46_im) ^ -atan2(x_46_im, x_46_re);
                                  end
                                  
                                  code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}
                                  \end{array}
                                  
                                  Derivation
                                  1. Initial program 38.8%

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

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

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

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

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

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

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

                                      \[\leadsto \color{blue}{e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \]
                                    7. Step-by-step derivation
                                      1. distribute-rgt-neg-in52.4%

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

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

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

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

                                    Alternative 10: 53.3% accurate, 4.0× speedup?

                                    \[\begin{array}{l} \\ e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \end{array} \]
                                    (FPCore (x.re x.im y.re y.im)
                                     :precision binary64
                                     (exp (* (atan2 x.im x.re) (- y.im))))
                                    double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                    	return exp((atan2(x_46_im, x_46_re) * -y_46_im));
                                    }
                                    
                                    real(8) function code(x_46re, x_46im, y_46re, y_46im)
                                        real(8), intent (in) :: x_46re
                                        real(8), intent (in) :: x_46im
                                        real(8), intent (in) :: y_46re
                                        real(8), intent (in) :: y_46im
                                        code = exp((atan2(x_46im, x_46re) * -y_46im))
                                    end function
                                    
                                    public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                    	return Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
                                    }
                                    
                                    def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                    	return math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))
                                    
                                    function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                    	return exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))
                                    end
                                    
                                    function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                    	tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
                                    end
                                    
                                    code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}
                                    \end{array}
                                    
                                    Derivation
                                    1. Initial program 38.8%

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

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

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

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

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

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

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

                                        \[\leadsto \color{blue}{e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \]
                                      7. Step-by-step derivation
                                        1. distribute-rgt-neg-in52.4%

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

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

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

                                      Reproduce

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