powComplex, real part

Percentage Accurate: 40.5% → 80.8%
Time: 21.7s
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: 80.8% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;x.im \leq 9 \cdot 10^{+99}:\\
\;\;\;\;t_1 \cdot \cos \left(\mathsf{fma}\left(t_0, y.im, t_2\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \cos \left({\left(\sqrt[3]{\mathsf{fma}\left(y.im, t_0, t_2\right)}\right)}^{3}\right)\\


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

    1. Initial program 37.1%

      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    2. Step-by-step derivation
      1. Simplified72.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 36.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. unpow236.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. unpow236.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-def78.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. Simplified78.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 82.5%

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

      if 5.19999999999999969e-209 < x.im < 8.9999999999999999e99

      1. Initial program 65.2%

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

        if 8.9999999999999999e99 < x.im

        1. Initial program 10.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. Simplified75.3%

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

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

              \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\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)} \]
            3. fma-udef87.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]{\color{blue}{\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)}^{3}\right) \]
            4. *-commutative87.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]{\color{blue}{y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)} + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)}^{3}\right) \]
            5. *-commutative87.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(\mathsf{hypot}\left(x.re, x.im\right)\right) + \color{blue}{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re}}\right)}^{3}\right) \]
            6. fma-def87.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]{\color{blue}{\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)}}\right)}^{3}\right) \]
          3. Applied egg-rr87.5%

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

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

        Alternative 2: 81.6% accurate, 0.4× speedup?

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

          1. Initial program 87.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. add-cube-cbrt88.7%

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

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

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

          if 2 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re))))

          1. Initial program 10.1%

            \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
          2. Step-by-step derivation
            1. Simplified71.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 7.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. unpow27.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. unpow27.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-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 \cos \left(y.im \cdot \log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right) \]
            4. Simplified76.3%

              \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)} \]
            5. Taylor expanded in y.im around 0 79.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}{1} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification83.2%

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

          Alternative 3: 81.2% accurate, 1.3× speedup?

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

            1. Initial program 38.8%

              \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
            2. Step-by-step derivation
              1. Simplified72.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 37.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. unpow237.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. unpow237.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-def77.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. Simplified77.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 81.8%

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

              if 5.00000000000000014e-307 < x.im

              1. Initial program 40.1%

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

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

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

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

                    \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(y.im \cdot \log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)\right) \]
                  3. hypot-def82.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. Simplified82.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 84.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}{\cos \left(y.im \cdot \log x.im\right)} \]
              3. Recombined 2 regimes into one program.
              4. Final simplification83.1%

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

              Alternative 4: 81.2% accurate, 2.0× speedup?

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

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

                Alternative 5: 74.5% accurate, 2.7× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.im \leq -2.1 \cdot 10^{+58}:\\ \;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ \mathbf{elif}\;y.im \leq 700000000:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;{\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \end{array} \end{array} \]
                (FPCore (x.re x.im y.re y.im)
                 :precision binary64
                 (if (<= y.im -2.1e+58)
                   (exp (* (atan2 x.im x.re) (- y.im)))
                   (if (<= y.im 700000000.0)
                     (pow (hypot x.im x.re) y.re)
                     (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) {
                	double tmp;
                	if (y_46_im <= -2.1e+58) {
                		tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
                	} else if (y_46_im <= 700000000.0) {
                		tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
                	} else {
                		tmp = pow(exp(y_46_im), -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 tmp;
                	if (y_46_im <= -2.1e+58) {
                		tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
                	} else if (y_46_im <= 700000000.0) {
                		tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
                	} else {
                		tmp = Math.pow(Math.exp(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 y_46_im <= -2.1e+58:
                		tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))
                	elif y_46_im <= 700000000.0:
                		tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re)
                	else:
                		tmp = math.pow(math.exp(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 (y_46_im <= -2.1e+58)
                		tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)));
                	elseif (y_46_im <= 700000000.0)
                		tmp = hypot(x_46_im, x_46_re) ^ y_46_re;
                	else
                		tmp = exp(y_46_im) ^ Float64(-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 (y_46_im <= -2.1e+58)
                		tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
                	elseif (y_46_im <= 700000000.0)
                		tmp = hypot(x_46_im, x_46_re) ^ y_46_re;
                	else
                		tmp = exp(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[y$46$im, -2.1e+58], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$im, 700000000.0], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision], N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;y.im \leq -2.1 \cdot 10^{+58}:\\
                \;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
                
                \mathbf{elif}\;y.im \leq 700000000:\\
                \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
                
                \mathbf{else}:\\
                \;\;\;\;{\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if y.im < -2.10000000000000012e58

                  1. Initial program 31.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. Taylor expanded in y.im around 0 51.6%

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

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

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

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

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

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

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

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

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

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

                  if -2.10000000000000012e58 < y.im < 7e8

                  1. Initial program 42.3%

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

                      \[\leadsto \color{blue}{e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} \]
                    2. Taylor expanded in y.im around 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-def90.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. Simplified90.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 90.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}{1} \]
                    6. Step-by-step derivation
                      1. add-log-exp90.0%

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

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

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

                      \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot 1 \]
                    9. Step-by-step derivation
                      1. unpow271.5%

                        \[\leadsto {\left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right)}^{y.re} \cdot 1 \]
                      2. unpow271.5%

                        \[\leadsto {\left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)}^{y.re} \cdot 1 \]
                      3. hypot-def89.0%

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

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

                    if 7e8 < y.im

                    1. Initial program 39.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. Taylor expanded in y.im around 0 62.2%

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 6: 74.3% accurate, 4.0× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.im \leq -1.7 \cdot 10^{+58} \lor \neg \left(y.im \leq 650000000\right):\\ \;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \end{array} \end{array} \]
                  (FPCore (x.re x.im y.re y.im)
                   :precision binary64
                   (if (or (<= y.im -1.7e+58) (not (<= y.im 650000000.0)))
                     (exp (* (atan2 x.im x.re) (- y.im)))
                     (pow (hypot x.im x.re) y.re)))
                  double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                  	double tmp;
                  	if ((y_46_im <= -1.7e+58) || !(y_46_im <= 650000000.0)) {
                  		tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
                  	} else {
                  		tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
                  	}
                  	return tmp;
                  }
                  
                  public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                  	double tmp;
                  	if ((y_46_im <= -1.7e+58) || !(y_46_im <= 650000000.0)) {
                  		tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
                  	} else {
                  		tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
                  	}
                  	return tmp;
                  }
                  
                  def code(x_46_re, x_46_im, y_46_re, y_46_im):
                  	tmp = 0
                  	if (y_46_im <= -1.7e+58) or not (y_46_im <= 650000000.0):
                  		tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))
                  	else:
                  		tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re)
                  	return tmp
                  
                  function code(x_46_re, x_46_im, y_46_re, y_46_im)
                  	tmp = 0.0
                  	if ((y_46_im <= -1.7e+58) || !(y_46_im <= 650000000.0))
                  		tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)));
                  	else
                  		tmp = hypot(x_46_im, x_46_re) ^ y_46_re;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                  	tmp = 0.0;
                  	if ((y_46_im <= -1.7e+58) || ~((y_46_im <= 650000000.0)))
                  		tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
                  	else
                  		tmp = hypot(x_46_im, x_46_re) ^ y_46_re;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -1.7e+58], N[Not[LessEqual[y$46$im, 650000000.0]], $MachinePrecision]], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;y.im \leq -1.7 \cdot 10^{+58} \lor \neg \left(y.im \leq 650000000\right):\\
                  \;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if y.im < -1.7e58 or 6.5e8 < y.im

                    1. Initial program 36.1%

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

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

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

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

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

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

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

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

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

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

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

                    if -1.7e58 < y.im < 6.5e8

                    1. Initial program 42.3%

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

                        \[\leadsto \color{blue}{e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} \]
                      2. Taylor expanded in y.im around 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-def90.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. Simplified90.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 90.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}{1} \]
                      6. Step-by-step derivation
                        1. add-log-exp90.0%

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

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

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

                        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot 1 \]
                      9. Step-by-step derivation
                        1. unpow271.5%

                          \[\leadsto {\left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right)}^{y.re} \cdot 1 \]
                        2. unpow271.5%

                          \[\leadsto {\left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)}^{y.re} \cdot 1 \]
                        3. hypot-def89.0%

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

                        \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}} \cdot 1 \]
                    3. Recombined 2 regimes into one program.
                    4. Final simplification77.6%

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

                    Alternative 7: 52.8% 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 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. Taylor expanded in y.im around 0 60.0%

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 8: 29.9% accurate, 4.1× speedup?

                    \[\begin{array}{l} \\ e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \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) * 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 y.im}
                    \end{array}
                    
                    Derivation
                    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. Taylor expanded in y.im around 0 60.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto e^{0 + y.im \cdot \sqrt{\color{blue}{\tan^{-1}_* \frac{x.im}{x.re} \cdot \tan^{-1}_* \frac{x.im}{x.re}}}} \]
                      9. sqrt-unprod16.7%

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

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

                        \[\leadsto e^{0 + \color{blue}{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \]
                    10. Applied egg-rr29.0%

                      \[\leadsto e^{\color{blue}{0 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \]
                    11. Step-by-step derivation
                      1. +-lft-identity29.0%

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

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

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

                    Alternative 9: 26.5% accurate, 7.8× speedup?

                    \[\begin{array}{l} \\ 1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im \end{array} \]
                    (FPCore (x.re x.im y.re y.im)
                     :precision binary64
                     (- 1.0 (* (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 1.0 - (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 = 1.0d0 - (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 1.0 - (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 1.0 - (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 Float64(1.0 - Float64(atan(x_46_im, x_46_re) * y_46_im))
                    end
                    
                    function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
                    	tmp = 1.0 - (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[(1.0 - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im
                    \end{array}
                    
                    Derivation
                    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. Taylor expanded in y.im around 0 60.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 10: 26.4% accurate, 829.0× speedup?

                    \[\begin{array}{l} \\ 1 \end{array} \]
                    (FPCore (x.re x.im y.re y.im) :precision binary64 1.0)
                    double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                    	return 1.0;
                    }
                    
                    real(8) function code(x_46re, x_46im, y_46re, y_46im)
                        real(8), intent (in) :: x_46re
                        real(8), intent (in) :: x_46im
                        real(8), intent (in) :: y_46re
                        real(8), intent (in) :: y_46im
                        code = 1.0d0
                    end function
                    
                    public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                    	return 1.0;
                    }
                    
                    def code(x_46_re, x_46_im, y_46_re, y_46_im):
                    	return 1.0
                    
                    function code(x_46_re, x_46_im, y_46_re, y_46_im)
                    	return 1.0
                    end
                    
                    function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
                    	tmp = 1.0;
                    end
                    
                    code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 1.0
                    
                    \begin{array}{l}
                    
                    \\
                    1
                    \end{array}
                    
                    Derivation
                    1. Initial program 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. Taylor expanded in y.im around 0 60.0%

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{1} \]
                    10. Final simplification26.0%

                      \[\leadsto 1 \]

                    Reproduce

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