powComplex, real part

Percentage Accurate: 41.4% → 73.7%
Time: 12.7s
Alternatives: 20
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)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
    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 20 alternatives:

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

Initial Program: 41.4% 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)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
    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.7% 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 := \cos \left(t\_0 \cdot y.im\right)\\ 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 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ \mathbf{if}\;y.re \leq -1.32 \cdot 10^{-18}:\\ \;\;\;\;t\_2 \cdot t\_1\\ \mathbf{elif}\;y.re \leq 1.9 \cdot 10^{+88}:\\ \;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_1\\ \mathbf{elif}\;y.re \leq 3 \cdot 10^{+199}:\\ \;\;\;\;t\_2 \cdot \sin \left(\left(-\mathsf{fma}\left(y.im, t\_0, t\_3\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos t\_3 \cdot {x.re}^{y.re}\\ \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 (* t_0 y.im)))
        (t_2
         (exp
          (-
           (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
           (* (atan2 x.im x.re) y.im))))
        (t_3 (* (atan2 x.im x.re) y.re)))
   (if (<= y.re -1.32e-18)
     (* t_2 t_1)
     (if (<= y.re 1.9e+88)
       (* (pow (exp (- y.im)) (atan2 x.im x.re)) t_1)
       (if (<= y.re 3e+199)
         (* t_2 (sin (+ (- (fma y.im t_0 t_3)) (/ (PI) 2.0))))
         (* (cos t_3) (pow x.re y.re)))))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := \cos \left(t\_0 \cdot y.im\right)\\
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 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.re \leq -1.32 \cdot 10^{-18}:\\
\;\;\;\;t\_2 \cdot t\_1\\

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

\mathbf{elif}\;y.re \leq 3 \cdot 10^{+199}:\\
\;\;\;\;t\_2 \cdot \sin \left(\left(-\mathsf{fma}\left(y.im, t\_0, t\_3\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)\\

\mathbf{else}:\\
\;\;\;\;\cos t\_3 \cdot {x.re}^{y.re}\\


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

    1. Initial program 39.5%

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

    if -1.3199999999999999e-18 < y.re < 1.8999999999999998e88

    1. Initial program 45.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.f6455.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 rewrites55.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.re around 0

      \[\leadsto \color{blue}{e^{\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) \]
    7. Step-by-step derivation
      1. 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) \]
      2. exp-prodN/A

        \[\leadsto \color{blue}{{\left(e^{\mathsf{neg}\left(y.im\right)}\right)}^{\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-pow.f64N/A

        \[\leadsto \color{blue}{{\left(e^{\mathsf{neg}\left(y.im\right)}\right)}^{\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-exp.f64N/A

        \[\leadsto {\color{blue}{\left(e^{\mathsf{neg}\left(y.im\right)}\right)}}^{\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-neg.f64N/A

        \[\leadsto {\left(e^{\color{blue}{-y.im}}\right)}^{\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) \]
      6. lower-atan2.f6479.4

        \[\leadsto {\left(e^{-y.im}\right)}^{\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) \]
    8. Applied rewrites79.4%

      \[\leadsto \color{blue}{{\left(e^{-y.im}\right)}^{\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 1.8999999999999998e88 < y.re < 3.0000000000000001e199

    1. Initial program 26.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. 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 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 \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)} \]

    if 3.0000000000000001e199 < y.re

    1. Initial program 48.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.f6458.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 rewrites58.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.f6465.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 rewrites65.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.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 rewrites65.9%

        \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.re}^{\color{blue}{y.re}} \]
    11. Recombined 4 regimes into one program.
    12. Add Preprocessing

    Alternative 2: 73.1% 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)\\ \mathbf{if}\;y.re \leq -1.32 \cdot 10^{-18}:\\ \;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t\_0\\ \mathbf{elif}\;y.re \leq 1.9 \cdot 10^{+88}:\\ \;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\ \mathbf{elif}\;y.re \leq 3 \cdot 10^{+200}:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\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} \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.re -1.32e-18)
         (*
          (exp
           (-
            (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
            (* (atan2 x.im x.re) y.im)))
          t_0)
         (if (<= y.re 1.9e+88)
           (* (pow (exp (- y.im)) (atan2 x.im x.re)) t_0)
           (if (<= y.re 3e+200)
             (*
              (sin (fma (- y.re) (atan2 x.im x.re) (/ (PI) 2.0)))
              (pow (hypot x.im x.re) y.re))
             (* (cos (* (atan2 x.im x.re) y.re)) (pow x.re y.re)))))))
    \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.re \leq -1.32 \cdot 10^{-18}:\\
    \;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t\_0\\
    
    \mathbf{elif}\;y.re \leq 1.9 \cdot 10^{+88}:\\
    \;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\
    
    \mathbf{elif}\;y.re \leq 3 \cdot 10^{+200}:\\
    \;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\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}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if y.re < -1.3199999999999999e-18

      1. Initial program 39.5%

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

      if -1.3199999999999999e-18 < y.re < 1.8999999999999998e88

      1. Initial program 45.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.f6455.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 rewrites55.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.re around 0

        \[\leadsto \color{blue}{e^{\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) \]
      7. Step-by-step derivation
        1. 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) \]
        2. exp-prodN/A

          \[\leadsto \color{blue}{{\left(e^{\mathsf{neg}\left(y.im\right)}\right)}^{\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-pow.f64N/A

          \[\leadsto \color{blue}{{\left(e^{\mathsf{neg}\left(y.im\right)}\right)}^{\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-exp.f64N/A

          \[\leadsto {\color{blue}{\left(e^{\mathsf{neg}\left(y.im\right)}\right)}}^{\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-neg.f64N/A

          \[\leadsto {\left(e^{\color{blue}{-y.im}}\right)}^{\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) \]
        6. lower-atan2.f6479.4

          \[\leadsto {\left(e^{-y.im}\right)}^{\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) \]
      8. Applied rewrites79.4%

        \[\leadsto \color{blue}{{\left(e^{-y.im}\right)}^{\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 1.8999999999999998e88 < y.re < 2.99999999999999991e200

      1. Initial program 26.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.f6465.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 rewrites65.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.f6448.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 rewrites48.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. Step-by-step derivation
        1. Applied rewrites78.5%

          \[\leadsto \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.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 2.99999999999999991e200 < y.re

        1. Initial program 48.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.f6458.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 rewrites58.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.f6465.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 rewrites65.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.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 rewrites65.9%

            \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.re}^{\color{blue}{y.re}} \]
        11. Recombined 4 regimes into one program.
        12. Add Preprocessing

        Alternative 3: 74.2% accurate, 1.1× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\\ t_1 := \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\ \mathbf{if}\;y.im \leq -0.000105:\\ \;\;\;\;t\_0 \cdot t\_1\\ \mathbf{elif}\;y.im \leq 8.2 \cdot 10^{+69}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \cos \left(\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 (pow (exp (- y.im)) (atan2 x.im x.re)))
                (t_1 (cos (* (log (hypot x.im x.re)) y.im))))
           (if (<= y.im -0.000105)
             (* t_0 t_1)
             (if (<= y.im 8.2e+69)
               (* (pow (hypot x.im x.re) y.re) t_1)
               (* t_0 (cos (* (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 = pow(exp(-y_46_im), atan2(x_46_im, x_46_re));
        	double t_1 = cos((log(hypot(x_46_im, x_46_re)) * y_46_im));
        	double tmp;
        	if (y_46_im <= -0.000105) {
        		tmp = t_0 * t_1;
        	} else if (y_46_im <= 8.2e+69) {
        		tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * t_1;
        	} else {
        		tmp = t_0 * cos((atan2(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 t_0 = Math.pow(Math.exp(-y_46_im), Math.atan2(x_46_im, x_46_re));
        	double t_1 = Math.cos((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
        	double tmp;
        	if (y_46_im <= -0.000105) {
        		tmp = t_0 * t_1;
        	} else if (y_46_im <= 8.2e+69) {
        		tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * t_1;
        	} else {
        		tmp = t_0 * Math.cos((Math.atan2(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):
        	t_0 = math.pow(math.exp(-y_46_im), math.atan2(x_46_im, x_46_re))
        	t_1 = math.cos((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im))
        	tmp = 0
        	if y_46_im <= -0.000105:
        		tmp = t_0 * t_1
        	elif y_46_im <= 8.2e+69:
        		tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * t_1
        	else:
        		tmp = t_0 * math.cos((math.atan2(x_46_im, x_46_re) * y_46_re))
        	return tmp
        
        function code(x_46_re, x_46_im, y_46_re, y_46_im)
        	t_0 = exp(Float64(-y_46_im)) ^ atan(x_46_im, x_46_re)
        	t_1 = cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))
        	tmp = 0.0
        	if (y_46_im <= -0.000105)
        		tmp = Float64(t_0 * t_1);
        	elseif (y_46_im <= 8.2e+69)
        		tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * t_1);
        	else
        		tmp = Float64(t_0 * cos(Float64(atan(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)
        	t_0 = exp(-y_46_im) ^ atan2(x_46_im, x_46_re);
        	t_1 = cos((log(hypot(x_46_im, x_46_re)) * y_46_im));
        	tmp = 0.0;
        	if (y_46_im <= -0.000105)
        		tmp = t_0 * t_1;
        	elseif (y_46_im <= 8.2e+69)
        		tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * t_1;
        	else
        		tmp = t_0 * cos((atan2(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_] := Block[{t$95$0 = N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -0.000105], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$im, 8.2e+69], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$0 * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := {\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\\
        t_1 := \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
        \mathbf{if}\;y.im \leq -0.000105:\\
        \;\;\;\;t\_0 \cdot t\_1\\
        
        \mathbf{elif}\;y.im \leq 8.2 \cdot 10^{+69}:\\
        \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_1\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0 \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if y.im < -1.05e-4

          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.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.re around 0

            \[\leadsto \color{blue}{e^{\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) \]
          7. Step-by-step derivation
            1. 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) \]
            2. exp-prodN/A

              \[\leadsto \color{blue}{{\left(e^{\mathsf{neg}\left(y.im\right)}\right)}^{\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-pow.f64N/A

              \[\leadsto \color{blue}{{\left(e^{\mathsf{neg}\left(y.im\right)}\right)}^{\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-exp.f64N/A

              \[\leadsto {\color{blue}{\left(e^{\mathsf{neg}\left(y.im\right)}\right)}}^{\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-neg.f64N/A

              \[\leadsto {\left(e^{\color{blue}{-y.im}}\right)}^{\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) \]
            6. lower-atan2.f6468.0

              \[\leadsto {\left(e^{-y.im}\right)}^{\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) \]
          8. Applied rewrites68.0%

            \[\leadsto \color{blue}{{\left(e^{-y.im}\right)}^{\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 -1.05e-4 < y.im < 8.1999999999999998e69

          1. Initial program 47.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.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.f6446.9

              \[\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 rewrites46.9%

            \[\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.f6486.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 rewrites86.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)} \]

          if 8.1999999999999998e69 < y.im

          1. Initial program 34.0%

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

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

            \[\leadsto \color{blue}{e^{\mathsf{neg}\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
          7. Step-by-step derivation
            1. 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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
            2. exp-prodN/A

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

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

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

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

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

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

        Alternative 4: 73.8% accurate, 1.3× 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 -0.000105:\\ \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\ \mathbf{elif}\;y.im \leq 8.2 \cdot 10^{+69}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\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 (cos (* (log (hypot x.im x.re)) y.im))))
           (if (<= y.im -0.000105)
             (* (exp (* (- y.im) (atan2 x.im x.re))) t_0)
             (if (<= y.im 8.2e+69)
               (* (pow (hypot x.im x.re) y.re) t_0)
               (*
                (pow (exp (- y.im)) (atan2 x.im x.re))
                (cos (* (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 = cos((log(hypot(x_46_im, x_46_re)) * y_46_im));
        	double tmp;
        	if (y_46_im <= -0.000105) {
        		tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * t_0;
        	} else if (y_46_im <= 8.2e+69) {
        		tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * t_0;
        	} else {
        		tmp = pow(exp(-y_46_im), atan2(x_46_im, x_46_re)) * cos((atan2(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 t_0 = Math.cos((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
        	double tmp;
        	if (y_46_im <= -0.000105) {
        		tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * t_0;
        	} else if (y_46_im <= 8.2e+69) {
        		tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * t_0;
        	} else {
        		tmp = Math.pow(Math.exp(-y_46_im), Math.atan2(x_46_im, x_46_re)) * Math.cos((Math.atan2(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):
        	t_0 = math.cos((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im))
        	tmp = 0
        	if y_46_im <= -0.000105:
        		tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * t_0
        	elif y_46_im <= 8.2e+69:
        		tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * t_0
        	else:
        		tmp = math.pow(math.exp(-y_46_im), math.atan2(x_46_im, x_46_re)) * math.cos((math.atan2(x_46_im, x_46_re) * y_46_re))
        	return tmp
        
        function code(x_46_re, x_46_im, y_46_re, y_46_im)
        	t_0 = cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im))
        	tmp = 0.0
        	if (y_46_im <= -0.000105)
        		tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * t_0);
        	elseif (y_46_im <= 8.2e+69)
        		tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * t_0);
        	else
        		tmp = Float64((exp(Float64(-y_46_im)) ^ atan(x_46_im, x_46_re)) * cos(Float64(atan(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)
        	t_0 = cos((log(hypot(x_46_im, x_46_re)) * y_46_im));
        	tmp = 0.0;
        	if (y_46_im <= -0.000105)
        		tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * t_0;
        	elseif (y_46_im <= 8.2e+69)
        		tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * t_0;
        	else
        		tmp = (exp(-y_46_im) ^ atan2(x_46_im, x_46_re)) * cos((atan2(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_] := 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, -0.000105], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 8.2e+69], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $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 -0.000105:\\
        \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\
        
        \mathbf{elif}\;y.im \leq 8.2 \cdot 10^{+69}:\\
        \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\
        
        \mathbf{else}:\\
        \;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if y.im < -1.05e-4

          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.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 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.f6438.3

              \[\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 rewrites38.3%

            \[\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.f6466.9

              \[\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 rewrites66.9%

            \[\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 -1.05e-4 < y.im < 8.1999999999999998e69

          1. Initial program 47.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.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.f6446.9

              \[\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 rewrites46.9%

            \[\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.f6486.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 rewrites86.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)} \]

          if 8.1999999999999998e69 < y.im

          1. Initial program 34.0%

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

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

            \[\leadsto \color{blue}{e^{\mathsf{neg}\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
          7. Step-by-step derivation
            1. 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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
            2. exp-prodN/A

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

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

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

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

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

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

        Alternative 5: 71.7% 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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{if}\;y.re \leq -2.25 \cdot 10^{-13}:\\ \;\;\;\;t\_0 \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\ \mathbf{elif}\;y.re \leq 1.9 \cdot 10^{+88}:\\ \;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_1\\ \mathbf{elif}\;y.re \leq 3 \cdot 10^{+200}:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot {x.re}^{y.re}\\ \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 (* (atan2 x.im x.re) y.re))))
           (if (<= y.re -2.25e-13)
             (* t_0 (cos (* (log (hypot x.im x.re)) y.im)))
             (if (<= y.re 1.9e+88)
               (* (pow (exp (- y.im)) (atan2 x.im x.re)) t_1)
               (if (<= y.re 3e+200)
                 (* (sin (fma (- y.re) (atan2 x.im x.re) (/ (PI) 2.0))) t_0)
                 (* t_1 (pow x.re y.re)))))))
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
        t_1 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
        \mathbf{if}\;y.re \leq -2.25 \cdot 10^{-13}:\\
        \;\;\;\;t\_0 \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
        
        \mathbf{elif}\;y.re \leq 1.9 \cdot 10^{+88}:\\
        \;\;\;\;{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_1\\
        
        \mathbf{elif}\;y.re \leq 3 \cdot 10^{+200}:\\
        \;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot t\_0\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1 \cdot {x.re}^{y.re}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if y.re < -2.25e-13

          1. Initial program 37.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.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.f6431.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 rewrites31.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.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 rewrites81.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)} \]

          if -2.25e-13 < y.re < 1.8999999999999998e88

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

            \[\leadsto \color{blue}{e^{\mathsf{neg}\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
          7. Step-by-step derivation
            1. 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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
            2. exp-prodN/A

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

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

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

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

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

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

          if 1.8999999999999998e88 < y.re < 2.99999999999999991e200

          1. Initial program 26.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.f6465.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 rewrites65.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.f6448.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 rewrites48.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. Step-by-step derivation
            1. Applied rewrites78.5%

              \[\leadsto \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.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 2.99999999999999991e200 < y.re

            1. Initial program 48.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.f6458.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 rewrites58.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.f6465.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 rewrites65.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.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 rewrites65.9%

                \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.re}^{\color{blue}{y.re}} \]
            11. Recombined 4 regimes into one program.
            12. Add Preprocessing

            Alternative 6: 63.4% accurate, 1.3× 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 -1.2 \cdot 10^{+17}:\\ \;\;\;\;{\left(\mathsf{fma}\left(\frac{0.5}{x.re}, \frac{x.im \cdot x.im}{x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot t\_0\\ \mathbf{elif}\;y.im \leq 8.2 \cdot 10^{+179}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{{x.re}^{3}}, -0.125, \frac{0.5}{x.re}\right), x.im \cdot x.im, x.re\right)\right)}^{y.re}\\ \end{array} \end{array} \]
            (FPCore (x.re x.im y.re y.im)
             :precision binary64
             (let* ((t_0 (cos (* (log (hypot x.im x.re)) y.im))))
               (if (<= y.im -1.2e+17)
                 (* (pow (* (fma (/ 0.5 x.re) (/ (* x.im x.im) x.re) 1.0) x.re) y.re) t_0)
                 (if (<= y.im 8.2e+179)
                   (* (pow (hypot x.im x.re) y.re) t_0)
                   (*
                    (sin (fma (- y.re) (atan2 x.im x.re) (/ (PI) 2.0)))
                    (pow
                     (fma
                      (fma (/ (* x.im x.im) (pow x.re 3.0)) -0.125 (/ 0.5 x.re))
                      (* x.im x.im)
                      x.re)
                     y.re))))))
            \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 -1.2 \cdot 10^{+17}:\\
            \;\;\;\;{\left(\mathsf{fma}\left(\frac{0.5}{x.re}, \frac{x.im \cdot x.im}{x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot t\_0\\
            
            \mathbf{elif}\;y.im \leq 8.2 \cdot 10^{+179}:\\
            \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\
            
            \mathbf{else}:\\
            \;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{{x.re}^{3}}, -0.125, \frac{0.5}{x.re}\right), x.im \cdot x.im, x.re\right)\right)}^{y.re}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if y.im < -1.2e17

              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.f6410.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 rewrites10.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.f6428.3

                  \[\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 rewrites28.3%

                \[\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(x.re \cdot \left(1 + \frac{1}{2} \cdot \frac{{x.im}^{2}}{{x.re}^{2}}\right)\right)}^{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 rewrites44.1%

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

                if -1.2e17 < y.im < 8.20000000000000021e179

                1. Initial program 46.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.f6441.6

                    \[\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 rewrites41.6%

                  \[\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.f6477.8

                    \[\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 rewrites77.8%

                  \[\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 8.20000000000000021e179 < y.im

                1. Initial program 34.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.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 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.f6425.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 rewrites25.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. Step-by-step derivation
                  1. Applied rewrites22.2%

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

                    \[\leadsto \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(x.re + {x.im}^{2} \cdot \left(\frac{-1}{8} \cdot \frac{{x.im}^{2}}{{x.re}^{3}} + \frac{1}{2} \cdot \frac{1}{x.re}\right)\right)}^{y.re} \]
                  3. Step-by-step derivation
                    1. Applied rewrites41.9%

                      \[\leadsto \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{{x.re}^{3}}, -0.125, \frac{0.5}{x.re}\right), x.im \cdot x.im, x.re\right)\right)}^{y.re} \]
                  4. Recombined 3 regimes into one program.
                  5. Add Preprocessing

                  Alternative 7: 62.5% accurate, 1.4× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\\ \mathbf{if}\;y.im \leq -6.2 \cdot 10^{+15}:\\ \;\;\;\;{\left(\mathsf{fma}\left(\frac{0.5}{x.re}, \frac{x.im \cdot x.im}{x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\ \mathbf{elif}\;y.im \leq 2 \cdot 10^{-20}:\\ \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{elif}\;y.im \leq 1.05 \cdot 10^{+180}:\\ \;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(\frac{0.5}{x.im}, \frac{x.re \cdot x.re}{x.im}, 1\right) \cdot x.im\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{{x.re}^{3}}, -0.125, \frac{0.5}{x.re}\right), x.im \cdot x.im, x.re\right)\right)}^{y.re}\\ \end{array} \end{array} \]
                  (FPCore (x.re x.im y.re y.im)
                   :precision binary64
                   (let* ((t_0 (sin (fma (- y.re) (atan2 x.im x.re) (/ (PI) 2.0)))))
                     (if (<= y.im -6.2e+15)
                       (*
                        (pow (* (fma (/ 0.5 x.re) (/ (* x.im x.im) x.re) 1.0) x.re) y.re)
                        (cos (* (log (hypot x.im x.re)) y.im)))
                       (if (<= y.im 2e-20)
                         (* (sin (* (PI) 0.5)) (pow (hypot x.im x.re) y.re))
                         (if (<= y.im 1.05e+180)
                           (*
                            t_0
                            (pow (* (fma (/ 0.5 x.im) (/ (* x.re x.re) x.im) 1.0) x.im) y.re))
                           (*
                            t_0
                            (pow
                             (fma
                              (fma (/ (* x.im x.im) (pow x.re 3.0)) -0.125 (/ 0.5 x.re))
                              (* x.im x.im)
                              x.re)
                             y.re)))))))
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\\
                  \mathbf{if}\;y.im \leq -6.2 \cdot 10^{+15}:\\
                  \;\;\;\;{\left(\mathsf{fma}\left(\frac{0.5}{x.re}, \frac{x.im \cdot x.im}{x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
                  
                  \mathbf{elif}\;y.im \leq 2 \cdot 10^{-20}:\\
                  \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
                  
                  \mathbf{elif}\;y.im \leq 1.05 \cdot 10^{+180}:\\
                  \;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(\frac{0.5}{x.im}, \frac{x.re \cdot x.re}{x.im}, 1\right) \cdot x.im\right)}^{y.re}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{{x.re}^{3}}, -0.125, \frac{0.5}{x.re}\right), x.im \cdot x.im, x.re\right)\right)}^{y.re}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 4 regimes
                  2. if y.im < -6.2e15

                    1. Initial program 36.1%

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

                        \[\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 rewrites12.3%

                      \[\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.f6429.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 rewrites29.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 inf

                      \[\leadsto {\left(x.re \cdot \left(1 + \frac{1}{2} \cdot \frac{{x.im}^{2}}{{x.re}^{2}}\right)\right)}^{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 rewrites45.1%

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

                      if -6.2e15 < y.im < 1.99999999999999989e-20

                      1. Initial program 47.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.f6470.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 rewrites70.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.f6484.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 rewrites84.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 rewrites82.9%

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

                          \[\leadsto \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot {\left(\mathsf{hypot}\left(\color{blue}{x.im}, x.re\right)\right)}^{y.re} \]
                        3. Step-by-step derivation
                          1. Applied rewrites86.9%

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

                          if 1.99999999999999989e-20 < y.im < 1.05e180

                          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.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 rewrites67.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.f6435.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 rewrites35.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 rewrites38.5%

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

                              \[\leadsto \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(x.im \cdot \left(1 + \frac{1}{2} \cdot \frac{{x.re}^{2}}{{x.im}^{2}}\right)\right)}^{y.re} \]
                            3. Step-by-step derivation
                              1. Applied rewrites49.1%

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

                              if 1.05e180 < y.im

                              1. Initial program 34.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.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 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.f6425.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 rewrites25.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. Step-by-step derivation
                                1. Applied rewrites22.2%

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

                                  \[\leadsto \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(x.re + {x.im}^{2} \cdot \left(\frac{-1}{8} \cdot \frac{{x.im}^{2}}{{x.re}^{3}} + \frac{1}{2} \cdot \frac{1}{x.re}\right)\right)}^{y.re} \]
                                3. Step-by-step derivation
                                  1. Applied rewrites41.9%

                                    \[\leadsto \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{{x.re}^{3}}, -0.125, \frac{0.5}{x.re}\right), x.im \cdot x.im, x.re\right)\right)}^{y.re} \]
                                4. Recombined 4 regimes into one program.
                                5. Add Preprocessing

                                Alternative 8: 61.6% accurate, 1.5× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.im \leq -6.2 \cdot 10^{+15}:\\ \;\;\;\;{\left(\mathsf{fma}\left(\frac{0.5}{x.re}, \frac{x.im \cdot x.im}{x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\ \mathbf{elif}\;y.im \leq 2 \cdot 10^{-20}:\\ \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{elif}\;y.im \leq 4.9 \cdot 10^{+169}:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{fma}\left(\frac{0.5}{x.im}, \frac{x.re \cdot x.re}{x.im}, 1\right) \cdot x.im\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{y.re}\\ \end{array} \end{array} \]
                                (FPCore (x.re x.im y.re y.im)
                                 :precision binary64
                                 (if (<= y.im -6.2e+15)
                                   (*
                                    (pow (* (fma (/ 0.5 x.re) (/ (* x.im x.im) x.re) 1.0) x.re) y.re)
                                    (cos (* (log (hypot x.im x.re)) y.im)))
                                   (if (<= y.im 2e-20)
                                     (* (sin (* (PI) 0.5)) (pow (hypot x.im x.re) y.re))
                                     (if (<= y.im 4.9e+169)
                                       (*
                                        (sin (fma (- y.re) (atan2 x.im x.re) (/ (PI) 2.0)))
                                        (pow (* (fma (/ 0.5 x.im) (/ (* x.re x.re) x.im) 1.0) x.im) y.re))
                                       (* (cos (* (atan2 x.im x.re) y.re)) (pow x.im y.re))))))
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;y.im \leq -6.2 \cdot 10^{+15}:\\
                                \;\;\;\;{\left(\mathsf{fma}\left(\frac{0.5}{x.re}, \frac{x.im \cdot x.im}{x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
                                
                                \mathbf{elif}\;y.im \leq 2 \cdot 10^{-20}:\\
                                \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
                                
                                \mathbf{elif}\;y.im \leq 4.9 \cdot 10^{+169}:\\
                                \;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{fma}\left(\frac{0.5}{x.im}, \frac{x.re \cdot x.re}{x.im}, 1\right) \cdot x.im\right)}^{y.re}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{y.re}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 4 regimes
                                2. if y.im < -6.2e15

                                  1. Initial program 36.1%

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

                                      \[\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 rewrites12.3%

                                    \[\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.f6429.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 rewrites29.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 inf

                                    \[\leadsto {\left(x.re \cdot \left(1 + \frac{1}{2} \cdot \frac{{x.im}^{2}}{{x.re}^{2}}\right)\right)}^{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 rewrites45.1%

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

                                    if -6.2e15 < y.im < 1.99999999999999989e-20

                                    1. Initial program 47.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.f6470.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 rewrites70.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.f6484.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 rewrites84.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 rewrites82.9%

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

                                        \[\leadsto \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot {\left(\mathsf{hypot}\left(\color{blue}{x.im}, x.re\right)\right)}^{y.re} \]
                                      3. Step-by-step derivation
                                        1. Applied rewrites86.9%

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

                                        if 1.99999999999999989e-20 < y.im < 4.90000000000000026e169

                                        1. Initial program 41.7%

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

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

                                            \[\leadsto \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(x.im \cdot \left(1 + \frac{1}{2} \cdot \frac{{x.re}^{2}}{{x.im}^{2}}\right)\right)}^{y.re} \]
                                          3. Step-by-step derivation
                                            1. Applied rewrites52.0%

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

                                            if 4.90000000000000026e169 < y.im

                                            1. Initial program 32.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.f6445.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 rewrites45.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 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.f6427.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 rewrites27.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 rewrites36.4%

                                                \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{\color{blue}{y.re}} \]
                                            11. Recombined 4 regimes into one program.
                                            12. Add Preprocessing

                                            Alternative 9: 61.3% accurate, 1.5× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.im \leq -6.5 \cdot 10^{+15}:\\ \;\;\;\;{\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, 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{elif}\;y.im \leq 2 \cdot 10^{-20}:\\ \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{elif}\;y.im \leq 4.9 \cdot 10^{+169}:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{fma}\left(\frac{0.5}{x.im}, \frac{x.re \cdot x.re}{x.im}, 1\right) \cdot x.im\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{y.re}\\ \end{array} \end{array} \]
                                            (FPCore (x.re x.im y.re y.im)
                                             :precision binary64
                                             (if (<= y.im -6.5e+15)
                                               (*
                                                (pow (fma (/ (* x.im x.im) x.re) 0.5 x.re) y.re)
                                                (cos (* (log (hypot x.im x.re)) y.im)))
                                               (if (<= y.im 2e-20)
                                                 (* (sin (* (PI) 0.5)) (pow (hypot x.im x.re) y.re))
                                                 (if (<= y.im 4.9e+169)
                                                   (*
                                                    (sin (fma (- y.re) (atan2 x.im x.re) (/ (PI) 2.0)))
                                                    (pow (* (fma (/ 0.5 x.im) (/ (* x.re x.re) x.im) 1.0) x.im) y.re))
                                                   (* (cos (* (atan2 x.im x.re) y.re)) (pow x.im y.re))))))
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;y.im \leq -6.5 \cdot 10^{+15}:\\
                                            \;\;\;\;{\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, 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{elif}\;y.im \leq 2 \cdot 10^{-20}:\\
                                            \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
                                            
                                            \mathbf{elif}\;y.im \leq 4.9 \cdot 10^{+169}:\\
                                            \;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{fma}\left(\frac{0.5}{x.im}, \frac{x.re \cdot x.re}{x.im}, 1\right) \cdot x.im\right)}^{y.re}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{y.re}\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 4 regimes
                                            2. if y.im < -6.5e15

                                              1. Initial program 36.1%

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

                                                  \[\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 rewrites12.3%

                                                \[\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.f6429.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 rewrites29.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.im around 0

                                                \[\leadsto {\left(x.re + \frac{1}{2} \cdot \frac{{x.im}^{2}}{x.re}\right)}^{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 rewrites41.9%

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

                                                if -6.5e15 < y.im < 1.99999999999999989e-20

                                                1. Initial program 47.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.f6470.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 rewrites70.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.f6484.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 rewrites84.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 rewrites82.9%

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

                                                    \[\leadsto \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot {\left(\mathsf{hypot}\left(\color{blue}{x.im}, x.re\right)\right)}^{y.re} \]
                                                  3. Step-by-step derivation
                                                    1. Applied rewrites86.9%

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

                                                    if 1.99999999999999989e-20 < y.im < 4.90000000000000026e169

                                                    1. Initial program 41.7%

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

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

                                                        \[\leadsto \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(x.im \cdot \left(1 + \frac{1}{2} \cdot \frac{{x.re}^{2}}{{x.im}^{2}}\right)\right)}^{y.re} \]
                                                      3. Step-by-step derivation
                                                        1. Applied rewrites52.0%

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

                                                        if 4.90000000000000026e169 < y.im

                                                        1. Initial program 32.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.f6445.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 rewrites45.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 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.f6427.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 rewrites27.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 rewrites36.4%

                                                            \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{\color{blue}{y.re}} \]
                                                        11. Recombined 4 regimes into one program.
                                                        12. Add Preprocessing

                                                        Alternative 10: 61.6% accurate, 1.8× speedup?

                                                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\\ \mathbf{if}\;y.im \leq -6.5 \cdot 10^{+15}:\\ \;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(\frac{0.5}{x.re}, \frac{x.im \cdot x.im}{x.re}, 1\right) \cdot x.re\right)}^{y.re}\\ \mathbf{elif}\;y.im \leq 2 \cdot 10^{-20}:\\ \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{elif}\;y.im \leq 4.9 \cdot 10^{+169}:\\ \;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(\frac{0.5}{x.im}, \frac{x.re \cdot x.re}{x.im}, 1\right) \cdot x.im\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{y.re}\\ \end{array} \end{array} \]
                                                        (FPCore (x.re x.im y.re y.im)
                                                         :precision binary64
                                                         (let* ((t_0 (sin (fma (- y.re) (atan2 x.im x.re) (/ (PI) 2.0)))))
                                                           (if (<= y.im -6.5e+15)
                                                             (* t_0 (pow (* (fma (/ 0.5 x.re) (/ (* x.im x.im) x.re) 1.0) x.re) y.re))
                                                             (if (<= y.im 2e-20)
                                                               (* (sin (* (PI) 0.5)) (pow (hypot x.im x.re) y.re))
                                                               (if (<= y.im 4.9e+169)
                                                                 (*
                                                                  t_0
                                                                  (pow (* (fma (/ 0.5 x.im) (/ (* x.re x.re) x.im) 1.0) x.im) y.re))
                                                                 (* (cos (* (atan2 x.im x.re) y.re)) (pow x.im y.re)))))))
                                                        \begin{array}{l}
                                                        
                                                        \\
                                                        \begin{array}{l}
                                                        t_0 := \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\\
                                                        \mathbf{if}\;y.im \leq -6.5 \cdot 10^{+15}:\\
                                                        \;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(\frac{0.5}{x.re}, \frac{x.im \cdot x.im}{x.re}, 1\right) \cdot x.re\right)}^{y.re}\\
                                                        
                                                        \mathbf{elif}\;y.im \leq 2 \cdot 10^{-20}:\\
                                                        \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
                                                        
                                                        \mathbf{elif}\;y.im \leq 4.9 \cdot 10^{+169}:\\
                                                        \;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(\frac{0.5}{x.im}, \frac{x.re \cdot x.re}{x.im}, 1\right) \cdot x.im\right)}^{y.re}\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{y.re}\\
                                                        
                                                        
                                                        \end{array}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 4 regimes
                                                        2. if y.im < -6.5e15

                                                          1. Initial program 36.1%

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

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

                                                              \[\leadsto \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(x.re \cdot \left(1 + \frac{1}{2} \cdot \frac{{x.im}^{2}}{{x.re}^{2}}\right)\right)}^{y.re} \]
                                                            3. Step-by-step derivation
                                                              1. Applied rewrites38.7%

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

                                                              if -6.5e15 < y.im < 1.99999999999999989e-20

                                                              1. Initial program 47.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.f6470.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 rewrites70.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.f6484.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 rewrites84.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 rewrites82.9%

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

                                                                  \[\leadsto \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot {\left(\mathsf{hypot}\left(\color{blue}{x.im}, x.re\right)\right)}^{y.re} \]
                                                                3. Step-by-step derivation
                                                                  1. Applied rewrites86.9%

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

                                                                  if 1.99999999999999989e-20 < y.im < 4.90000000000000026e169

                                                                  1. Initial program 41.7%

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

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

                                                                      \[\leadsto \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(x.im \cdot \left(1 + \frac{1}{2} \cdot \frac{{x.re}^{2}}{{x.im}^{2}}\right)\right)}^{y.re} \]
                                                                    3. Step-by-step derivation
                                                                      1. Applied rewrites52.0%

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

                                                                      if 4.90000000000000026e169 < y.im

                                                                      1. Initial program 32.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.f6445.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 rewrites45.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 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.f6427.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 rewrites27.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 rewrites36.4%

                                                                          \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{\color{blue}{y.re}} \]
                                                                      11. Recombined 4 regimes into one program.
                                                                      12. Add Preprocessing

                                                                      Alternative 11: 61.3% accurate, 1.8× speedup?

                                                                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\\ \mathbf{if}\;y.im \leq -1.8 \cdot 10^{+23}:\\ \;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re}\\ \mathbf{elif}\;y.im \leq 2 \cdot 10^{-20}:\\ \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{elif}\;y.im \leq 4.9 \cdot 10^{+169}:\\ \;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(\frac{0.5}{x.im}, \frac{x.re \cdot x.re}{x.im}, 1\right) \cdot x.im\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{y.re}\\ \end{array} \end{array} \]
                                                                      (FPCore (x.re x.im y.re y.im)
                                                                       :precision binary64
                                                                       (let* ((t_0 (sin (fma (- y.re) (atan2 x.im x.re) (/ (PI) 2.0)))))
                                                                         (if (<= y.im -1.8e+23)
                                                                           (* t_0 (pow (fma (/ (* x.im x.im) x.re) 0.5 x.re) y.re))
                                                                           (if (<= y.im 2e-20)
                                                                             (* (sin (* (PI) 0.5)) (pow (hypot x.im x.re) y.re))
                                                                             (if (<= y.im 4.9e+169)
                                                                               (*
                                                                                t_0
                                                                                (pow (* (fma (/ 0.5 x.im) (/ (* x.re x.re) x.im) 1.0) x.im) y.re))
                                                                               (* (cos (* (atan2 x.im x.re) y.re)) (pow x.im y.re)))))))
                                                                      \begin{array}{l}
                                                                      
                                                                      \\
                                                                      \begin{array}{l}
                                                                      t_0 := \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\\
                                                                      \mathbf{if}\;y.im \leq -1.8 \cdot 10^{+23}:\\
                                                                      \;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re}\\
                                                                      
                                                                      \mathbf{elif}\;y.im \leq 2 \cdot 10^{-20}:\\
                                                                      \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
                                                                      
                                                                      \mathbf{elif}\;y.im \leq 4.9 \cdot 10^{+169}:\\
                                                                      \;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(\frac{0.5}{x.im}, \frac{x.re \cdot x.re}{x.im}, 1\right) \cdot x.im\right)}^{y.re}\\
                                                                      
                                                                      \mathbf{else}:\\
                                                                      \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{y.re}\\
                                                                      
                                                                      
                                                                      \end{array}
                                                                      \end{array}
                                                                      
                                                                      Derivation
                                                                      1. Split input into 4 regimes
                                                                      2. if y.im < -1.7999999999999999e23

                                                                        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.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.f6426.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 rewrites26.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. Step-by-step derivation
                                                                          1. Applied rewrites30.0%

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

                                                                            \[\leadsto \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(x.re + \frac{1}{2} \cdot \frac{{x.im}^{2}}{x.re}\right)}^{y.re} \]
                                                                          3. Step-by-step derivation
                                                                            1. Applied rewrites37.8%

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

                                                                            if -1.7999999999999999e23 < y.im < 1.99999999999999989e-20

                                                                            1. Initial program 48.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.f6470.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 rewrites70.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.f6484.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 rewrites84.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. Step-by-step derivation
                                                                              1. Applied rewrites82.3%

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

                                                                                \[\leadsto \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot {\left(\mathsf{hypot}\left(\color{blue}{x.im}, x.re\right)\right)}^{y.re} \]
                                                                              3. Step-by-step derivation
                                                                                1. Applied rewrites86.2%

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

                                                                                if 1.99999999999999989e-20 < y.im < 4.90000000000000026e169

                                                                                1. Initial program 41.7%

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

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

                                                                                    \[\leadsto \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(x.im \cdot \left(1 + \frac{1}{2} \cdot \frac{{x.re}^{2}}{{x.im}^{2}}\right)\right)}^{y.re} \]
                                                                                  3. Step-by-step derivation
                                                                                    1. Applied rewrites52.0%

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

                                                                                    if 4.90000000000000026e169 < y.im

                                                                                    1. Initial program 32.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.f6445.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 rewrites45.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 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.f6427.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 rewrites27.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 rewrites36.4%

                                                                                        \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{\color{blue}{y.re}} \]
                                                                                    11. Recombined 4 regimes into one program.
                                                                                    12. Add Preprocessing

                                                                                    Alternative 12: 61.2% accurate, 1.9× speedup?

                                                                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\\ \mathbf{if}\;y.im \leq -1.8 \cdot 10^{+23}:\\ \;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re}\\ \mathbf{elif}\;y.im \leq 2 \cdot 10^{-20}:\\ \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{elif}\;y.im \leq 4.9 \cdot 10^{+169}:\\ \;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(\frac{x.re \cdot x.re}{x.im}, 0.5, x.im\right)\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{y.re}\\ \end{array} \end{array} \]
                                                                                    (FPCore (x.re x.im y.re y.im)
                                                                                     :precision binary64
                                                                                     (let* ((t_0 (sin (fma (- y.re) (atan2 x.im x.re) (/ (PI) 2.0)))))
                                                                                       (if (<= y.im -1.8e+23)
                                                                                         (* t_0 (pow (fma (/ (* x.im x.im) x.re) 0.5 x.re) y.re))
                                                                                         (if (<= y.im 2e-20)
                                                                                           (* (sin (* (PI) 0.5)) (pow (hypot x.im x.re) y.re))
                                                                                           (if (<= y.im 4.9e+169)
                                                                                             (* t_0 (pow (fma (/ (* x.re x.re) x.im) 0.5 x.im) y.re))
                                                                                             (* (cos (* (atan2 x.im x.re) y.re)) (pow x.im y.re)))))))
                                                                                    \begin{array}{l}
                                                                                    
                                                                                    \\
                                                                                    \begin{array}{l}
                                                                                    t_0 := \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\\
                                                                                    \mathbf{if}\;y.im \leq -1.8 \cdot 10^{+23}:\\
                                                                                    \;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re}\\
                                                                                    
                                                                                    \mathbf{elif}\;y.im \leq 2 \cdot 10^{-20}:\\
                                                                                    \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
                                                                                    
                                                                                    \mathbf{elif}\;y.im \leq 4.9 \cdot 10^{+169}:\\
                                                                                    \;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(\frac{x.re \cdot x.re}{x.im}, 0.5, x.im\right)\right)}^{y.re}\\
                                                                                    
                                                                                    \mathbf{else}:\\
                                                                                    \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{y.re}\\
                                                                                    
                                                                                    
                                                                                    \end{array}
                                                                                    \end{array}
                                                                                    
                                                                                    Derivation
                                                                                    1. Split input into 4 regimes
                                                                                    2. if y.im < -1.7999999999999999e23

                                                                                      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.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.f6426.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 rewrites26.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. Step-by-step derivation
                                                                                        1. Applied rewrites30.0%

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

                                                                                          \[\leadsto \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(x.re + \frac{1}{2} \cdot \frac{{x.im}^{2}}{x.re}\right)}^{y.re} \]
                                                                                        3. Step-by-step derivation
                                                                                          1. Applied rewrites37.8%

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

                                                                                          if -1.7999999999999999e23 < y.im < 1.99999999999999989e-20

                                                                                          1. Initial program 48.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.f6470.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 rewrites70.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.f6484.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 rewrites84.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. Step-by-step derivation
                                                                                            1. Applied rewrites82.3%

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

                                                                                              \[\leadsto \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot {\left(\mathsf{hypot}\left(\color{blue}{x.im}, x.re\right)\right)}^{y.re} \]
                                                                                            3. Step-by-step derivation
                                                                                              1. Applied rewrites86.2%

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

                                                                                              if 1.99999999999999989e-20 < y.im < 4.90000000000000026e169

                                                                                              1. Initial program 41.7%

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

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

                                                                                                  \[\leadsto \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(x.im + \frac{1}{2} \cdot \frac{{x.re}^{2}}{x.im}\right)}^{y.re} \]
                                                                                                3. Step-by-step derivation
                                                                                                  1. Applied rewrites49.0%

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

                                                                                                  if 4.90000000000000026e169 < y.im

                                                                                                  1. Initial program 32.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.f6445.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 rewrites45.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 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.f6427.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 rewrites27.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 rewrites36.4%

                                                                                                      \[\leadsto \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{\color{blue}{y.re}} \]
                                                                                                  11. Recombined 4 regimes into one program.
                                                                                                  12. Add Preprocessing

                                                                                                  Alternative 13: 61.7% accurate, 1.9× speedup?

                                                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.im \leq -1.8 \cdot 10^{+23} \lor \neg \left(y.im \leq 1.4 \cdot 10^{-51}\right):\\ \;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\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 (or (<= y.im -1.8e+23) (not (<= y.im 1.4e-51)))
                                                                                                     (*
                                                                                                      (sin (fma (- y.re) (atan2 x.im x.re) (/ (PI) 2.0)))
                                                                                                      (pow (fma (/ (* x.im x.im) x.re) 0.5 x.re) y.re))
                                                                                                     (* (sin (* (PI) 0.5)) (pow (hypot x.im x.re) y.re))))
                                                                                                  \begin{array}{l}
                                                                                                  
                                                                                                  \\
                                                                                                  \begin{array}{l}
                                                                                                  \mathbf{if}\;y.im \leq -1.8 \cdot 10^{+23} \lor \neg \left(y.im \leq 1.4 \cdot 10^{-51}\right):\\
                                                                                                  \;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re}\\
                                                                                                  
                                                                                                  \mathbf{else}:\\
                                                                                                  \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\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 < -1.7999999999999999e23 or 1.4e-51 < y.im

                                                                                                    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.f6460.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 rewrites60.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.f6429.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 rewrites29.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. Step-by-step derivation
                                                                                                      1. Applied rewrites31.2%

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

                                                                                                        \[\leadsto \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(x.re + \frac{1}{2} \cdot \frac{{x.im}^{2}}{x.re}\right)}^{y.re} \]
                                                                                                      3. Step-by-step derivation
                                                                                                        1. Applied rewrites37.4%

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

                                                                                                        if -1.7999999999999999e23 < y.im < 1.4e-51

                                                                                                        1. Initial program 47.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.f6470.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 rewrites70.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.f6484.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 rewrites84.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 rewrites82.1%

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

                                                                                                            \[\leadsto \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot {\left(\mathsf{hypot}\left(\color{blue}{x.im}, x.re\right)\right)}^{y.re} \]
                                                                                                          3. Step-by-step derivation
                                                                                                            1. Applied rewrites86.1%

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

                                                                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -1.8 \cdot 10^{+23} \lor \neg \left(y.im \leq 1.4 \cdot 10^{-51}\right):\\ \;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot {\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \end{array} \]
                                                                                                          6. Add Preprocessing

                                                                                                          Alternative 14: 61.9% accurate, 2.1× speedup?

                                                                                                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot 0.5\\ \mathbf{if}\;x.re \leq 5:\\ \;\;\;\;\sin t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;{x.re}^{y.re} \cdot \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, t\_0\right)\right)\\ \end{array} \end{array} \]
                                                                                                          (FPCore (x.re x.im y.re y.im)
                                                                                                           :precision binary64
                                                                                                           (let* ((t_0 (* (PI) 0.5)))
                                                                                                             (if (<= x.re 5.0)
                                                                                                               (* (sin t_0) (pow (hypot x.im x.re) y.re))
                                                                                                               (* (pow x.re y.re) (sin (fma (- y.re) (atan2 x.im x.re) t_0))))))
                                                                                                          \begin{array}{l}
                                                                                                          
                                                                                                          \\
                                                                                                          \begin{array}{l}
                                                                                                          t_0 := \mathsf{PI}\left(\right) \cdot 0.5\\
                                                                                                          \mathbf{if}\;x.re \leq 5:\\
                                                                                                          \;\;\;\;\sin t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
                                                                                                          
                                                                                                          \mathbf{else}:\\
                                                                                                          \;\;\;\;{x.re}^{y.re} \cdot \sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, t\_0\right)\right)\\
                                                                                                          
                                                                                                          
                                                                                                          \end{array}
                                                                                                          \end{array}
                                                                                                          
                                                                                                          Derivation
                                                                                                          1. Split input into 2 regimes
                                                                                                          2. if x.re < 5

                                                                                                            1. Initial program 45.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.f6467.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 rewrites67.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.f6454.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 rewrites54.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. Step-by-step derivation
                                                                                                              1. Applied rewrites53.8%

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

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

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

                                                                                                                if 5 < x.re

                                                                                                                1. Initial program 32.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.f6458.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 rewrites58.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.f6464.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 rewrites64.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. Step-by-step derivation
                                                                                                                  1. Applied rewrites66.4%

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

                                                                                                                    \[\leadsto \sin \left(-1 \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{{x.re}^{y.re}} \]
                                                                                                                  3. Step-by-step derivation
                                                                                                                    1. Applied rewrites66.4%

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

                                                                                                                  Alternative 15: 59.8% accurate, 2.1× speedup?

                                                                                                                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot 0.5\\ \mathbf{if}\;y.im \leq -1.25 \cdot 10^{+94}:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, t\_0\right)\right) \cdot {x.im}^{y.re}\\ \mathbf{elif}\;y.im \leq 2.1 \cdot 10^{+179}:\\ \;\;\;\;\sin t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{y.re}\\ \end{array} \end{array} \]
                                                                                                                  (FPCore (x.re x.im y.re y.im)
                                                                                                                   :precision binary64
                                                                                                                   (let* ((t_0 (* (PI) 0.5)))
                                                                                                                     (if (<= y.im -1.25e+94)
                                                                                                                       (* (sin (fma (- y.re) (atan2 x.im x.re) t_0)) (pow x.im y.re))
                                                                                                                       (if (<= y.im 2.1e+179)
                                                                                                                         (* (sin t_0) (pow (hypot x.im x.re) y.re))
                                                                                                                         (* (cos (* (atan2 x.im x.re) y.re)) (pow x.im y.re))))))
                                                                                                                  \begin{array}{l}
                                                                                                                  
                                                                                                                  \\
                                                                                                                  \begin{array}{l}
                                                                                                                  t_0 := \mathsf{PI}\left(\right) \cdot 0.5\\
                                                                                                                  \mathbf{if}\;y.im \leq -1.25 \cdot 10^{+94}:\\
                                                                                                                  \;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, t\_0\right)\right) \cdot {x.im}^{y.re}\\
                                                                                                                  
                                                                                                                  \mathbf{elif}\;y.im \leq 2.1 \cdot 10^{+179}:\\
                                                                                                                  \;\;\;\;\sin t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
                                                                                                                  
                                                                                                                  \mathbf{else}:\\
                                                                                                                  \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{y.re}\\
                                                                                                                  
                                                                                                                  
                                                                                                                  \end{array}
                                                                                                                  \end{array}
                                                                                                                  
                                                                                                                  Derivation
                                                                                                                  1. Split input into 3 regimes
                                                                                                                  2. if y.im < -1.25000000000000003e94

                                                                                                                    1. Initial program 35.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.f6458.0

                                                                                                                        \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot y.im\right) \]
                                                                                                                    5. Applied rewrites58.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(\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.f6429.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 rewrites29.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. Step-by-step derivation
                                                                                                                      1. Applied rewrites34.2%

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

                                                                                                                        \[\leadsto \sin \left(-1 \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{{x.im}^{y.re}} \]
                                                                                                                      3. Step-by-step derivation
                                                                                                                        1. Applied rewrites33.5%

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

                                                                                                                        if -1.25000000000000003e94 < y.im < 2.0999999999999999e179

                                                                                                                        1. Initial program 45.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.f6470.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 rewrites70.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.f6468.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 rewrites68.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. Step-by-step derivation
                                                                                                                          1. Applied rewrites67.7%

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

                                                                                                                            \[\leadsto \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot {\left(\mathsf{hypot}\left(\color{blue}{x.im}, x.re\right)\right)}^{y.re} \]
                                                                                                                          3. Step-by-step derivation
                                                                                                                            1. Applied rewrites70.0%

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

                                                                                                                            if 2.0999999999999999e179 < 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.f6447.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 rewrites47.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.f6428.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 rewrites28.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.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 rewrites37.6%

                                                                                                                                \[\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. Add Preprocessing

                                                                                                                            Alternative 16: 50.3% accurate, 2.1× speedup?

                                                                                                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -550000000000 \lor \neg \left(y.re \leq 2.05 \cdot 10^{+42}\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 -550000000000.0) (not (<= y.re 2.05e+42)))
                                                                                                                               (* (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 <= -550000000000.0) || !(y_46_re <= 2.05e+42)) {
                                                                                                                            		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 <= -550000000000.0) || !(y_46_re <= 2.05e+42))
                                                                                                                            		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, -550000000000.0], N[Not[LessEqual[y$46$re, 2.05e+42]], $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 -550000000000 \lor \neg \left(y.re \leq 2.05 \cdot 10^{+42}\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 < -5.5e11 or 2.05e42 < y.re

                                                                                                                              1. Initial program 39.5%

                                                                                                                                \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                                                                                                              2. 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.f6474.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 rewrites74.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 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.f6466.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 rewrites66.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 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 rewrites57.8%

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

                                                                                                                                if -5.5e11 < y.re < 2.05e42

                                                                                                                                1. Initial program 45.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.f6456.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 rewrites56.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.f6447.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 rewrites47.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 1 + \color{blue}{y.re \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)} \]
                                                                                                                                10. Step-by-step derivation
                                                                                                                                  1. Applied rewrites44.9%

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

                                                                                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -550000000000 \lor \neg \left(y.re \leq 2.05 \cdot 10^{+42}\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} \]
                                                                                                                                13. Add Preprocessing

                                                                                                                                Alternative 17: 48.3% accurate, 2.1× speedup?

                                                                                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -6.2 \cdot 10^{-83} \lor \neg \left(y.re \leq 0.0122\right):\\ \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;1 \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 (or (<= y.re -6.2e-83) (not (<= y.re 0.0122)))
                                                                                                                                   (* (cos (* (atan2 x.im x.re) y.re)) (pow x.im y.re))
                                                                                                                                   (* 1.0 (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 <= -6.2e-83) || !(y_46_re <= 0.0122)) {
                                                                                                                                		tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * pow(x_46_im, y_46_re);
                                                                                                                                	} else {
                                                                                                                                		tmp = 1.0 * 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 <= -6.2e-83) || !(y_46_re <= 0.0122)) {
                                                                                                                                		tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.pow(x_46_im, y_46_re);
                                                                                                                                	} else {
                                                                                                                                		tmp = 1.0 * 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 <= -6.2e-83) or not (y_46_re <= 0.0122):
                                                                                                                                		tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.pow(x_46_im, y_46_re)
                                                                                                                                	else:
                                                                                                                                		tmp = 1.0 * 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 <= -6.2e-83) || !(y_46_re <= 0.0122))
                                                                                                                                		tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * (x_46_im ^ y_46_re));
                                                                                                                                	else
                                                                                                                                		tmp = Float64(1.0 * 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 <= -6.2e-83) || ~((y_46_re <= 0.0122)))
                                                                                                                                		tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * (x_46_im ^ y_46_re);
                                                                                                                                	else
                                                                                                                                		tmp = 1.0 * 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[Or[LessEqual[y$46$re, -6.2e-83], N[Not[LessEqual[y$46$re, 0.0122]], $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[(1.0 * 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 -6.2 \cdot 10^{-83} \lor \neg \left(y.re \leq 0.0122\right):\\
                                                                                                                                \;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {x.im}^{y.re}\\
                                                                                                                                
                                                                                                                                \mathbf{else}:\\
                                                                                                                                \;\;\;\;1 \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 < -6.19999999999999985e-83 or 0.0122000000000000008 < y.re

                                                                                                                                  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.f6471.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 rewrites71.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 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.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 rewrites62.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 rewrites49.5%

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

                                                                                                                                    if -6.19999999999999985e-83 < y.re < 0.0122000000000000008

                                                                                                                                    1. Initial program 46.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.f6427.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 rewrites27.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.f6450.3

                                                                                                                                        \[\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 rewrites50.3%

                                                                                                                                      \[\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 y.re around 0

                                                                                                                                      \[\leadsto 1 \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 rewrites50.3%

                                                                                                                                        \[\leadsto 1 \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. Final simplification49.8%

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

                                                                                                                                    Alternative 18: 60.5% accurate, 2.1× speedup?

                                                                                                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq 2.45 \cdot 10^{+200}:\\ \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\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} \end{array} \]
                                                                                                                                    (FPCore (x.re x.im y.re y.im)
                                                                                                                                     :precision binary64
                                                                                                                                     (if (<= y.re 2.45e+200)
                                                                                                                                       (* (sin (* (PI) 0.5)) (pow (hypot x.im x.re) y.re))
                                                                                                                                       (* (cos (* (atan2 x.im x.re) y.re)) (pow x.re y.re))))
                                                                                                                                    \begin{array}{l}
                                                                                                                                    
                                                                                                                                    \\
                                                                                                                                    \begin{array}{l}
                                                                                                                                    \mathbf{if}\;y.re \leq 2.45 \cdot 10^{+200}:\\
                                                                                                                                    \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\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}
                                                                                                                                    \end{array}
                                                                                                                                    
                                                                                                                                    Derivation
                                                                                                                                    1. Split input into 2 regimes
                                                                                                                                    2. if y.re < 2.44999999999999991e200

                                                                                                                                      1. Initial program 41.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.f6466.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 rewrites66.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.f6456.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 rewrites56.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 rewrites58.2%

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

                                                                                                                                          \[\leadsto \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot {\left(\mathsf{hypot}\left(\color{blue}{x.im}, x.re\right)\right)}^{y.re} \]
                                                                                                                                        3. Step-by-step derivation
                                                                                                                                          1. Applied rewrites57.8%

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

                                                                                                                                          if 2.44999999999999991e200 < y.re

                                                                                                                                          1. Initial program 48.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.f6458.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 rewrites58.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.f6465.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 rewrites65.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.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 rewrites65.9%

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

                                                                                                                                          Alternative 19: 26.5% 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 42.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.f6465.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 rewrites65.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.f6457.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 rewrites57.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 y.re around 0

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

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

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

                                                                                                                                            Alternative 20: 26.1% 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;
                                                                                                                                            }
                                                                                                                                            
                                                                                                                                            module fmin_fmax_functions
                                                                                                                                                implicit none
                                                                                                                                                private
                                                                                                                                                public fmax
                                                                                                                                                public fmin
                                                                                                                                            
                                                                                                                                                interface fmax
                                                                                                                                                    module procedure fmax88
                                                                                                                                                    module procedure fmax44
                                                                                                                                                    module procedure fmax84
                                                                                                                                                    module procedure fmax48
                                                                                                                                                end interface
                                                                                                                                                interface fmin
                                                                                                                                                    module procedure fmin88
                                                                                                                                                    module procedure fmin44
                                                                                                                                                    module procedure fmin84
                                                                                                                                                    module procedure fmin48
                                                                                                                                                end interface
                                                                                                                                            contains
                                                                                                                                                real(8) function fmax88(x, y) result (res)
                                                                                                                                                    real(8), intent (in) :: x
                                                                                                                                                    real(8), intent (in) :: y
                                                                                                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                end function
                                                                                                                                                real(4) function fmax44(x, y) result (res)
                                                                                                                                                    real(4), intent (in) :: x
                                                                                                                                                    real(4), intent (in) :: y
                                                                                                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                end function
                                                                                                                                                real(8) function fmax84(x, y) result(res)
                                                                                                                                                    real(8), intent (in) :: x
                                                                                                                                                    real(4), intent (in) :: y
                                                                                                                                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                                                                end function
                                                                                                                                                real(8) function fmax48(x, y) result(res)
                                                                                                                                                    real(4), intent (in) :: x
                                                                                                                                                    real(8), intent (in) :: y
                                                                                                                                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                                                                end function
                                                                                                                                                real(8) function fmin88(x, y) result (res)
                                                                                                                                                    real(8), intent (in) :: x
                                                                                                                                                    real(8), intent (in) :: y
                                                                                                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                end function
                                                                                                                                                real(4) function fmin44(x, y) result (res)
                                                                                                                                                    real(4), intent (in) :: x
                                                                                                                                                    real(4), intent (in) :: y
                                                                                                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                end function
                                                                                                                                                real(8) function fmin84(x, y) result(res)
                                                                                                                                                    real(8), intent (in) :: x
                                                                                                                                                    real(4), intent (in) :: y
                                                                                                                                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                                                                end function
                                                                                                                                                real(8) function fmin48(x, y) result(res)
                                                                                                                                                    real(4), intent (in) :: x
                                                                                                                                                    real(8), intent (in) :: y
                                                                                                                                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                                                                end function
                                                                                                                                            end module
                                                                                                                                            
                                                                                                                                            real(8) function code(x_46re, x_46im, y_46re, y_46im)
                                                                                                                                            use fmin_fmax_functions
                                                                                                                                                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 42.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.f6465.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 rewrites65.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.f6457.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 rewrites57.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 y.re around 0

                                                                                                                                              \[\leadsto 1 \]
                                                                                                                                            10. Step-by-step derivation
                                                                                                                                              1. Applied rewrites23.5%

                                                                                                                                                \[\leadsto 1 \]
                                                                                                                                              2. Final simplification23.5%

                                                                                                                                                \[\leadsto 1 \]
                                                                                                                                              3. Add Preprocessing

                                                                                                                                              Reproduce

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