powComplex, real part

Percentage Accurate: 40.0% → 73.6%
Time: 13.6s
Alternatives: 21
Speedup: 2.1×

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

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

Initial Program: 40.0% 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: 73.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\ t_1 := \log \left(-x.im\right)\\ t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_3 := e^{t\_1 \cdot y.re - t\_2}\\ \mathbf{if}\;x.im \leq -1 \cdot 10^{+20}:\\ \;\;\;\;t\_3 \cdot t\_0\\ \mathbf{elif}\;x.im \leq -1.26 \cdot 10^{-181}:\\ \;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t\_2} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;x.im \leq -2.3 \cdot 10^{-294}:\\ \;\;\;\;t\_3 \cdot \cos \left(t\_1 \cdot y.im\right)\\ \mathbf{elif}\;x.im \leq 11500000000:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;e^{-\mathsf{fma}\left(-\log x.im, y.re, t\_2\right)} \cdot t\_0\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (cos (* (log (hypot x.im x.re)) y.im)))
        (t_1 (log (- x.im)))
        (t_2 (* (atan2 x.im x.re) y.im))
        (t_3 (exp (- (* t_1 y.re) t_2))))
   (if (<= x.im -1e+20)
     (* t_3 t_0)
     (if (<= x.im -1.26e-181)
       (*
        (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_2))
        (cos (* (atan2 x.im x.re) y.re)))
       (if (<= x.im -2.3e-294)
         (* t_3 (cos (* t_1 y.im)))
         (if (<= x.im 11500000000.0)
           (*
            (sin (fma (atan2 x.im x.re) y.re (/ (PI) 2.0)))
            (pow (hypot x.im x.re) y.re))
           (* (exp (- (fma (- (log x.im)) y.re t_2))) t_0)))))))
\begin{array}{l}

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

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

\mathbf{elif}\;x.im \leq -2.3 \cdot 10^{-294}:\\
\;\;\;\;t\_3 \cdot \cos \left(t\_1 \cdot y.im\right)\\

\mathbf{elif}\;x.im \leq 11500000000:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\

