powComplex, real part

Percentage Accurate: 39.6% → 79.7%
Time: 21.2s
Alternatives: 12
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 12 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: 39.6% accurate, 1.0× speedup?

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

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

Alternative 1: 79.7% accurate, 0.9× speedup?

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

\mathbf{elif}\;x.re \leq -4 \cdot 10^{-310}:\\
\;\;\;\;t_0 \cdot \left(\cos t_1 + \sin t_1 \cdot \left(y.im \cdot \log \left(\frac{-1}{x.re}\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_0 \cdot \cos \left(t_1 + y.im \cdot \log x.re\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x.re < -1e8

    1. Initial program 22.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. Simplified74.2%

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

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

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

      if -1e8 < x.re < -3.999999999999988e-310

      1. Initial program 51.4%

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

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

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

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

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

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

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

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

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

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

        if -3.999999999999988e-310 < x.re

        1. Initial program 40.6%

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

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

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

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

        Alternative 2: 79.9% accurate, 0.9× 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}\\ \mathbf{if}\;x.re \leq -0.00024:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \cos \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\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)))))
           (if (<= x.re -0.00024)
             t_1
             (* t_1 (cos (fma t_0 y.im (* y.re (atan2 x.im x.re))))))))
        double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
        	double t_0 = 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 tmp;
        	if (x_46_re <= -0.00024) {
        		tmp = t_1;
        	} else {
        		tmp = t_1 * cos(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
        	}
        	return tmp;
        }
        
        function code(x_46_re, x_46_im, y_46_re, y_46_im)
        	t_0 = 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)))
        	tmp = 0.0
        	if (x_46_re <= -0.00024)
        		tmp = t_1;
        	else
        		tmp = Float64(t_1 * cos(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))));
        	end
        	return tmp
        end
        
        code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[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]}, If[LessEqual[x$46$re, -0.00024], t$95$1, N[(t$95$1 * N[Cos[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $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}\\
        \mathbf{if}\;x.re \leq -0.00024:\\
        \;\;\;\;t_1\\
        
        \mathbf{else}:\\
        \;\;\;\;t_1 \cdot \cos \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if x.re < -2.40000000000000006e-4

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

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

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

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

            if -2.40000000000000006e-4 < x.re

            1. Initial program 45.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. Simplified81.5%

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

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

            Alternative 3: 80.9% accurate, 1.2× speedup?

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

              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. Simplified79.6%

                  \[\leadsto \color{blue}{e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} \]
                2. Taylor expanded in y.im around 0 82.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.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                3. Taylor expanded in y.re around 0 85.8%

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

                if 2e-187 < x.re

                1. Initial program 38.2%

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

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;x.re \leq 2 \cdot 10^{-187}:\\ \;\;\;\;e^{\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.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \log x.re\right)\\ \end{array} \]

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

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

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

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

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

                    if -1.00000000000000005e-4 < x.re

                    1. Initial program 45.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. Simplified81.5%

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

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;x.re \leq -0.0001:\\ \;\;\;\;e^{\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.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \end{array} \]

                    Alternative 5: 80.9% accurate, 2.0× speedup?

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

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

                        \[\leadsto \color{blue}{e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} \]
                      2. Taylor expanded in y.im around 0 80.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.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                      3. Taylor expanded in y.re around 0 81.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} \]
                      4. Final simplification81.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} \]

                      Alternative 6: 62.6% accurate, 2.6× speedup?

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

                        1. Initial program 45.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. Simplified83.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 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 \cos \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                          3. Taylor expanded in y.re around 0 83.1%

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

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

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

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

                              \[\leadsto e^{y.re \cdot \log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}} \cdot 1 \]
                            4. hypot-def60.2%

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

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

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

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

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

                              \[\leadsto e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + \color{blue}{x.im \cdot x.im}}\right)} \cdot 1 \]
                            10. hypot-def68.6%

                              \[\leadsto e^{y.re \cdot \log \color{blue}{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}} \cdot 1 \]
                            11. log-pow68.6%

                              \[\leadsto e^{\color{blue}{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)}} \cdot 1 \]
                            12. hypot-def60.2%

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

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

                              \[\leadsto e^{\log \left({\left(\sqrt{{x.re}^{2} + \color{blue}{{x.im}^{2}}}\right)}^{y.re}\right)} \cdot 1 \]
                            15. +-commutative60.2%

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

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

                              \[\leadsto e^{\log \left({\left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)}^{y.re}\right)} \cdot 1 \]
                            18. hypot-def68.6%

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

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

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

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

                              \[\leadsto e^{-\color{blue}{y.re \cdot \log \left(\frac{-1}{x.im}\right)}} \cdot 1 \]
                            3. distribute-rgt-neg-in58.8%

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

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

                          if -9.50000000000000032e181 < x.im < -1.41999999999999998e156

                          1. Initial program 0.0%

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

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

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

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

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

                                \[\leadsto e^{-\color{blue}{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot 1 \]
                              3. distribute-lft-neg-in92.5%

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

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

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

                            if -9.999999999999969e-311 < x.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 62.1%

                              \[\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 62.1%

                              \[\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}{1} \]
                            4. Taylor expanded in x.re around 0 70.6%

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

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

                          Alternative 7: 76.6% accurate, 2.6× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -30500 \lor \neg \left(y.re \leq 10\right):\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ \end{array} \end{array} \]
                          (FPCore (x.re x.im y.re y.im)
                           :precision binary64
                           (if (or (<= y.re -30500.0) (not (<= y.re 10.0)))
                             (exp (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
                             (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) {
                          	double tmp;
                          	if ((y_46_re <= -30500.0) || !(y_46_re <= 10.0)) {
                          		tmp = exp((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))));
                          	} else {
                          		tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
                          	}
                          	return tmp;
                          }
                          
                          real(8) function code(x_46re, x_46im, y_46re, y_46im)
                              real(8), intent (in) :: x_46re
                              real(8), intent (in) :: x_46im
                              real(8), intent (in) :: y_46re
                              real(8), intent (in) :: y_46im
                              real(8) :: tmp
                              if ((y_46re <= (-30500.0d0)) .or. (.not. (y_46re <= 10.0d0))) then
                                  tmp = exp((y_46re * log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))))
                              else
                                  tmp = exp((atan2(x_46im, x_46re) * -y_46im))
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                          	double tmp;
                          	if ((y_46_re <= -30500.0) || !(y_46_re <= 10.0)) {
                          		tmp = Math.exp((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))));
                          	} else {
                          		tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
                          	}
                          	return tmp;
                          }
                          
                          def code(x_46_re, x_46_im, y_46_re, y_46_im):
                          	tmp = 0
                          	if (y_46_re <= -30500.0) or not (y_46_re <= 10.0):
                          		tmp = math.exp((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))))
                          	else:
                          		tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))
                          	return tmp
                          
                          function code(x_46_re, x_46_im, y_46_re, y_46_im)
                          	tmp = 0.0
                          	if ((y_46_re <= -30500.0) || !(y_46_re <= 10.0))
                          		tmp = exp(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))));
                          	else
                          		tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)));
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                          	tmp = 0.0;
                          	if ((y_46_re <= -30500.0) || ~((y_46_re <= 10.0)))
                          		tmp = exp((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))));
                          	else
                          		tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -30500.0], N[Not[LessEqual[y$46$re, 10.0]], $MachinePrecision]], N[Exp[N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;y.re \leq -30500 \lor \neg \left(y.re \leq 10\right):\\
                          \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if y.re < -30500 or 10 < y.re

                            1. Initial program 36.5%

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

                                \[\leadsto \color{blue}{e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} \]
                              2. Taylor expanded in y.im around 0 78.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.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                              3. Taylor expanded in y.re around 0 79.4%

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

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

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

                                  \[\leadsto e^{y.re \cdot \log \left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)} \cdot 1 \]
                                3. unpow274.8%

                                  \[\leadsto e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + \color{blue}{x.im \cdot x.im}}\right)} \cdot 1 \]
                              6. Simplified74.8%

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

                              if -30500 < y.re < 10

                              1. Initial program 41.4%

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

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

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

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

                                    \[\leadsto e^{-\color{blue}{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot 1 \]
                                  3. distribute-lft-neg-in81.0%

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

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

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

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

                              Alternative 8: 63.1% accurate, 2.7× speedup?

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

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

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

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

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

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

                                      \[\leadsto e^{-\color{blue}{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot 1 \]
                                    3. distribute-lft-neg-in61.6%

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

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

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

                                  if 1.01999999999999994e-247 < x.re

                                  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. Taylor expanded in y.im around 0 63.5%

                                    \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                  3. Taylor expanded in y.re around 0 59.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}{1} \]
                                  4. Taylor expanded in x.re around inf 67.6%

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

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

                                Alternative 9: 57.8% accurate, 4.0× speedup?

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

                                  1. Initial program 41.7%

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

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

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

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

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

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

                                        \[\leadsto e^{-\color{blue}{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot 1 \]
                                      3. distribute-lft-neg-in57.1%

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

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

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

                                    if 1.19999999999999991e28 < x.re

                                    1. Initial program 28.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. Simplified81.2%

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

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

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

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

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

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

                                          \[\leadsto e^{y.re \cdot \log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}} \cdot 1 \]
                                        4. hypot-def54.7%

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

                                          \[\leadsto e^{y.re \cdot \log \left(\sqrt{\color{blue}{{x.im}^{2}} + x.re \cdot x.re}\right)} \cdot 1 \]
                                        6. unpow254.7%

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

                                          \[\leadsto e^{y.re \cdot \log \left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)} \cdot 1 \]
                                        8. unpow254.7%

                                          \[\leadsto e^{y.re \cdot \log \left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)} \cdot 1 \]
                                        9. unpow254.7%

                                          \[\leadsto e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + \color{blue}{x.im \cdot x.im}}\right)} \cdot 1 \]
                                        10. hypot-def64.4%

                                          \[\leadsto e^{y.re \cdot \log \color{blue}{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}} \cdot 1 \]
                                        11. log-pow64.4%

                                          \[\leadsto e^{\color{blue}{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)}} \cdot 1 \]
                                        12. hypot-def54.7%

                                          \[\leadsto e^{\log \left({\color{blue}{\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}}^{y.re}\right)} \cdot 1 \]
                                        13. unpow254.7%

                                          \[\leadsto e^{\log \left({\left(\sqrt{\color{blue}{{x.re}^{2}} + x.im \cdot x.im}\right)}^{y.re}\right)} \cdot 1 \]
                                        14. unpow254.7%

                                          \[\leadsto e^{\log \left({\left(\sqrt{{x.re}^{2} + \color{blue}{{x.im}^{2}}}\right)}^{y.re}\right)} \cdot 1 \]
                                        15. +-commutative54.7%

                                          \[\leadsto e^{\log \left({\left(\sqrt{\color{blue}{{x.im}^{2} + {x.re}^{2}}}\right)}^{y.re}\right)} \cdot 1 \]
                                        16. unpow254.7%

                                          \[\leadsto e^{\log \left({\left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right)}^{y.re}\right)} \cdot 1 \]
                                        17. unpow254.7%

                                          \[\leadsto e^{\log \left({\left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)}^{y.re}\right)} \cdot 1 \]
                                        18. hypot-def64.4%

                                          \[\leadsto e^{\log \left({\color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}}^{y.re}\right)} \cdot 1 \]
                                      6. Simplified64.4%

                                        \[\leadsto e^{\color{blue}{\log \left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)}} \cdot 1 \]
                                      7. Taylor expanded in x.im around 0 63.7%

                                        \[\leadsto e^{\color{blue}{\log \left({x.re}^{y.re}\right)}} \cdot 1 \]
                                      8. Step-by-step derivation
                                        1. log-pow63.7%

                                          \[\leadsto e^{\color{blue}{y.re \cdot \log x.re}} \cdot 1 \]
                                      9. Simplified63.7%

                                        \[\leadsto e^{\color{blue}{y.re \cdot \log x.re}} \cdot 1 \]
                                    3. Recombined 2 regimes into one program.
                                    4. Final simplification58.5%

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

                                    Alternative 10: 41.7% accurate, 4.0× speedup?

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

                                      1. Initial program 41.4%

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

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

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

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

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

                                            \[\leadsto e^{-\color{blue}{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot 1 \]
                                          3. distribute-lft-neg-in54.1%

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

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

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

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

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

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

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

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

                                            \[\leadsto e^{\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.im} \cdot 1 \]
                                          7. expm1-log1p-u30.6%

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

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

                                          \[\leadsto e^{\color{blue}{e^{\mathsf{log1p}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} - 1}} \cdot 1 \]
                                        9. Step-by-step derivation
                                          1. expm1-def30.6%

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

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

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

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

                                        if -9.999999999999969e-311 < x.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. Step-by-step derivation
                                          1. Simplified74.2%

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

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

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

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

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

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

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

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

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

                                              \[\leadsto e^{y.re \cdot \log \left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)} \cdot 1 \]
                                            8. unpow252.9%

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

                                              \[\leadsto e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + \color{blue}{x.im \cdot x.im}}\right)} \cdot 1 \]
                                            10. hypot-def57.4%

                                              \[\leadsto e^{y.re \cdot \log \color{blue}{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}} \cdot 1 \]
                                            11. log-pow57.4%

                                              \[\leadsto e^{\color{blue}{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)}} \cdot 1 \]
                                            12. hypot-def52.9%

                                              \[\leadsto e^{\log \left({\color{blue}{\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}}^{y.re}\right)} \cdot 1 \]
                                            13. unpow252.9%

                                              \[\leadsto e^{\log \left({\left(\sqrt{\color{blue}{{x.re}^{2}} + x.im \cdot x.im}\right)}^{y.re}\right)} \cdot 1 \]
                                            14. unpow252.9%

                                              \[\leadsto e^{\log \left({\left(\sqrt{{x.re}^{2} + \color{blue}{{x.im}^{2}}}\right)}^{y.re}\right)} \cdot 1 \]
                                            15. +-commutative52.9%

                                              \[\leadsto e^{\log \left({\left(\sqrt{\color{blue}{{x.im}^{2} + {x.re}^{2}}}\right)}^{y.re}\right)} \cdot 1 \]
                                            16. unpow252.9%

                                              \[\leadsto e^{\log \left({\left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right)}^{y.re}\right)} \cdot 1 \]
                                            17. unpow252.9%

                                              \[\leadsto e^{\log \left({\left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)}^{y.re}\right)} \cdot 1 \]
                                            18. hypot-def57.4%

                                              \[\leadsto e^{\log \left({\color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}}^{y.re}\right)} \cdot 1 \]
                                          6. Simplified57.4%

                                            \[\leadsto e^{\color{blue}{\log \left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)}} \cdot 1 \]
                                          7. Taylor expanded in x.re around 0 51.4%

                                            \[\leadsto e^{\color{blue}{\log \left({x.im}^{y.re}\right)}} \cdot 1 \]
                                          8. Step-by-step derivation
                                            1. log-pow51.4%

                                              \[\leadsto e^{\color{blue}{y.re \cdot \log x.im}} \cdot 1 \]
                                          9. Simplified51.4%

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

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

                                        Alternative 11: 40.2% accurate, 4.0× speedup?

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

                                          1. Initial program 39.4%

                                            \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                          2. Step-by-step derivation
                                            1. Simplified80.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 0 83.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.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                            3. Taylor expanded in y.re around 0 83.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 \color{blue}{1} \]
                                            4. Taylor expanded in y.re around inf 57.4%

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

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

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

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

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

                                                \[\leadsto e^{y.re \cdot \log \left(\sqrt{\color{blue}{{x.im}^{2}} + x.re \cdot x.re}\right)} \cdot 1 \]
                                              6. unpow257.4%

                                                \[\leadsto e^{y.re \cdot \log \left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)} \cdot 1 \]
                                              7. +-commutative57.4%

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

                                                \[\leadsto e^{y.re \cdot \log \left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)} \cdot 1 \]
                                              9. unpow257.4%

                                                \[\leadsto e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + \color{blue}{x.im \cdot x.im}}\right)} \cdot 1 \]
                                              10. hypot-def66.8%

                                                \[\leadsto e^{y.re \cdot \log \color{blue}{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}} \cdot 1 \]
                                              11. log-pow66.8%

                                                \[\leadsto e^{\color{blue}{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)}} \cdot 1 \]
                                              12. hypot-def57.4%

                                                \[\leadsto e^{\log \left({\color{blue}{\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}}^{y.re}\right)} \cdot 1 \]
                                              13. unpow257.4%

                                                \[\leadsto e^{\log \left({\left(\sqrt{\color{blue}{{x.re}^{2}} + x.im \cdot x.im}\right)}^{y.re}\right)} \cdot 1 \]
                                              14. unpow257.4%

                                                \[\leadsto e^{\log \left({\left(\sqrt{{x.re}^{2} + \color{blue}{{x.im}^{2}}}\right)}^{y.re}\right)} \cdot 1 \]
                                              15. +-commutative57.4%

                                                \[\leadsto e^{\log \left({\left(\sqrt{\color{blue}{{x.im}^{2} + {x.re}^{2}}}\right)}^{y.re}\right)} \cdot 1 \]
                                              16. unpow257.4%

                                                \[\leadsto e^{\log \left({\left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right)}^{y.re}\right)} \cdot 1 \]
                                              17. unpow257.4%

                                                \[\leadsto e^{\log \left({\left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)}^{y.re}\right)} \cdot 1 \]
                                              18. hypot-def66.8%

                                                \[\leadsto e^{\log \left({\color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}}^{y.re}\right)} \cdot 1 \]
                                            6. Simplified66.8%

                                              \[\leadsto e^{\color{blue}{\log \left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)}} \cdot 1 \]
                                            7. Taylor expanded in x.im around 0 40.6%

                                              \[\leadsto e^{\color{blue}{\log \left({x.re}^{y.re}\right)}} \cdot 1 \]
                                            8. Step-by-step derivation
                                              1. log-pow25.0%

                                                \[\leadsto e^{\color{blue}{y.re \cdot \log x.re}} \cdot 1 \]
                                            9. Simplified25.0%

                                              \[\leadsto e^{\color{blue}{y.re \cdot \log x.re}} \cdot 1 \]

                                            if 1.99999999999999992e-233 < x.im

                                            1. Initial program 38.5%

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto e^{y.re \cdot \log \left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)} \cdot 1 \]
                                                7. +-commutative51.6%

                                                  \[\leadsto e^{y.re \cdot \log \left(\sqrt{\color{blue}{{x.re}^{2} + {x.im}^{2}}}\right)} \cdot 1 \]
                                                8. unpow251.6%

                                                  \[\leadsto e^{y.re \cdot \log \left(\sqrt{\color{blue}{x.re \cdot x.re} + {x.im}^{2}}\right)} \cdot 1 \]
                                                9. unpow251.6%

                                                  \[\leadsto e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + \color{blue}{x.im \cdot x.im}}\right)} \cdot 1 \]
                                                10. hypot-def56.7%

                                                  \[\leadsto e^{y.re \cdot \log \color{blue}{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}} \cdot 1 \]
                                                11. log-pow56.7%

                                                  \[\leadsto e^{\color{blue}{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)}} \cdot 1 \]
                                                12. hypot-def51.6%

                                                  \[\leadsto e^{\log \left({\color{blue}{\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}}^{y.re}\right)} \cdot 1 \]
                                                13. unpow251.6%

                                                  \[\leadsto e^{\log \left({\left(\sqrt{\color{blue}{{x.re}^{2}} + x.im \cdot x.im}\right)}^{y.re}\right)} \cdot 1 \]
                                                14. unpow251.6%

                                                  \[\leadsto e^{\log \left({\left(\sqrt{{x.re}^{2} + \color{blue}{{x.im}^{2}}}\right)}^{y.re}\right)} \cdot 1 \]
                                                15. +-commutative51.6%

                                                  \[\leadsto e^{\log \left({\left(\sqrt{\color{blue}{{x.im}^{2} + {x.re}^{2}}}\right)}^{y.re}\right)} \cdot 1 \]
                                                16. unpow251.6%

                                                  \[\leadsto e^{\log \left({\left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right)}^{y.re}\right)} \cdot 1 \]
                                                17. unpow251.6%

                                                  \[\leadsto e^{\log \left({\left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)}^{y.re}\right)} \cdot 1 \]
                                                18. hypot-def56.7%

                                                  \[\leadsto e^{\log \left({\color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}}^{y.re}\right)} \cdot 1 \]
                                              6. Simplified56.7%

                                                \[\leadsto e^{\color{blue}{\log \left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)}} \cdot 1 \]
                                              7. Taylor expanded in x.re around 0 54.7%

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

                                                  \[\leadsto e^{\color{blue}{y.re \cdot \log x.im}} \cdot 1 \]
                                              9. Simplified54.7%

                                                \[\leadsto e^{\color{blue}{y.re \cdot \log x.im}} \cdot 1 \]
                                            3. Recombined 2 regimes into one program.
                                            4. Final simplification36.7%

                                              \[\leadsto \begin{array}{l} \mathbf{if}\;x.im \leq 2 \cdot 10^{-233}:\\ \;\;\;\;e^{y.re \cdot \log x.re}\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log x.im}\\ \end{array} \]

                                            Alternative 12: 27.0% accurate, 4.1× speedup?

                                            \[\begin{array}{l} \\ e^{y.re \cdot \log x.im} \end{array} \]
                                            (FPCore (x.re x.im y.re y.im) :precision binary64 (exp (* y.re (log x.im))))
                                            double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                            	return exp((y_46_re * log(x_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((y_46re * log(x_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((y_46_re * Math.log(x_46_im)));
                                            }
                                            
                                            def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                            	return math.exp((y_46_re * math.log(x_46_im)))
                                            
                                            function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                            	return exp(Float64(y_46_re * log(x_46_im)))
                                            end
                                            
                                            function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                            	tmp = exp((y_46_re * log(x_46_im)));
                                            end
                                            
                                            code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Exp[N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            e^{y.re \cdot \log x.im}
                                            \end{array}
                                            
                                            Derivation
                                            1. Initial program 39.0%

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

                                                \[\leadsto \color{blue}{e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} \]
                                              2. Taylor expanded in y.im around 0 80.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.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                              3. Taylor expanded in y.re around 0 81.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} \]
                                              4. Taylor expanded in y.re around inf 55.1%

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + \color{blue}{x.im \cdot x.im}}\right)} \cdot 1 \]
                                                10. hypot-def62.8%

                                                  \[\leadsto e^{y.re \cdot \log \color{blue}{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}} \cdot 1 \]
                                                11. log-pow62.8%

                                                  \[\leadsto e^{\color{blue}{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)}} \cdot 1 \]
                                                12. hypot-def55.1%

                                                  \[\leadsto e^{\log \left({\color{blue}{\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}}^{y.re}\right)} \cdot 1 \]
                                                13. unpow255.1%

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

                                                  \[\leadsto e^{\log \left({\left(\sqrt{{x.re}^{2} + \color{blue}{{x.im}^{2}}}\right)}^{y.re}\right)} \cdot 1 \]
                                                15. +-commutative55.1%

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

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

                                                  \[\leadsto e^{\log \left({\left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)}^{y.re}\right)} \cdot 1 \]
                                                18. hypot-def62.8%

                                                  \[\leadsto e^{\log \left({\color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}}^{y.re}\right)} \cdot 1 \]
                                              6. Simplified62.8%

                                                \[\leadsto e^{\color{blue}{\log \left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)}} \cdot 1 \]
                                              7. Taylor expanded in x.re around 0 39.0%

                                                \[\leadsto e^{\color{blue}{\log \left({x.im}^{y.re}\right)}} \cdot 1 \]
                                              8. Step-by-step derivation
                                                1. log-pow23.3%

                                                  \[\leadsto e^{\color{blue}{y.re \cdot \log x.im}} \cdot 1 \]
                                              9. Simplified23.3%

                                                \[\leadsto e^{\color{blue}{y.re \cdot \log x.im}} \cdot 1 \]
                                              10. Final simplification23.3%

                                                \[\leadsto e^{y.re \cdot \log x.im} \]

                                              Reproduce

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