\mathbf{else}:\\
\;\;\;\;e^{-\mathsf{fma}\left(-\log x.im, y.re, t\_2\right)} \cdot t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x.im < -1e20

    1. Initial program 29.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e20 < x.im < -1.26000000000000002e-181

    1. Initial program 51.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. Add Preprocessing
    3. Taylor expanded in y.im around 0

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

        \[\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)} \]
      2. *-commutativeN/A

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

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

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

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

    if -1.26000000000000002e-181 < x.im < -2.30000000000000016e-294

    1. Initial program 19.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto e^{\log \left(-x.im\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(-1 \cdot x.im\right) \cdot y.im\right) \]
    10. Step-by-step derivation
      1. Applied rewrites75.9%

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

      if -2.30000000000000016e-294 < x.im < 1.15e10

      1. Initial program 39.4%

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

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

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

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

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

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

          \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right) \cdot y.im\right) \]
        6. lower-hypot.f6467.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 \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
      5. Applied rewrites67.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 \cos \color{blue}{\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)} \]
      6. Taylor expanded in y.im around 0

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.15e10 < x.im

        1. Initial program 26.9%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{e^{-1 \cdot \left(y.re \cdot \log \left(\frac{1}{x.im}\right)\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right) \]
          2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;x.im \leq -1 \cdot 10^{+20}:\\ \;\;\;\;e^{\log \left(-x.im\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\ \mathbf{elif}\;x.im \leq -1.26 \cdot 10^{-181}:\\ \;\;\;\;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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;x.im \leq -2.3 \cdot 10^{-294}:\\ \;\;\;\;e^{\log \left(-x.im\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(-x.im\right) \cdot y.im\right)\\ \mathbf{elif}\;x.im \leq 11500000000:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;e^{-\mathsf{fma}\left(-\log x.im, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\ \end{array} \]
      12. Add Preprocessing

      Alternative 2: 76.1% accurate, 0.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ t_1 := \frac{\mathsf{PI}\left(\right)}{2}\\ t_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}\\ t_3 := \cos \left(t\_0 \cdot y.im\right)\\ \mathbf{if}\;y.im \leq -2.15 \cdot 10^{+170}:\\ \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_3\\ \mathbf{elif}\;y.im \leq -3.8 \cdot 10^{+18}:\\ \;\;\;\;t\_2 \cdot \sin \left(\mathsf{fma}\left(y.im, t\_0, \mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, t\_1\right)\right)\right)\\ \mathbf{elif}\;y.im \leq 2.3 \cdot 10^{-22}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_2 \cdot \sin \left(\left(-\mathsf{fma}\left(y.im, t\_0, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) + t\_1\right)\\ \end{array} \end{array} \]
      (FPCore (x.re x.im y.re y.im)
       :precision binary64
       (let* ((t_0 (log (hypot x.im x.re)))
              (t_1 (/ (PI) 2.0))
              (t_2
               (exp
                (-
                 (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
                 (* (atan2 x.im x.re) y.im))))
              (t_3 (cos (* t_0 y.im))))
         (if (<= y.im -2.15e+170)
           (* (exp (* (- y.im) (atan2 x.im x.re))) t_3)
           (if (<= y.im -3.8e+18)
             (* t_2 (sin (fma y.im t_0 (fma (atan2 x.im x.re) y.re t_1))))
             (if (<= y.im 2.3e-22)
               (* (pow (hypot x.im x.re) y.re) t_3)
               (*
                t_2
                (sin (+ (- (fma y.im t_0 (* (atan2 x.im x.re) y.re))) t_1))))))))
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
      t_1 := \frac{\mathsf{PI}\left(\right)}{2}\\
      t_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}\\
      t_3 := \cos \left(t\_0 \cdot y.im\right)\\
      \mathbf{if}\;y.im \leq -2.15 \cdot 10^{+170}:\\
      \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_3\\
      
      \mathbf{elif}\;y.im \leq -3.8 \cdot 10^{+18}:\\
      \;\;\;\;t\_2 \cdot \sin \left(\mathsf{fma}\left(y.im, t\_0, \mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, t\_1\right)\right)\right)\\
      
      \mathbf{elif}\;y.im \leq 2.3 \cdot 10^{-22}:\\
      \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_3\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_2 \cdot \sin \left(\left(-\mathsf{fma}\left(y.im, t\_0, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) + t\_1\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if y.im < -2.1499999999999999e170

        1. Initial program 36.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. Add Preprocessing
        3. Taylor expanded in y.re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -2.1499999999999999e170 < y.im < -3.8e18

        1. Initial program 29.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. Add Preprocessing
        3. Step-by-step derivation
          1. lift-cos.f64N/A

            \[\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(\log \left(\sqrt{x.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. sin-+PI/2-revN/A

            \[\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}{\sin \left(\left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)} \]
          3. lower-sin.f64N/A

            \[\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}{\sin \left(\left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)} \]
          4. lift-+.f64N/A

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

            \[\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 \sin \color{blue}{\left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)} \]
          6. lift-*.f64N/A

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

            \[\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 \sin \left(\color{blue}{y.im \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)} + \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
          8. lower-fma.f64N/A

            \[\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 \sin \color{blue}{\left(\mathsf{fma}\left(y.im, \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)} \]
        4. Applied rewrites70.7%

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

        if -3.8e18 < y.im < 2.2999999999999998e-22

        1. Initial program 33.0%

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

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

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

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

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

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

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

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

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

            \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
          3. lower-log.f64N/A

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

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

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

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

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

        if 2.2999999999999998e-22 < y.im

        1. Initial program 37.8%

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

            \[\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(\log \left(\sqrt{x.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. cos-neg-revN/A

            \[\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(\mathsf{neg}\left(\left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\right)} \]
          3. sin-+PI/2-revN/A

            \[\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}{\sin \left(\left(\mathsf{neg}\left(\left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)} \]
          4. lower-sin.f64N/A

            \[\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}{\sin \left(\left(\mathsf{neg}\left(\left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)} \]
          5. lower-+.f64N/A

            \[\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 \sin \color{blue}{\left(\left(\mathsf{neg}\left(\left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)} \]
        4. Applied rewrites68.0%

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

      Alternative 3: 73.7% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \log \left(-x.im\right)\\ t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_2 := e^{t\_0 \cdot y.re - t\_1} \cdot \cos \left(t\_0 \cdot y.im\right)\\ \mathbf{if}\;x.im \leq -0.098:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x.im \leq -1.26 \cdot 10^{-181}:\\ \;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t\_1} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;x.im \leq -2.3 \cdot 10^{-294}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x.im \leq 11500000000:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;e^{-\mathsf{fma}\left(-\log x.im, y.re, t\_1\right)} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\ \end{array} \end{array} \]
      (FPCore (x.re x.im y.re y.im)
       :precision binary64
       (let* ((t_0 (log (- x.im)))
              (t_1 (* (atan2 x.im x.re) y.im))
              (t_2 (* (exp (- (* t_0 y.re) t_1)) (cos (* t_0 y.im)))))
         (if (<= x.im -0.098)
           t_2
           (if (<= x.im -1.26e-181)
             (*
              (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_1))
              (cos (* (atan2 x.im x.re) y.re)))
             (if (<= x.im -2.3e-294)
               t_2
               (if (<= x.im 11500000000.0)
                 (*
                  (sin (fma (atan2 x.im x.re) y.re (/ (PI) 2.0)))
                  (pow (hypot x.im x.re) y.re))
                 (*
                  (exp (- (fma (- (log x.im)) y.re t_1)))
                  (cos (* (log (hypot x.im x.re)) y.im)))))))))
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \log \left(-x.im\right)\\
      t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
      t_2 := e^{t\_0 \cdot y.re - t\_1} \cdot \cos \left(t\_0 \cdot y.im\right)\\
      \mathbf{if}\;x.im \leq -0.098:\\
      \;\;\;\;t\_2\\
      
      \mathbf{elif}\;x.im \leq -1.26 \cdot 10^{-181}:\\
      \;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t\_1} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
      
      \mathbf{elif}\;x.im \leq -2.3 \cdot 10^{-294}:\\
      \;\;\;\;t\_2\\
      
      \mathbf{elif}\;x.im \leq 11500000000:\\
      \;\;\;\;\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
      
      \mathbf{else}:\\
      \;\;\;\;e^{-\mathsf{fma}\left(-\log x.im, y.re, t\_1\right)} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if x.im < -0.098000000000000004 or -1.26000000000000002e-181 < x.im < -2.30000000000000016e-294

        1. Initial program 28.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -0.098000000000000004 < x.im < -1.26000000000000002e-181

          1. Initial program 50.0%

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

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

              \[\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)} \]
            2. *-commutativeN/A

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

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

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

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

          if -2.30000000000000016e-294 < x.im < 1.15e10

          1. Initial program 39.4%

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

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

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

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

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

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

              \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right) \cdot y.im\right) \]
            6. lower-hypot.f6467.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 \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
          5. Applied rewrites67.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 \cos \color{blue}{\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)} \]
          6. Taylor expanded in y.im around 0

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

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

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

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

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

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

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

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

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

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

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

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

            if 1.15e10 < x.im

            1. Initial program 26.9%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{e^{-1 \cdot \left(y.re \cdot \log \left(\frac{1}{x.im}\right)\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right) \]
              2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;x.im \leq -0.098:\\ \;\;\;\;e^{\log \left(-x.im\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(-x.im\right) \cdot y.im\right)\\ \mathbf{elif}\;x.im \leq -1.26 \cdot 10^{-181}:\\ \;\;\;\;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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;x.im \leq -2.3 \cdot 10^{-294}:\\ \;\;\;\;e^{\log \left(-x.im\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(-x.im\right) \cdot y.im\right)\\ \mathbf{elif}\;x.im \leq 11500000000:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;e^{-\mathsf{fma}\left(-\log x.im, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\ \end{array} \]
          12. Add Preprocessing

          Alternative 4: 76.3% accurate, 1.2× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\ \mathbf{if}\;y.im \leq -2.55 \cdot 10^{+151}:\\ \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\ \mathbf{elif}\;y.im \leq -9.2 \cdot 10^{+22} \lor \neg \left(y.im \leq 2.3 \cdot 10^{-22}\right):\\ \;\;\;\;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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\ \end{array} \end{array} \]
          (FPCore (x.re x.im y.re y.im)
           :precision binary64
           (let* ((t_0 (cos (* (log (hypot x.im x.re)) y.im))))
             (if (<= y.im -2.55e+151)
               (* (exp (* (- y.im) (atan2 x.im x.re))) t_0)
               (if (or (<= y.im -9.2e+22) (not (<= y.im 2.3e-22)))
                 (*
                  (exp
                   (-
                    (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
                    (* (atan2 x.im x.re) y.im)))
                  (cos (* (atan2 x.im x.re) y.re)))
                 (* (pow (hypot x.im x.re) y.re) t_0)))))
          double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
          	double t_0 = cos((log(hypot(x_46_im, x_46_re)) * y_46_im));
          	double tmp;
          	if (y_46_im <= -2.55e+151) {
          		tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * t_0;
          	} else if ((y_46_im <= -9.2e+22) || !(y_46_im <= 2.3e-22)) {
          		tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos((atan2(x_46_im, x_46_re) * y_46_re));
          	} else {
          		tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * t_0;
          	}
          	return tmp;
          }
          
          public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
          	double t_0 = Math.cos((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
          	double tmp;
          	if (y_46_im <= -2.55e+151) {
          		tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * t_0;
          	} else if ((y_46_im <= -9.2e+22) || !(y_46_im <= 2.3e-22)) {
          		tmp = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
          	} else {
          		tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * t_0;
          	}
          	return tmp;
          }
          
          def code(x_46_re, x_46_im, y_46_re, y_46_im):
          	t_0 = math.cos((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im))
          	tmp = 0
          	if y_46_im <= -2.55e+151:
          		tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * t_0
          	elif (y_46_im <= -9.2e+22) or not (y_46_im <= 2.3e-22):
          		tmp = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos((math.atan2(x_46_im, x_46_re) * y_46_re))
          	else:
          		tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * t_0
          	return tmp
          
          function code(x_46_re, x_46_im, y_46_re, y_46_im)
          	t_0 = cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))
          	tmp = 0.0
          	if (y_46_im <= -2.55e+151)
          		tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * t_0);
          	elseif ((y_46_im <= -9.2e+22) || !(y_46_im <= 2.3e-22))
          		tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(atan(x_46_im, x_46_re) * y_46_re)));
          	else
          		tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * t_0);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
          	t_0 = cos((log(hypot(x_46_im, x_46_re)) * y_46_im));
          	tmp = 0.0;
          	if (y_46_im <= -2.55e+151)
          		tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * t_0;
          	elseif ((y_46_im <= -9.2e+22) || ~((y_46_im <= 2.3e-22)))
          		tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos((atan2(x_46_im, x_46_re) * y_46_re));
          	else
          		tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * t_0;
          	end
          	tmp_2 = tmp;
          end
          
          code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -2.55e+151], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[Or[LessEqual[y$46$im, -9.2e+22], N[Not[LessEqual[y$46$im, 2.3e-22]], $MachinePrecision]], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
          \mathbf{if}\;y.im \leq -2.55 \cdot 10^{+151}:\\
          \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\
          
          \mathbf{elif}\;y.im \leq -9.2 \cdot 10^{+22} \lor \neg \left(y.im \leq 2.3 \cdot 10^{-22}\right):\\
          \;\;\;\;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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if y.im < -2.54999999999999998e151

            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. Add Preprocessing
            3. Taylor expanded in y.re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if -2.54999999999999998e151 < y.im < -9.2000000000000008e22 or 2.2999999999999998e-22 < y.im

            1. Initial program 35.6%

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

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

                \[\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)} \]
              2. *-commutativeN/A

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

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

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

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

            if -9.2000000000000008e22 < y.im < 2.2999999999999998e-22

            1. Initial program 32.2%

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

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

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

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

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

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

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

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

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

                \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
              3. lower-log.f64N/A

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

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

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

                \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
            8. Applied rewrites90.0%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -2.55 \cdot 10^{+151}:\\ \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\ \mathbf{elif}\;y.im \leq -9.2 \cdot 10^{+22} \lor \neg \left(y.im \leq 2.3 \cdot 10^{-22}\right):\\ \;\;\;\;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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 5: 77.9% accurate, 1.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ t_1 := \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\ \mathbf{if}\;y.re \leq -7.5 \cdot 10^{-17}:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot t\_0\\ \mathbf{elif}\;y.re \leq 2.9 \cdot 10^{+19}:\\ \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot t\_1\\ \end{array} \end{array} \]
          (FPCore (x.re x.im y.re y.im)
           :precision binary64
           (let* ((t_0 (pow (hypot x.im x.re) y.re))
                  (t_1 (cos (* (log (hypot x.im x.re)) y.im))))
             (if (<= y.re -7.5e-17)
               (* (sin (fma (atan2 x.im x.re) y.re (/ (PI) 2.0))) t_0)
               (if (<= y.re 2.9e+19)
                 (* (exp (* (- y.im) (atan2 x.im x.re))) t_1)
                 (* t_0 t_1)))))
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
          t_1 := \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
          \mathbf{if}\;y.re \leq -7.5 \cdot 10^{-17}:\\
          \;\;\;\;\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot t\_0\\
          
          \mathbf{elif}\;y.re \leq 2.9 \cdot 10^{+19}:\\
          \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_1\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0 \cdot t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if y.re < -7.49999999999999984e-17

            1. Initial program 32.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -7.49999999999999984e-17 < y.re < 2.9e19

              1. Initial program 40.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 2.9e19 < y.re

              1. Initial program 25.4%

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

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

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

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

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

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

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

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

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

                  \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                3. lower-log.f64N/A

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

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

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

                  \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
              8. Applied rewrites66.9%

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

            Alternative 6: 64.5% accurate, 1.3× speedup?

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

              1. Initial program 40.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto e^{\log \left(-x.im\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(-1 \cdot x.im\right) \cdot y.im\right) \]
              10. Step-by-step derivation
                1. Applied rewrites60.0%

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

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

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

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

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

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

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

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

                if -1.2000000000000001e146 < y.im < 6.80000000000000006e-103

                1. Initial program 30.5%

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

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

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

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

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

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

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

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

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

                    \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                  3. lower-log.f64N/A

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

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

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

                    \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
                8. Applied rewrites81.0%

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

                if 6.80000000000000006e-103 < y.im

                1. Initial program 37.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 7: 63.2% accurate, 1.6× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.im \leq -6 \cdot 10^{+155}:\\ \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\log \left(-x.im\right) \cdot y.im\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \end{array} \end{array} \]
              (FPCore (x.re x.im y.re y.im)
               :precision binary64
               (if (<= y.im -6e+155)
                 (* (exp (* (- y.im) (atan2 x.im x.re))) (cos (* (log (- x.im)) y.im)))
                 (*
                  (sin (fma (atan2 x.im x.re) y.re (/ (PI) 2.0)))
                  (pow (hypot x.im x.re) y.re))))
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;y.im \leq -6 \cdot 10^{+155}:\\
              \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\log \left(-x.im\right) \cdot y.im\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if y.im < -6.0000000000000003e155

                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. Add Preprocessing
                3. Taylor expanded in y.re around 0

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto e^{\log \left(-x.im\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(-1 \cdot x.im\right) \cdot y.im\right) \]
                10. Step-by-step derivation
                  1. Applied rewrites62.5%

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

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

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

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

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

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

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

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

                  if -6.0000000000000003e155 < y.im

                  1. Initial program 33.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}}^{y.re} \]
                  10. Recombined 2 regimes into one program.
                  11. Final simplification64.3%

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

                  Alternative 8: 57.2% accurate, 1.6× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ t_1 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{fma}\left(\frac{x.re \cdot x.re}{x.im}, 0.5, x.im\right)\right)}^{y.re}\\ \mathbf{if}\;y.re \leq -9.5 \cdot 10^{-6}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq 5 \cdot 10^{-24}:\\ \;\;\;\;\mathsf{fma}\left(t\_0, y.re, 1\right)\\ \mathbf{elif}\;y.re \leq 6.2 \cdot 10^{+157}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;{x.im}^{y.re} \cdot \cos \left(t\_0 \cdot y.im\right)\\ \end{array} \end{array} \]
                  (FPCore (x.re x.im y.re y.im)
                   :precision binary64
                   (let* ((t_0 (log (hypot x.im x.re)))
                          (t_1
                           (*
                            (cos (* (atan2 x.im x.re) y.re))
                            (pow (fma (/ (* x.re x.re) x.im) 0.5 x.im) y.re))))
                     (if (<= y.re -9.5e-6)
                       t_1
                       (if (<= y.re 5e-24)
                         (fma t_0 y.re 1.0)
                         (if (<= y.re 6.2e+157) t_1 (* (pow x.im y.re) (cos (* t_0 y.im))))))))
                  double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                  	double t_0 = log(hypot(x_46_im, x_46_re));
                  	double t_1 = cos((atan2(x_46_im, x_46_re) * y_46_re)) * pow(fma(((x_46_re * x_46_re) / x_46_im), 0.5, x_46_im), y_46_re);
                  	double tmp;
                  	if (y_46_re <= -9.5e-6) {
                  		tmp = t_1;
                  	} else if (y_46_re <= 5e-24) {
                  		tmp = fma(t_0, y_46_re, 1.0);
                  	} else if (y_46_re <= 6.2e+157) {
                  		tmp = t_1;
                  	} else {
                  		tmp = pow(x_46_im, y_46_re) * cos((t_0 * y_46_im));
                  	}
                  	return tmp;
                  }
                  
                  function code(x_46_re, x_46_im, y_46_re, y_46_im)
                  	t_0 = log(hypot(x_46_im, x_46_re))
                  	t_1 = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * (fma(Float64(Float64(x_46_re * x_46_re) / x_46_im), 0.5, x_46_im) ^ y_46_re))
                  	tmp = 0.0
                  	if (y_46_re <= -9.5e-6)
                  		tmp = t_1;
                  	elseif (y_46_re <= 5e-24)
                  		tmp = fma(t_0, y_46_re, 1.0);
                  	elseif (y_46_re <= 6.2e+157)
                  		tmp = t_1;
                  	else
                  		tmp = Float64((x_46_im ^ y_46_re) * cos(Float64(t_0 * y_46_im)));
                  	end
                  	return tmp
                  end
                  
                  code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Power[N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] * 0.5 + x$46$im), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -9.5e-6], t$95$1, If[LessEqual[y$46$re, 5e-24], N[(t$95$0 * y$46$re + 1.0), $MachinePrecision], If[LessEqual[y$46$re, 6.2e+157], t$95$1, N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * N[Cos[N[(t$95$0 * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
                  t_1 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{fma}\left(\frac{x.re \cdot x.re}{x.im}, 0.5, x.im\right)\right)}^{y.re}\\
                  \mathbf{if}\;y.re \leq -9.5 \cdot 10^{-6}:\\
                  \;\;\;\;t\_1\\
                  
                  \mathbf{elif}\;y.re \leq 5 \cdot 10^{-24}:\\
                  \;\;\;\;\mathsf{fma}\left(t\_0, y.re, 1\right)\\
                  
                  \mathbf{elif}\;y.re \leq 6.2 \cdot 10^{+157}:\\
                  \;\;\;\;t\_1\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;{x.im}^{y.re} \cdot \cos \left(t\_0 \cdot y.im\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if y.re < -9.5000000000000005e-6 or 4.9999999999999998e-24 < y.re < 6.1999999999999994e157

                    1. Initial program 31.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if -9.5000000000000005e-6 < y.re < 4.9999999999999998e-24

                      1. Initial program 39.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot 1 \]
                      10. Step-by-step derivation
                        1. Applied rewrites46.0%

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

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

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

                          if 6.1999999999999994e157 < y.re

                          1. Initial program 27.0%

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

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

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

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

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

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

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

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

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

                              \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                            3. lower-log.f64N/A

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

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

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

                              \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
                          8. Applied rewrites67.7%

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

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

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

                            \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -9.5 \cdot 10^{-6}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{fma}\left(\frac{x.re \cdot x.re}{x.im}, 0.5, x.im\right)\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq 5 \cdot 10^{-24}:\\ \;\;\;\;\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re, 1\right)\\ \mathbf{elif}\;y.re \leq 6.2 \cdot 10^{+157}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{fma}\left(\frac{x.re \cdot x.re}{x.im}, 0.5, x.im\right)\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;{x.im}^{y.re} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\ \end{array} \]
                          13. Add Preprocessing

                          Alternative 9: 62.8% accurate, 1.6× speedup?

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

                            1. Initial program 40.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto e^{\log \left(-x.im\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(-1 \cdot x.im\right) \cdot y.im\right) \]
                            10. Step-by-step derivation
                              1. Applied rewrites60.0%

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

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

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

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

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

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

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

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

                              if -6.0000000000000005e145 < y.im

                              1. Initial program 33.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            Alternative 10: 59.3% accurate, 1.6× speedup?

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

                              1. Initial program 32.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. Add Preprocessing
                              3. Taylor expanded in y.re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(-1 \cdot x.re\right)}^{y.re} \]
                              10. Step-by-step derivation
                                1. Applied rewrites46.6%

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

                                if -4.49999999999999994e-111 < x.re < -1.999999999999994e-310

                                1. Initial program 37.2%

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

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

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

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

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

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

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

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

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

                                    \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                                  3. lower-log.f64N/A

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

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

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

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

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

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

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

                                  if -1.999999999999994e-310 < x.re

                                  1. Initial program 34.8%

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

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

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

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

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

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

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

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

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

                                      \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                                    3. lower-log.f64N/A

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

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

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

                                      \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
                                  8. Applied rewrites62.7%

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

                                    \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \color{blue}{\log x.re}\right) \]
                                  10. Step-by-step derivation
                                    1. Applied rewrites62.7%

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

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

                                  Alternative 11: 62.0% accurate, 1.6× speedup?

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

                                    1. Initial program 33.3%

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

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

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

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

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

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

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

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

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

                                        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                                      3. lower-log.f64N/A

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

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

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

                                        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
                                    8. Applied rewrites56.4%

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

                                      \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\log \left(-1 \cdot x.re\right) \cdot y.im\right) \]
                                    10. Step-by-step derivation
                                      1. Applied rewrites53.8%

                                        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\log \left(-x.re\right) \cdot y.im\right) \]

                                      if -3.6e-299 < x.re

                                      1. Initial program 35.3%

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

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

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

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

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

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

                                          \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right) \cdot y.im\right) \]
                                        6. lower-hypot.f6457.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 \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
                                      5. Applied rewrites57.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 \cos \color{blue}{\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)} \]
                                      6. Taylor expanded in y.im around 0

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

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

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

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

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

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

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

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

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

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

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

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

                                    Alternative 12: 62.7% accurate, 1.6× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{if}\;x.im \leq -1 \cdot 10^{-310}:\\ \;\;\;\;t\_0 \cdot \cos \left(\log \left(-x.im\right) \cdot y.im\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \cos \left(\log x.im \cdot y.im\right)\\ \end{array} \end{array} \]
                                    (FPCore (x.re x.im y.re y.im)
                                     :precision binary64
                                     (let* ((t_0 (pow (hypot x.im x.re) y.re)))
                                       (if (<= x.im -1e-310)
                                         (* t_0 (cos (* (log (- x.im)) y.im)))
                                         (* t_0 (cos (* (log x.im) y.im))))))
                                    double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                    	double t_0 = pow(hypot(x_46_im, x_46_re), y_46_re);
                                    	double tmp;
                                    	if (x_46_im <= -1e-310) {
                                    		tmp = t_0 * cos((log(-x_46_im) * y_46_im));
                                    	} else {
                                    		tmp = t_0 * cos((log(x_46_im) * y_46_im));
                                    	}
                                    	return tmp;
                                    }
                                    
                                    public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                    	double t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
                                    	double tmp;
                                    	if (x_46_im <= -1e-310) {
                                    		tmp = t_0 * Math.cos((Math.log(-x_46_im) * y_46_im));
                                    	} else {
                                    		tmp = t_0 * Math.cos((Math.log(x_46_im) * y_46_im));
                                    	}
                                    	return tmp;
                                    }
                                    
                                    def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                    	t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re)
                                    	tmp = 0
                                    	if x_46_im <= -1e-310:
                                    		tmp = t_0 * math.cos((math.log(-x_46_im) * y_46_im))
                                    	else:
                                    		tmp = t_0 * math.cos((math.log(x_46_im) * y_46_im))
                                    	return tmp
                                    
                                    function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                    	t_0 = hypot(x_46_im, x_46_re) ^ y_46_re
                                    	tmp = 0.0
                                    	if (x_46_im <= -1e-310)
                                    		tmp = Float64(t_0 * cos(Float64(log(Float64(-x_46_im)) * y_46_im)));
                                    	else
                                    		tmp = Float64(t_0 * cos(Float64(log(x_46_im) * 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 = hypot(x_46_im, x_46_re) ^ y_46_re;
                                    	tmp = 0.0;
                                    	if (x_46_im <= -1e-310)
                                    		tmp = t_0 * cos((log(-x_46_im) * y_46_im));
                                    	else
                                    		tmp = t_0 * cos((log(x_46_im) * 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[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[x$46$im, -1e-310], N[(t$95$0 * N[Cos[N[(N[Log[(-x$46$im)], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Cos[N[(N[Log[x$46$im], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
                                    \mathbf{if}\;x.im \leq -1 \cdot 10^{-310}:\\
                                    \;\;\;\;t\_0 \cdot \cos \left(\log \left(-x.im\right) \cdot y.im\right)\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;t\_0 \cdot \cos \left(\log x.im \cdot y.im\right)\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 2 regimes
                                    2. if x.im < -9.999999999999969e-311

                                      1. Initial program 33.8%

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

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

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

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

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

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

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

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

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

                                          \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                                        3. lower-log.f64N/A

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

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

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

                                          \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
                                      8. Applied rewrites58.7%

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

                                        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\log \left(-1 \cdot x.im\right) \cdot y.im\right) \]
                                      10. Step-by-step derivation
                                        1. Applied rewrites58.9%

                                          \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\log \left(-x.im\right) \cdot y.im\right) \]

                                        if -9.999999999999969e-311 < x.im

                                        1. Initial program 35.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. Add Preprocessing
                                        3. Taylor expanded in y.im around 0

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

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

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

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

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

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

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

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

                                            \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                                          3. lower-log.f64N/A

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

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

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

                                            \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
                                        8. Applied rewrites61.4%

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

                                          \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \color{blue}{\log x.im}\right) \]
                                        10. Step-by-step derivation
                                          1. Applied rewrites61.5%

                                            \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\log x.im \cdot \color{blue}{y.im}\right) \]
                                        11. Recombined 2 regimes into one program.
                                        12. Final simplification60.1%

                                          \[\leadsto \begin{array}{l} \mathbf{if}\;x.im \leq -1 \cdot 10^{-310}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\log \left(-x.im\right) \cdot y.im\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\log x.im \cdot y.im\right)\\ \end{array} \]
                                        13. Add Preprocessing

                                        Alternative 13: 59.8% accurate, 1.6× speedup?

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

                                          1. Initial program 35.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          if 1.3e158 < y.re

                                          1. Initial program 27.0%

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

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

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

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

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

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

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

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

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

                                              \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                                            3. lower-log.f64N/A

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

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

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

                                              \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
                                          8. Applied rewrites67.7%

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

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

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

                                          Alternative 14: 55.2% accurate, 2.0× speedup?

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

                                            1. Initial program 33.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              if -9.5000000000000005e-6 < y.re < 6.4999999999999994e-151

                                              1. Initial program 39.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot 1 \]
                                              10. Step-by-step derivation
                                                1. Applied rewrites49.8%

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

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

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

                                                  if 6.4999999999999994e-151 < y.re

                                                  1. Initial program 30.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. Add Preprocessing
                                                  3. Taylor expanded in y.re around 0

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

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

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

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

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

                                                      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right) \cdot y.im\right) \]
                                                    6. lower-hypot.f6464.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 \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
                                                  5. Applied rewrites64.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 \cos \color{blue}{\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)} \]
                                                  6. Taylor expanded in y.im around 0

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

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

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

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

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

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

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

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

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

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

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

                                                    \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(x.re + \frac{1}{2} \cdot \frac{{x.im}^{2}}{x.re}\right)}^{y.re} \]
                                                  10. Step-by-step derivation
                                                    1. Applied rewrites41.8%

                                                      \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re} \]
                                                  11. Recombined 3 regimes into one program.
                                                  12. Final simplification54.7%

                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -9.5 \cdot 10^{-6}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{fma}\left(\frac{x.re \cdot x.re}{x.im}, 0.5, x.im\right)\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq 6.5 \cdot 10^{-151}:\\ \;\;\;\;\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re}\\ \end{array} \]
                                                  13. Add Preprocessing

                                                  Alternative 15: 53.8% accurate, 2.1× speedup?

                                                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{if}\;x.re \leq -3 \cdot 10^{-105}:\\ \;\;\;\;t\_0 \cdot {\left(-x.re\right)}^{y.re}\\ \mathbf{elif}\;x.re \leq 7.2 \cdot 10^{-299}:\\ \;\;\;\;t\_0 \cdot {\left(-x.im\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot {x.re}^{y.re}\\ \end{array} \end{array} \]
                                                  (FPCore (x.re x.im y.re y.im)
                                                   :precision binary64
                                                   (let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
                                                     (if (<= x.re -3e-105)
                                                       (* t_0 (pow (- x.re) y.re))
                                                       (if (<= x.re 7.2e-299)
                                                         (* t_0 (pow (- x.im) y.re))
                                                         (* t_0 (pow 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 = cos((atan2(x_46_im, x_46_re) * y_46_re));
                                                  	double tmp;
                                                  	if (x_46_re <= -3e-105) {
                                                  		tmp = t_0 * pow(-x_46_re, y_46_re);
                                                  	} else if (x_46_re <= 7.2e-299) {
                                                  		tmp = t_0 * pow(-x_46_im, y_46_re);
                                                  	} else {
                                                  		tmp = t_0 * pow(x_46_re, y_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) :: t_0
                                                      real(8) :: tmp
                                                      t_0 = cos((atan2(x_46im, x_46re) * y_46re))
                                                      if (x_46re <= (-3d-105)) then
                                                          tmp = t_0 * (-x_46re ** y_46re)
                                                      else if (x_46re <= 7.2d-299) then
                                                          tmp = t_0 * (-x_46im ** y_46re)
                                                      else
                                                          tmp = t_0 * (x_46re ** y_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 t_0 = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
                                                  	double tmp;
                                                  	if (x_46_re <= -3e-105) {
                                                  		tmp = t_0 * Math.pow(-x_46_re, y_46_re);
                                                  	} else if (x_46_re <= 7.2e-299) {
                                                  		tmp = t_0 * Math.pow(-x_46_im, y_46_re);
                                                  	} else {
                                                  		tmp = t_0 * Math.pow(x_46_re, y_46_re);
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                                  	t_0 = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re))
                                                  	tmp = 0
                                                  	if x_46_re <= -3e-105:
                                                  		tmp = t_0 * math.pow(-x_46_re, y_46_re)
                                                  	elif x_46_re <= 7.2e-299:
                                                  		tmp = t_0 * math.pow(-x_46_im, y_46_re)
                                                  	else:
                                                  		tmp = t_0 * math.pow(x_46_re, y_46_re)
                                                  	return tmp
                                                  
                                                  function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                  	t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re))
                                                  	tmp = 0.0
                                                  	if (x_46_re <= -3e-105)
                                                  		tmp = Float64(t_0 * (Float64(-x_46_re) ^ y_46_re));
                                                  	elseif (x_46_re <= 7.2e-299)
                                                  		tmp = Float64(t_0 * (Float64(-x_46_im) ^ y_46_re));
                                                  	else
                                                  		tmp = Float64(t_0 * (x_46_re ^ y_46_re));
                                                  	end
                                                  	return tmp
                                                  end
                                                  
                                                  function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                  	t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
                                                  	tmp = 0.0;
                                                  	if (x_46_re <= -3e-105)
                                                  		tmp = t_0 * (-x_46_re ^ y_46_re);
                                                  	elseif (x_46_re <= 7.2e-299)
                                                  		tmp = t_0 * (-x_46_im ^ y_46_re);
                                                  	else
                                                  		tmp = t_0 * (x_46_re ^ y_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[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -3e-105], N[(t$95$0 * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 7.2e-299], N[(t$95$0 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]]
                                                  
                                                  \begin{array}{l}
                                                  
                                                  \\
                                                  \begin{array}{l}
                                                  t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
                                                  \mathbf{if}\;x.re \leq -3 \cdot 10^{-105}:\\
                                                  \;\;\;\;t\_0 \cdot {\left(-x.re\right)}^{y.re}\\
                                                  
                                                  \mathbf{elif}\;x.re \leq 7.2 \cdot 10^{-299}:\\
                                                  \;\;\;\;t\_0 \cdot {\left(-x.im\right)}^{y.re}\\
                                                  
                                                  \mathbf{else}:\\
                                                  \;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
                                                  
                                                  
                                                  \end{array}
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 3 regimes
                                                  2. if x.re < -3.0000000000000001e-105

                                                    1. Initial program 31.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(-1 \cdot x.re\right)}^{y.re} \]
                                                    10. Step-by-step derivation
                                                      1. Applied rewrites46.5%

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

                                                      if -3.0000000000000001e-105 < x.re < 7.2e-299

                                                      1. Initial program 37.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                        \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(-1 \cdot x.im\right)}^{y.re} \]
                                                      10. Step-by-step derivation
                                                        1. Applied rewrites44.3%

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

                                                        if 7.2e-299 < x.re

                                                        1. Initial program 34.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                            \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.re}^{\color{blue}{y.re}} \]
                                                        11. Recombined 3 regimes into one program.
                                                        12. Final simplification53.8%

                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;x.re \leq -3 \cdot 10^{-105}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(-x.re\right)}^{y.re}\\ \mathbf{elif}\;x.re \leq 7.2 \cdot 10^{-299}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(-x.im\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.re}^{y.re}\\ \end{array} \]
                                                        13. Add Preprocessing

                                                        Alternative 16: 52.7% accurate, 2.1× speedup?

                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -4.8 \cdot 10^{+14} \lor \neg \left(y.re \leq 7.8 \cdot 10^{-6}\right):\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.re}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re, 1\right)\\ \end{array} \end{array} \]
                                                        (FPCore (x.re x.im y.re y.im)
                                                         :precision binary64
                                                         (if (or (<= y.re -4.8e+14) (not (<= y.re 7.8e-6)))
                                                           (* (cos (* (atan2 x.im x.re) y.re)) (pow x.re y.re))
                                                           (fma (log (hypot x.im x.re)) y.re 1.0)))
                                                        double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                        	double tmp;
                                                        	if ((y_46_re <= -4.8e+14) || !(y_46_re <= 7.8e-6)) {
                                                        		tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * pow(x_46_re, y_46_re);
                                                        	} else {
                                                        		tmp = fma(log(hypot(x_46_im, x_46_re)), y_46_re, 1.0);
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                        	tmp = 0.0
                                                        	if ((y_46_re <= -4.8e+14) || !(y_46_re <= 7.8e-6))
                                                        		tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * (x_46_re ^ y_46_re));
                                                        	else
                                                        		tmp = fma(log(hypot(x_46_im, x_46_re)), y_46_re, 1.0);
                                                        	end
                                                        	return tmp
                                                        end
                                                        
                                                        code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -4.8e+14], N[Not[LessEqual[y$46$re, 7.8e-6]], $MachinePrecision]], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + 1.0), $MachinePrecision]]
                                                        
                                                        \begin{array}{l}
                                                        
                                                        \\
                                                        \begin{array}{l}
                                                        \mathbf{if}\;y.re \leq -4.8 \cdot 10^{+14} \lor \neg \left(y.re \leq 7.8 \cdot 10^{-6}\right):\\
                                                        \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.re}^{y.re}\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re, 1\right)\\
                                                        
                                                        
                                                        \end{array}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 2 regimes
                                                        2. if y.re < -4.8e14 or 7.7999999999999999e-6 < y.re

                                                          1. Initial program 29.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                            if -4.8e14 < y.re < 7.7999999999999999e-6

                                                            1. Initial program 40.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                              \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot 1 \]
                                                            10. Step-by-step derivation
                                                              1. Applied rewrites43.6%

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

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

                                                                  \[\leadsto \mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), \color{blue}{y.re}, 1\right) \]
                                                              4. Recombined 2 regimes into one program.
                                                              5. Final simplification50.1%

                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -4.8 \cdot 10^{+14} \lor \neg \left(y.re \leq 7.8 \cdot 10^{-6}\right):\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.re}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re, 1\right)\\ \end{array} \]
                                                              6. Add Preprocessing

                                                              Alternative 17: 50.3% accurate, 2.1× speedup?

                                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -58 \lor \neg \left(y.re \leq 1.32 \cdot 10^{+23}\right):\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re, 1\right)\\ \end{array} \end{array} \]
                                                              (FPCore (x.re x.im y.re y.im)
                                                               :precision binary64
                                                               (if (or (<= y.re -58.0) (not (<= y.re 1.32e+23)))
                                                                 (* (cos (* (atan2 x.im x.re) y.re)) (pow x.im y.re))
                                                                 (fma (log (hypot x.im x.re)) y.re 1.0)))
                                                              double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                              	double tmp;
                                                              	if ((y_46_re <= -58.0) || !(y_46_re <= 1.32e+23)) {
                                                              		tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * pow(x_46_im, y_46_re);
                                                              	} else {
                                                              		tmp = fma(log(hypot(x_46_im, x_46_re)), y_46_re, 1.0);
                                                              	}
                                                              	return tmp;
                                                              }
                                                              
                                                              function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                              	tmp = 0.0
                                                              	if ((y_46_re <= -58.0) || !(y_46_re <= 1.32e+23))
                                                              		tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * (x_46_im ^ y_46_re));
                                                              	else
                                                              		tmp = fma(log(hypot(x_46_im, x_46_re)), y_46_re, 1.0);
                                                              	end
                                                              	return tmp
                                                              end
                                                              
                                                              code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -58.0], N[Not[LessEqual[y$46$re, 1.32e+23]], $MachinePrecision]], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + 1.0), $MachinePrecision]]
                                                              
                                                              \begin{array}{l}
                                                              
                                                              \\
                                                              \begin{array}{l}
                                                              \mathbf{if}\;y.re \leq -58 \lor \neg \left(y.re \leq 1.32 \cdot 10^{+23}\right):\\
                                                              \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{y.re}\\
                                                              
                                                              \mathbf{else}:\\
                                                              \;\;\;\;\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re, 1\right)\\
                                                              
                                                              
                                                              \end{array}
                                                              \end{array}
                                                              
                                                              Derivation
                                                              1. Split input into 2 regimes
                                                              2. if y.re < -58 or 1.3199999999999999e23 < y.re

                                                                1. Initial program 29.6%

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

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

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

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

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

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

                                                                    \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right) \cdot y.im\right) \]
                                                                  6. lower-hypot.f6477.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 \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
                                                                5. Applied rewrites77.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 \cos \color{blue}{\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)} \]
                                                                6. Taylor expanded in y.im around 0

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

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

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

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

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

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

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

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

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

                                                                    \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}}^{y.re} \]
                                                                8. Applied rewrites65.3%

                                                                  \[\leadsto \color{blue}{\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}} \]
                                                                9. Taylor expanded in x.re around 0

                                                                  \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{\color{blue}{y.re}} \]
                                                                10. Step-by-step derivation
                                                                  1. Applied rewrites46.5%

                                                                    \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{\color{blue}{y.re}} \]

                                                                  if -58 < y.re < 1.3199999999999999e23

                                                                  1. Initial program 39.7%

                                                                    \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                                                  2. Add Preprocessing
                                                                  3. Taylor expanded in y.re around 0

                                                                    \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)} \]
                                                                  4. Step-by-step derivation
                                                                    1. *-commutativeN/A

                                                                      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                                                                    2. lower-*.f64N/A

                                                                      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                                                                    3. lower-log.f64N/A

                                                                      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)} \cdot y.im\right) \]
                                                                    4. unpow2N/A

                                                                      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right) \cdot y.im\right) \]
                                                                    5. unpow2N/A

                                                                      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right) \cdot y.im\right) \]
                                                                    6. lower-hypot.f6446.3

                                                                      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
                                                                  5. Applied rewrites46.3%

                                                                    \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)} \]
                                                                  6. Taylor expanded in y.im around 0

                                                                    \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                  7. Step-by-step derivation
                                                                    1. lower-*.f64N/A

                                                                      \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                    2. lower-cos.f64N/A

                                                                      \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                    3. *-commutativeN/A

                                                                      \[\leadsto \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                    4. lower-*.f64N/A

                                                                      \[\leadsto \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                    5. lower-atan2.f64N/A

                                                                      \[\leadsto \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                    6. lower-pow.f64N/A

                                                                      \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                    7. unpow2N/A

                                                                      \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right)}^{y.re} \]
                                                                    8. unpow2N/A

                                                                      \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)}^{y.re} \]
                                                                    9. lower-hypot.f6445.4

                                                                      \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}}^{y.re} \]
                                                                  8. Applied rewrites45.4%

                                                                    \[\leadsto \color{blue}{\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}} \]
                                                                  9. Taylor expanded in y.re around 0

                                                                    \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot 1 \]
                                                                  10. Step-by-step derivation
                                                                    1. Applied rewrites42.0%

                                                                      \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot 1 \]
                                                                    2. Taylor expanded in y.re around 0

                                                                      \[\leadsto 1 + \color{blue}{y.re \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)} \]
                                                                    3. Step-by-step derivation
                                                                      1. Applied rewrites42.6%

                                                                        \[\leadsto \mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), \color{blue}{y.re}, 1\right) \]
                                                                    4. Recombined 2 regimes into one program.
                                                                    5. Final simplification44.6%

                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -58 \lor \neg \left(y.re \leq 1.32 \cdot 10^{+23}\right):\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re, 1\right)\\ \end{array} \]
                                                                    6. Add Preprocessing

                                                                    Alternative 18: 53.9% accurate, 2.1× speedup?

                                                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{if}\;x.im \leq -4.9 \cdot 10^{-40}:\\ \;\;\;\;t\_0 \cdot {\left(-x.im\right)}^{y.re}\\ \mathbf{elif}\;x.im \leq 0.000105:\\ \;\;\;\;t\_0 \cdot {x.re}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot {x.im}^{y.re}\\ \end{array} \end{array} \]
                                                                    (FPCore (x.re x.im y.re y.im)
                                                                     :precision binary64
                                                                     (let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
                                                                       (if (<= x.im -4.9e-40)
                                                                         (* t_0 (pow (- x.im) y.re))
                                                                         (if (<= x.im 0.000105) (* t_0 (pow x.re y.re)) (* t_0 (pow x.im y.re))))))
                                                                    double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                    	double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
                                                                    	double tmp;
                                                                    	if (x_46_im <= -4.9e-40) {
                                                                    		tmp = t_0 * pow(-x_46_im, y_46_re);
                                                                    	} else if (x_46_im <= 0.000105) {
                                                                    		tmp = t_0 * pow(x_46_re, y_46_re);
                                                                    	} else {
                                                                    		tmp = t_0 * pow(x_46_im, y_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) :: t_0
                                                                        real(8) :: tmp
                                                                        t_0 = cos((atan2(x_46im, x_46re) * y_46re))
                                                                        if (x_46im <= (-4.9d-40)) then
                                                                            tmp = t_0 * (-x_46im ** y_46re)
                                                                        else if (x_46im <= 0.000105d0) then
                                                                            tmp = t_0 * (x_46re ** y_46re)
                                                                        else
                                                                            tmp = t_0 * (x_46im ** y_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 t_0 = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
                                                                    	double tmp;
                                                                    	if (x_46_im <= -4.9e-40) {
                                                                    		tmp = t_0 * Math.pow(-x_46_im, y_46_re);
                                                                    	} else if (x_46_im <= 0.000105) {
                                                                    		tmp = t_0 * Math.pow(x_46_re, y_46_re);
                                                                    	} else {
                                                                    		tmp = t_0 * Math.pow(x_46_im, y_46_re);
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                                                    	t_0 = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re))
                                                                    	tmp = 0
                                                                    	if x_46_im <= -4.9e-40:
                                                                    		tmp = t_0 * math.pow(-x_46_im, y_46_re)
                                                                    	elif x_46_im <= 0.000105:
                                                                    		tmp = t_0 * math.pow(x_46_re, y_46_re)
                                                                    	else:
                                                                    		tmp = t_0 * math.pow(x_46_im, y_46_re)
                                                                    	return tmp
                                                                    
                                                                    function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                    	t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re))
                                                                    	tmp = 0.0
                                                                    	if (x_46_im <= -4.9e-40)
                                                                    		tmp = Float64(t_0 * (Float64(-x_46_im) ^ y_46_re));
                                                                    	elseif (x_46_im <= 0.000105)
                                                                    		tmp = Float64(t_0 * (x_46_re ^ y_46_re));
                                                                    	else
                                                                    		tmp = Float64(t_0 * (x_46_im ^ y_46_re));
                                                                    	end
                                                                    	return tmp
                                                                    end
                                                                    
                                                                    function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                    	t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
                                                                    	tmp = 0.0;
                                                                    	if (x_46_im <= -4.9e-40)
                                                                    		tmp = t_0 * (-x_46_im ^ y_46_re);
                                                                    	elseif (x_46_im <= 0.000105)
                                                                    		tmp = t_0 * (x_46_re ^ y_46_re);
                                                                    	else
                                                                    		tmp = t_0 * (x_46_im ^ y_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[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -4.9e-40], N[(t$95$0 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 0.000105], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]]
                                                                    
                                                                    \begin{array}{l}
                                                                    
                                                                    \\
                                                                    \begin{array}{l}
                                                                    t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
                                                                    \mathbf{if}\;x.im \leq -4.9 \cdot 10^{-40}:\\
                                                                    \;\;\;\;t\_0 \cdot {\left(-x.im\right)}^{y.re}\\
                                                                    
                                                                    \mathbf{elif}\;x.im \leq 0.000105:\\
                                                                    \;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
                                                                    
                                                                    \mathbf{else}:\\
                                                                    \;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
                                                                    
                                                                    
                                                                    \end{array}
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Split input into 3 regimes
                                                                    2. if x.im < -4.8999999999999997e-40

                                                                      1. Initial program 34.6%

                                                                        \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                                                      2. Add Preprocessing
                                                                      3. Taylor expanded in y.re around 0

                                                                        \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)} \]
                                                                      4. Step-by-step derivation
                                                                        1. *-commutativeN/A

                                                                          \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                                                                        2. lower-*.f64N/A

                                                                          \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                                                                        3. lower-log.f64N/A

                                                                          \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)} \cdot y.im\right) \]
                                                                        4. unpow2N/A

                                                                          \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right) \cdot y.im\right) \]
                                                                        5. unpow2N/A

                                                                          \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right) \cdot y.im\right) \]
                                                                        6. lower-hypot.f6469.3

                                                                          \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
                                                                      5. Applied rewrites69.3%

                                                                        \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)} \]
                                                                      6. Taylor expanded in y.im around 0

                                                                        \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                      7. Step-by-step derivation
                                                                        1. lower-*.f64N/A

                                                                          \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                        2. lower-cos.f64N/A

                                                                          \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                        3. *-commutativeN/A

                                                                          \[\leadsto \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                        4. lower-*.f64N/A

                                                                          \[\leadsto \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                        5. lower-atan2.f64N/A

                                                                          \[\leadsto \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                        6. lower-pow.f64N/A

                                                                          \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                        7. unpow2N/A

                                                                          \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right)}^{y.re} \]
                                                                        8. unpow2N/A

                                                                          \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)}^{y.re} \]
                                                                        9. lower-hypot.f6454.6

                                                                          \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}}^{y.re} \]
                                                                      8. Applied rewrites54.6%

                                                                        \[\leadsto \color{blue}{\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}} \]
                                                                      9. Taylor expanded in x.im around -inf

                                                                        \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(-1 \cdot x.im\right)}^{y.re} \]
                                                                      10. Step-by-step derivation
                                                                        1. Applied rewrites53.3%

                                                                          \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(-x.im\right)}^{y.re} \]

                                                                        if -4.8999999999999997e-40 < x.im < 1.05e-4

                                                                        1. Initial program 37.6%

                                                                          \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                                                        2. Add Preprocessing
                                                                        3. Taylor expanded in y.re around 0

                                                                          \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)} \]
                                                                        4. Step-by-step derivation
                                                                          1. *-commutativeN/A

                                                                            \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                                                                          2. lower-*.f64N/A

                                                                            \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                                                                          3. lower-log.f64N/A

                                                                            \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)} \cdot y.im\right) \]
                                                                          4. unpow2N/A

                                                                            \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right) \cdot y.im\right) \]
                                                                          5. unpow2N/A

                                                                            \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right) \cdot y.im\right) \]
                                                                          6. lower-hypot.f6462.9

                                                                            \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
                                                                        5. Applied rewrites62.9%

                                                                          \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)} \]
                                                                        6. Taylor expanded in y.im around 0

                                                                          \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                        7. Step-by-step derivation
                                                                          1. lower-*.f64N/A

                                                                            \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                          2. lower-cos.f64N/A

                                                                            \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                          3. *-commutativeN/A

                                                                            \[\leadsto \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                          4. lower-*.f64N/A

                                                                            \[\leadsto \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                          5. lower-atan2.f64N/A

                                                                            \[\leadsto \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                          6. lower-pow.f64N/A

                                                                            \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                          7. unpow2N/A

                                                                            \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right)}^{y.re} \]
                                                                          8. unpow2N/A

                                                                            \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)}^{y.re} \]
                                                                          9. lower-hypot.f6458.2

                                                                            \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}}^{y.re} \]
                                                                        8. Applied rewrites58.2%

                                                                          \[\leadsto \color{blue}{\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}} \]
                                                                        9. Taylor expanded in x.im around 0

                                                                          \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.re}^{\color{blue}{y.re}} \]
                                                                        10. Step-by-step derivation
                                                                          1. Applied rewrites52.0%

                                                                            \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.re}^{\color{blue}{y.re}} \]

                                                                          if 1.05e-4 < x.im

                                                                          1. Initial program 26.4%

                                                                            \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                                                          2. Add Preprocessing
                                                                          3. Taylor expanded in y.re around 0

                                                                            \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)} \]
                                                                          4. Step-by-step derivation
                                                                            1. *-commutativeN/A

                                                                              \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                                                                            2. lower-*.f64N/A

                                                                              \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                                                                            3. lower-log.f64N/A

                                                                              \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)} \cdot y.im\right) \]
                                                                            4. unpow2N/A

                                                                              \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right) \cdot y.im\right) \]
                                                                            5. unpow2N/A

                                                                              \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right) \cdot y.im\right) \]
                                                                            6. lower-hypot.f6451.7

                                                                              \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
                                                                          5. Applied rewrites51.7%

                                                                            \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)} \]
                                                                          6. Taylor expanded in y.im around 0

                                                                            \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                          7. Step-by-step derivation
                                                                            1. lower-*.f64N/A

                                                                              \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                            2. lower-cos.f64N/A

                                                                              \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                            3. *-commutativeN/A

                                                                              \[\leadsto \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                            4. lower-*.f64N/A

                                                                              \[\leadsto \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                            5. lower-atan2.f64N/A

                                                                              \[\leadsto \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                            6. lower-pow.f64N/A

                                                                              \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                            7. unpow2N/A

                                                                              \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right)}^{y.re} \]
                                                                            8. unpow2N/A

                                                                              \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)}^{y.re} \]
                                                                            9. lower-hypot.f6452.4

                                                                              \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}}^{y.re} \]
                                                                          8. Applied rewrites52.4%

                                                                            \[\leadsto \color{blue}{\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}} \]
                                                                          9. Taylor expanded in x.re around 0

                                                                            \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{\color{blue}{y.re}} \]
                                                                          10. Step-by-step derivation
                                                                            1. Applied rewrites52.4%

                                                                              \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{\color{blue}{y.re}} \]
                                                                          11. Recombined 3 regimes into one program.
                                                                          12. Final simplification52.5%

                                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;x.im \leq -4.9 \cdot 10^{-40}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(-x.im\right)}^{y.re}\\ \mathbf{elif}\;x.im \leq 0.000105:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.re}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{y.re}\\ \end{array} \]
                                                                          13. Add Preprocessing

                                                                          Alternative 19: 30.3% accurate, 3.0× speedup?

                                                                          \[\begin{array}{l} \\ \mathsf{fma}\left(-0.5 \cdot \left(y.re \cdot y.re\right), {\tan^{-1}_* \frac{x.im}{x.re}}^{2}, 1\right) \cdot 1 \end{array} \]
                                                                          (FPCore (x.re x.im y.re y.im)
                                                                           :precision binary64
                                                                           (* (fma (* -0.5 (* y.re y.re)) (pow (atan2 x.im x.re) 2.0) 1.0) 1.0))
                                                                          double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                          	return fma((-0.5 * (y_46_re * y_46_re)), pow(atan2(x_46_im, x_46_re), 2.0), 1.0) * 1.0;
                                                                          }
                                                                          
                                                                          function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                          	return Float64(fma(Float64(-0.5 * Float64(y_46_re * y_46_re)), (atan(x_46_im, x_46_re) ^ 2.0), 1.0) * 1.0)
                                                                          end
                                                                          
                                                                          code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(-0.5 * N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision] * 1.0), $MachinePrecision]
                                                                          
                                                                          \begin{array}{l}
                                                                          
                                                                          \\
                                                                          \mathsf{fma}\left(-0.5 \cdot \left(y.re \cdot y.re\right), {\tan^{-1}_* \frac{x.im}{x.re}}^{2}, 1\right) \cdot 1
                                                                          \end{array}
                                                                          
                                                                          Derivation
                                                                          1. Initial program 34.4%

                                                                            \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                                                          2. Add Preprocessing
                                                                          3. Taylor expanded in y.re around 0

                                                                            \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)} \]
                                                                          4. Step-by-step derivation
                                                                            1. *-commutativeN/A

                                                                              \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                                                                            2. lower-*.f64N/A

                                                                              \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                                                                            3. lower-log.f64N/A

                                                                              \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)} \cdot y.im\right) \]
                                                                            4. unpow2N/A

                                                                              \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right) \cdot y.im\right) \]
                                                                            5. unpow2N/A

                                                                              \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right) \cdot y.im\right) \]
                                                                            6. lower-hypot.f6462.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 \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
                                                                          5. Applied rewrites62.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 \cos \color{blue}{\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)} \]
                                                                          6. Taylor expanded in y.im around 0

                                                                            \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                          7. Step-by-step derivation
                                                                            1. lower-*.f64N/A

                                                                              \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                            2. lower-cos.f64N/A

                                                                              \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                            3. *-commutativeN/A

                                                                              \[\leadsto \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                            4. lower-*.f64N/A

                                                                              \[\leadsto \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                            5. lower-atan2.f64N/A

                                                                              \[\leadsto \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                            6. lower-pow.f64N/A

                                                                              \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                            7. unpow2N/A

                                                                              \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right)}^{y.re} \]
                                                                            8. unpow2N/A

                                                                              \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)}^{y.re} \]
                                                                            9. lower-hypot.f6455.9

                                                                              \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}}^{y.re} \]
                                                                          8. Applied rewrites55.9%

                                                                            \[\leadsto \color{blue}{\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}} \]
                                                                          9. Taylor expanded in y.re around 0

                                                                            \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot 1 \]
                                                                          10. Step-by-step derivation
                                                                            1. Applied rewrites21.2%

                                                                              \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot 1 \]
                                                                            2. Taylor expanded in y.re around 0

                                                                              \[\leadsto \left(1 + \frac{-1}{2} \cdot \left({y.re}^{2} \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)\right) \cdot 1 \]
                                                                            3. Step-by-step derivation
                                                                              1. Applied rewrites28.0%

                                                                                \[\leadsto \mathsf{fma}\left(-0.5 \cdot \left(y.re \cdot y.re\right), {\tan^{-1}_* \frac{x.im}{x.re}}^{2}, 1\right) \cdot 1 \]
                                                                              2. Add Preprocessing

                                                                              Alternative 20: 26.9% accurate, 3.3× speedup?

                                                                              \[\begin{array}{l} \\ \mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re, 1\right) \end{array} \]
                                                                              (FPCore (x.re x.im y.re y.im)
                                                                               :precision binary64
                                                                               (fma (log (hypot x.im x.re)) y.re 1.0))
                                                                              double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                              	return fma(log(hypot(x_46_im, x_46_re)), y_46_re, 1.0);
                                                                              }
                                                                              
                                                                              function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                              	return fma(log(hypot(x_46_im, x_46_re)), y_46_re, 1.0)
                                                                              end
                                                                              
                                                                              code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + 1.0), $MachinePrecision]
                                                                              
                                                                              \begin{array}{l}
                                                                              
                                                                              \\
                                                                              \mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re, 1\right)
                                                                              \end{array}
                                                                              
                                                                              Derivation
                                                                              1. Initial program 34.4%

                                                                                \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                                                              2. Add Preprocessing
                                                                              3. Taylor expanded in y.re around 0

                                                                                \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)} \]
                                                                              4. Step-by-step derivation
                                                                                1. *-commutativeN/A

                                                                                  \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                                                                                2. lower-*.f64N/A

                                                                                  \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                                                                                3. lower-log.f64N/A

                                                                                  \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)} \cdot y.im\right) \]
                                                                                4. unpow2N/A

                                                                                  \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right) \cdot y.im\right) \]
                                                                                5. unpow2N/A

                                                                                  \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right) \cdot y.im\right) \]
                                                                                6. lower-hypot.f6462.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 \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
                                                                              5. Applied rewrites62.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 \cos \color{blue}{\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)} \]
                                                                              6. Taylor expanded in y.im around 0

                                                                                \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                              7. Step-by-step derivation
                                                                                1. lower-*.f64N/A

                                                                                  \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                                2. lower-cos.f64N/A

                                                                                  \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                                3. *-commutativeN/A

                                                                                  \[\leadsto \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                                4. lower-*.f64N/A

                                                                                  \[\leadsto \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                                5. lower-atan2.f64N/A

                                                                                  \[\leadsto \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                                6. lower-pow.f64N/A

                                                                                  \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                                7. unpow2N/A

                                                                                  \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right)}^{y.re} \]
                                                                                8. unpow2N/A

                                                                                  \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)}^{y.re} \]
                                                                                9. lower-hypot.f6455.9

                                                                                  \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}}^{y.re} \]
                                                                              8. Applied rewrites55.9%

                                                                                \[\leadsto \color{blue}{\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}} \]
                                                                              9. Taylor expanded in y.re around 0

                                                                                \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot 1 \]
                                                                              10. Step-by-step derivation
                                                                                1. Applied rewrites21.2%

                                                                                  \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot 1 \]
                                                                                2. Taylor expanded in y.re around 0

                                                                                  \[\leadsto 1 + \color{blue}{y.re \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)} \]
                                                                                3. Step-by-step derivation
                                                                                  1. Applied rewrites21.5%

                                                                                    \[\leadsto \mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), \color{blue}{y.re}, 1\right) \]
                                                                                  2. Add Preprocessing

                                                                                  Alternative 21: 26.4% accurate, 680.0× speedup?

                                                                                  \[\begin{array}{l} \\ 1 \end{array} \]
                                                                                  (FPCore (x.re x.im y.re y.im) :precision binary64 1.0)
                                                                                  double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                  	return 1.0;
                                                                                  }
                                                                                  
                                                                                  real(8) function code(x_46re, x_46im, y_46re, y_46im)
                                                                                      real(8), intent (in) :: x_46re
                                                                                      real(8), intent (in) :: x_46im
                                                                                      real(8), intent (in) :: y_46re
                                                                                      real(8), intent (in) :: y_46im
                                                                                      code = 1.0d0
                                                                                  end function
                                                                                  
                                                                                  public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                  	return 1.0;
                                                                                  }
                                                                                  
                                                                                  def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                                                                  	return 1.0
                                                                                  
                                                                                  function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                  	return 1.0
                                                                                  end
                                                                                  
                                                                                  function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                  	tmp = 1.0;
                                                                                  end
                                                                                  
                                                                                  code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 1.0
                                                                                  
                                                                                  \begin{array}{l}
                                                                                  
                                                                                  \\
                                                                                  1
                                                                                  \end{array}
                                                                                  
                                                                                  Derivation
                                                                                  1. Initial program 34.4%

                                                                                    \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                                                                  2. Add Preprocessing
                                                                                  3. Taylor expanded in y.re around 0

                                                                                    \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)} \]
                                                                                  4. Step-by-step derivation
                                                                                    1. *-commutativeN/A

                                                                                      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                                                                                    2. lower-*.f64N/A

                                                                                      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot y.im\right)} \]
                                                                                    3. lower-log.f64N/A

                                                                                      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)} \cdot y.im\right) \]
                                                                                    4. unpow2N/A

                                                                                      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right) \cdot y.im\right) \]
                                                                                    5. unpow2N/A

                                                                                      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right) \cdot y.im\right) \]
                                                                                    6. lower-hypot.f6462.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 \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
                                                                                  5. Applied rewrites62.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 \cos \color{blue}{\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)} \]
                                                                                  6. Taylor expanded in y.im around 0

                                                                                    \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                                  7. Step-by-step derivation
                                                                                    1. lower-*.f64N/A

                                                                                      \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                                    2. lower-cos.f64N/A

                                                                                      \[\leadsto \color{blue}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                                    3. *-commutativeN/A

                                                                                      \[\leadsto \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                                    4. lower-*.f64N/A

                                                                                      \[\leadsto \cos \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                                    5. lower-atan2.f64N/A

                                                                                      \[\leadsto \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                                                                                    6. lower-pow.f64N/A

                                                                                      \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                                    7. unpow2N/A

                                                                                      \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right)}^{y.re} \]
                                                                                    8. unpow2N/A

                                                                                      \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)}^{y.re} \]
                                                                                    9. lower-hypot.f6455.9

                                                                                      \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}}^{y.re} \]
                                                                                  8. Applied rewrites55.9%

                                                                                    \[\leadsto \color{blue}{\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}} \]
                                                                                  9. Taylor expanded in y.re around 0

                                                                                    \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot 1 \]
                                                                                  10. Step-by-step derivation
                                                                                    1. Applied rewrites21.2%

                                                                                      \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot 1 \]
                                                                                    2. Taylor expanded in y.re around 0

                                                                                      \[\leadsto 1 \]
                                                                                    3. Step-by-step derivation
                                                                                      1. Applied rewrites21.3%

                                                                                        \[\leadsto 1 \]
                                                                                      2. Add Preprocessing

                                                                                      Reproduce

                                                                                      ?
                                                                                      herbie shell --seed 2024329 
                                                                                      (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)))))