powComplex, real part

Percentage Accurate: 41.2% → 79.9%
Time: 11.3s
Alternatives: 15
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 15 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.2% 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: 79.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_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}\\ t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ \mathbf{if}\;y.re \leq -6 \cdot 10^{-11}:\\ \;\;\;\;t\_0 \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;y.re \leq 1.7 \cdot 10^{-5}:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(t\_1, y.im, \mathsf{PI}\left(\right) \cdot 0.5\right)\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \cos \left(t\_1 \cdot y.im\right)\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0
         (exp
          (-
           (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
           (* (atan2 x.im x.re) y.im))))
        (t_1 (log (hypot x.im x.re))))
   (if (<= y.re -6e-11)
     (* t_0 (cos (* (atan2 x.im x.re) y.re)))
     (if (<= y.re 1.7e-5)
       (*
        (sin (fma t_1 y.im (* (PI) 0.5)))
        (exp (* (- y.im) (atan2 x.im x.re))))
       (* t_0 (cos (* t_1 y.im)))))))
\begin{array}{l}

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

\mathbf{elif}\;y.re \leq 1.7 \cdot 10^{-5}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_1, y.im, \mathsf{PI}\left(\right) \cdot 0.5\right)\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \cos \left(t\_1 \cdot y.im\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y.re < -6e-11

    1. Initial program 44.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 inf

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

      if -6e-11 < y.re < 1.7e-5

      1. Initial program 40.2%

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

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

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

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

          if 1.7e-5 < y.re

          1. Initial program 39.7%

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

            \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)} \]
          4. Step-by-step derivation
            1. Applied rewrites75.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)} \]
          5. Recombined 3 regimes into one program.
          6. Add Preprocessing

          Alternative 2: 78.8% accurate, 1.2× speedup?

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

            1. Initial program 44.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 inf

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

              if -6e-11 < y.re < 88000

              1. Initial program 40.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. Applied rewrites21.0%

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

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

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

                  if 88000 < y.re

                  1. Initial program 38.6%

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

                    \[\leadsto \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. Applied rewrites33.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) \]
                    2. 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)} \]
                    3. Step-by-step derivation
                      1. Applied rewrites70.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)} \]
                    4. Recombined 3 regimes into one program.
                    5. Add Preprocessing

                    Alternative 3: 77.6% accurate, 1.3× speedup?

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

                      1. Initial program 44.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. Applied rewrites39.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) \]
                        2. Taylor expanded in y.re around inf

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

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

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

                            if -1.90000000000000006e-9 < y.re < 88000

                            1. Initial program 40.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. Applied rewrites21.0%

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

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

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

                                if 88000 < y.re

                                1. Initial program 38.6%

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

                                  \[\leadsto \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. Applied rewrites33.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) \]
                                  2. 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)} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites70.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)} \]
                                  4. Recombined 3 regimes into one program.
                                  5. Add Preprocessing

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

                                    1. Initial program 44.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. Applied rewrites39.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) \]
                                      2. Taylor expanded in y.re around inf

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

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

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

                                          if -1.90000000000000006e-9 < y.re < 8500

                                          1. Initial program 40.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 x.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 x.im + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                          4. Step-by-step derivation
                                            1. Applied rewrites28.2%

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

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

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

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

                                              \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\sin \left(\frac{\mathsf{PI}\left(\right)}{2} + \mathsf{fma}\left(\log x.im, y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)} \]
                                            4. 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}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                            5. Step-by-step derivation
                                              1. Applied rewrites47.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 \color{blue}{\sin \left(\mathsf{fma}\left(\mathsf{PI}\left(\right), 0.5, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)} \]
                                              2. Taylor expanded in y.re around 0

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

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

                                                if 8500 < y.re

                                                1. Initial program 38.6%

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

                                                  \[\leadsto \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. Applied rewrites33.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) \]
                                                  2. 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)} \]
                                                  3. Step-by-step derivation
                                                    1. Applied rewrites70.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)} \]
                                                  4. Recombined 3 regimes into one program.
                                                  5. Add Preprocessing

                                                  Alternative 5: 76.9% accurate, 1.3× speedup?

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

                                                    1. Initial program 45.1%

                                                      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                                    2. 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. Applied rewrites38.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) \]
                                                      2. Taylor expanded in y.re around inf

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

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

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

                                                          if -6.49999999999999987e-21 < y.re < 85000

                                                          1. Initial program 40.3%

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

                                                            \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + 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.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                          4. Step-by-step derivation
                                                            1. Applied rewrites48.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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                            2. Taylor expanded in x.re around inf

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

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

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

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

                                                                if 85000 < y.re

                                                                1. Initial program 38.6%

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

                                                                  \[\leadsto \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. Applied rewrites33.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) \]
                                                                  2. 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)} \]
                                                                  3. Step-by-step derivation
                                                                    1. Applied rewrites70.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)} \]
                                                                  4. Recombined 3 regimes into one program.
                                                                  5. Add Preprocessing

                                                                  Alternative 6: 74.8% accurate, 1.5× speedup?

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

                                                                    1. Initial program 45.1%

                                                                      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                                                    2. 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. Applied rewrites38.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) \]
                                                                      2. Taylor expanded in y.re around inf

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

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

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

                                                                          if -6.49999999999999987e-21 < y.re < 85000

                                                                          1. Initial program 40.3%

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

                                                                            \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + 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.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                          4. Step-by-step derivation
                                                                            1. Applied rewrites48.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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                            2. Taylor expanded in x.re around inf

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

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

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

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

                                                                                if 85000 < y.re

                                                                                1. Initial program 38.6%

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

                                                                                  \[\leadsto \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. Applied rewrites33.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) \]
                                                                                  2. Taylor expanded in y.re around inf

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

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

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

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

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

                                                                                        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \color{blue}{\sin \left(\left(\mathsf{neg}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)} \]
                                                                                      5. lift-PI.f64N/A

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

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

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

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

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

                                                                                  Alternative 7: 73.8% accurate, 1.6× speedup?

                                                                                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ t_1 := \cos t\_0\\ \mathbf{if}\;y.re \leq -6.5 \cdot 10^{-21}:\\ \;\;\;\;{\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(0.5 \cdot y.re\right)} \cdot t\_1\\ \mathbf{elif}\;y.re \leq 4.8 \cdot 10^{+16}:\\ \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_1\\ \mathbf{elif}\;y.re \leq 3.3 \cdot 10^{+123}:\\ \;\;\;\;{x.re}^{y.re} \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(\mathsf{PI}\left(\right), 0.5, t\_0\right)\right)\\ \end{array} \end{array} \]
                                                                                  (FPCore (x.re x.im y.re y.im)
                                                                                   :precision binary64
                                                                                   (let* ((t_0 (* (atan2 x.im x.re) y.re)) (t_1 (cos t_0)))
                                                                                     (if (<= y.re -6.5e-21)
                                                                                       (* (pow (fma x.im x.im (* x.re x.re)) (* 0.5 y.re)) t_1)
                                                                                       (if (<= y.re 4.8e+16)
                                                                                         (* (exp (* (- y.im) (atan2 x.im x.re))) t_1)
                                                                                         (if (<= y.re 3.3e+123)
                                                                                           (* (pow x.re y.re) t_1)
                                                                                           (* (pow (hypot x.im x.re) y.re) (sin (fma (PI) 0.5 t_0))))))))
                                                                                  \begin{array}{l}
                                                                                  
                                                                                  \\
                                                                                  \begin{array}{l}
                                                                                  t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
                                                                                  t_1 := \cos t\_0\\
                                                                                  \mathbf{if}\;y.re \leq -6.5 \cdot 10^{-21}:\\
                                                                                  \;\;\;\;{\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(0.5 \cdot y.re\right)} \cdot t\_1\\
                                                                                  
                                                                                  \mathbf{elif}\;y.re \leq 4.8 \cdot 10^{+16}:\\
                                                                                  \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_1\\
                                                                                  
                                                                                  \mathbf{elif}\;y.re \leq 3.3 \cdot 10^{+123}:\\
                                                                                  \;\;\;\;{x.re}^{y.re} \cdot t\_1\\
                                                                                  
                                                                                  \mathbf{else}:\\
                                                                                  \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(\mathsf{PI}\left(\right), 0.5, t\_0\right)\right)\\
                                                                                  
                                                                                  
                                                                                  \end{array}
                                                                                  \end{array}
                                                                                  
                                                                                  Derivation
                                                                                  1. Split input into 4 regimes
                                                                                  2. if y.re < -6.49999999999999987e-21

                                                                                    1. Initial program 45.1%

                                                                                      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                                                                    2. 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. Applied rewrites38.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) \]
                                                                                      2. Taylor expanded in y.re around inf

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

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

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

                                                                                          if -6.49999999999999987e-21 < y.re < 4.8e16

                                                                                          1. Initial program 41.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 inf

                                                                                            \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + 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.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                                                                                          4. Step-by-step derivation
                                                                                            1. Applied rewrites49.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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                            2. Taylor expanded in x.re around inf

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

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

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

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

                                                                                                if 4.8e16 < y.re < 3.30000000000000003e123

                                                                                                1. Initial program 33.3%

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

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

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

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

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

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

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

                                                                                                      if 3.30000000000000003e123 < y.re

                                                                                                      1. Initial program 38.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. Applied rewrites36.2%

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

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

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

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

                                                                                                        Alternative 8: 59.9% accurate, 1.6× speedup?

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

                                                                                                          1. Initial program 42.0%

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

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

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

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

                                                                                                              if 1.85000000000000006e121 < y.re

                                                                                                              1. Initial program 37.8%

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

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

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

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

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

                                                                                                                Alternative 9: 61.5% accurate, 1.6× speedup?

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

                                                                                                                  1. Initial program 37.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. Applied rewrites17.7%

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

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

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

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

                                                                                                                        if -1.3e41 < y.im

                                                                                                                        1. Initial program 42.2%

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

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

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

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

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

                                                                                                                          Alternative 10: 57.9% accurate, 2.0× speedup?

                                                                                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -9.5 \cdot 10^{-13} \lor \neg \left(y.re \leq 1.15 \cdot 10^{-167}\right):\\ \;\;\;\;{\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(0.5 \cdot y.re\right)} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \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 -9.5e-13) (not (<= y.re 1.15e-167)))
                                                                                                                             (*
                                                                                                                              (pow (fma x.im x.im (* x.re x.re)) (* 0.5 y.re))
                                                                                                                              (cos (* (atan2 x.im x.re) 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 <= -9.5e-13) || !(y_46_re <= 1.15e-167)) {
                                                                                                                          		tmp = pow(fma(x_46_im, x_46_im, (x_46_re * x_46_re)), (0.5 * y_46_re)) * cos((atan2(x_46_im, x_46_re) * y_46_re));
                                                                                                                          	} else {
                                                                                                                          		tmp = 1.0 * cos((log(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 <= -9.5e-13) || !(y_46_re <= 1.15e-167))
                                                                                                                          		tmp = Float64((fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)) ^ Float64(0.5 * y_46_re)) * cos(Float64(atan(x_46_im, x_46_re) * 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
                                                                                                                          
                                                                                                                          code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -9.5e-13], N[Not[LessEqual[y$46$re, 1.15e-167]], $MachinePrecision]], N[(N[Power[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $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 -9.5 \cdot 10^{-13} \lor \neg \left(y.re \leq 1.15 \cdot 10^{-167}\right):\\
                                                                                                                          \;\;\;\;{\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(0.5 \cdot y.re\right)} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
                                                                                                                          
                                                                                                                          \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 < -9.49999999999999991e-13 or 1.1500000000000001e-167 < y.re

                                                                                                                            1. Initial program 42.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. Applied rewrites33.1%

                                                                                                                                \[\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) \]
                                                                                                                              2. Taylor expanded in y.re around inf

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

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

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

                                                                                                                                  if -9.49999999999999991e-13 < y.re < 1.1500000000000001e-167

                                                                                                                                  1. Initial program 40.2%

                                                                                                                                    \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                                                                                                                  2. Add Preprocessing
                                                                                                                                  3. Taylor expanded in y.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. Applied rewrites22.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) \]
                                                                                                                                    2. Taylor expanded in y.re around inf

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

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

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

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

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

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

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

                                                                                                                                        Alternative 11: 50.5% accurate, 2.1× speedup?

                                                                                                                                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{if}\;y.re \leq -4 \cdot 10^{+151}:\\ \;\;\;\;{x.im}^{y.re} \cdot t\_0\\ \mathbf{elif}\;y.re \leq -1650000000000 \lor \neg \left(y.re \leq 9.8 \cdot 10^{-70}\right):\\ \;\;\;\;{x.re}^{y.re} \cdot t\_0\\ \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
                                                                                                                                         (let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
                                                                                                                                           (if (<= y.re -4e+151)
                                                                                                                                             (* (pow x.im y.re) t_0)
                                                                                                                                             (if (or (<= y.re -1650000000000.0) (not (<= y.re 9.8e-70)))
                                                                                                                                               (* (pow x.re y.re) t_0)
                                                                                                                                               (* 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 t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
                                                                                                                                        	double tmp;
                                                                                                                                        	if (y_46_re <= -4e+151) {
                                                                                                                                        		tmp = pow(x_46_im, y_46_re) * t_0;
                                                                                                                                        	} else if ((y_46_re <= -1650000000000.0) || !(y_46_re <= 9.8e-70)) {
                                                                                                                                        		tmp = pow(x_46_re, y_46_re) * t_0;
                                                                                                                                        	} 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 t_0 = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
                                                                                                                                        	double tmp;
                                                                                                                                        	if (y_46_re <= -4e+151) {
                                                                                                                                        		tmp = Math.pow(x_46_im, y_46_re) * t_0;
                                                                                                                                        	} else if ((y_46_re <= -1650000000000.0) || !(y_46_re <= 9.8e-70)) {
                                                                                                                                        		tmp = Math.pow(x_46_re, y_46_re) * t_0;
                                                                                                                                        	} 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):
                                                                                                                                        	t_0 = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re))
                                                                                                                                        	tmp = 0
                                                                                                                                        	if y_46_re <= -4e+151:
                                                                                                                                        		tmp = math.pow(x_46_im, y_46_re) * t_0
                                                                                                                                        	elif (y_46_re <= -1650000000000.0) or not (y_46_re <= 9.8e-70):
                                                                                                                                        		tmp = math.pow(x_46_re, y_46_re) * t_0
                                                                                                                                        	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)
                                                                                                                                        	t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re))
                                                                                                                                        	tmp = 0.0
                                                                                                                                        	if (y_46_re <= -4e+151)
                                                                                                                                        		tmp = Float64((x_46_im ^ y_46_re) * t_0);
                                                                                                                                        	elseif ((y_46_re <= -1650000000000.0) || !(y_46_re <= 9.8e-70))
                                                                                                                                        		tmp = Float64((x_46_re ^ y_46_re) * t_0);
                                                                                                                                        	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)
                                                                                                                                        	t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
                                                                                                                                        	tmp = 0.0;
                                                                                                                                        	if (y_46_re <= -4e+151)
                                                                                                                                        		tmp = (x_46_im ^ y_46_re) * t_0;
                                                                                                                                        	elseif ((y_46_re <= -1650000000000.0) || ~((y_46_re <= 9.8e-70)))
                                                                                                                                        		tmp = (x_46_re ^ y_46_re) * t_0;
                                                                                                                                        	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_] := Block[{t$95$0 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -4e+151], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[Or[LessEqual[y$46$re, -1650000000000.0], N[Not[LessEqual[y$46$re, 9.8e-70]], $MachinePrecision]], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$0), $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}
                                                                                                                                        t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
                                                                                                                                        \mathbf{if}\;y.re \leq -4 \cdot 10^{+151}:\\
                                                                                                                                        \;\;\;\;{x.im}^{y.re} \cdot t\_0\\
                                                                                                                                        
                                                                                                                                        \mathbf{elif}\;y.re \leq -1650000000000 \lor \neg \left(y.re \leq 9.8 \cdot 10^{-70}\right):\\
                                                                                                                                        \;\;\;\;{x.re}^{y.re} \cdot t\_0\\
                                                                                                                                        
                                                                                                                                        \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 3 regimes
                                                                                                                                        2. if y.re < -4.00000000000000007e151

                                                                                                                                          1. Initial program 45.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. Applied rewrites43.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) \]
                                                                                                                                            2. Taylor expanded in y.re around inf

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

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

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

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

                                                                                                                                                if -4.00000000000000007e151 < y.re < -1.65e12 or 9.8000000000000001e-70 < y.re

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

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

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

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

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

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

                                                                                                                                                      if -1.65e12 < y.re < 9.8000000000000001e-70

                                                                                                                                                      1. Initial program 40.5%

                                                                                                                                                        \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                                                                                                                                      2. Add Preprocessing
                                                                                                                                                      3. Taylor expanded in y.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. Applied rewrites23.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) \]
                                                                                                                                                        2. Taylor expanded in y.re around inf

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

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

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

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

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

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

                                                                                                                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -4 \cdot 10^{+151}:\\ \;\;\;\;{x.im}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;y.re \leq -1650000000000 \lor \neg \left(y.re \leq 9.8 \cdot 10^{-70}\right):\\ \;\;\;\;{x.re}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\ \end{array} \]
                                                                                                                                                            6. Add Preprocessing

                                                                                                                                                            Alternative 12: 49.6% accurate, 2.1× speedup?

                                                                                                                                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -45 \lor \neg \left(y.re \leq 0.0095\right):\\ \;\;\;\;{x.im}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \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 -45.0) (not (<= y.re 0.0095)))
                                                                                                                                                               (* (pow x.im y.re) (cos (* (atan2 x.im x.re) 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 <= -45.0) || !(y_46_re <= 0.0095)) {
                                                                                                                                                            		tmp = pow(x_46_im, y_46_re) * cos((atan2(x_46_im, x_46_re) * 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 <= -45.0) || !(y_46_re <= 0.0095)) {
                                                                                                                                                            		tmp = Math.pow(x_46_im, y_46_re) * Math.cos((Math.atan2(x_46_im, x_46_re) * 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 <= -45.0) or not (y_46_re <= 0.0095):
                                                                                                                                                            		tmp = math.pow(x_46_im, y_46_re) * math.cos((math.atan2(x_46_im, x_46_re) * 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 <= -45.0) || !(y_46_re <= 0.0095))
                                                                                                                                                            		tmp = Float64((x_46_im ^ y_46_re) * cos(Float64(atan(x_46_im, x_46_re) * 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 <= -45.0) || ~((y_46_re <= 0.0095)))
                                                                                                                                                            		tmp = (x_46_im ^ y_46_re) * cos((atan2(x_46_im, x_46_re) * 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, -45.0], N[Not[LessEqual[y$46$re, 0.0095]], $MachinePrecision]], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $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 -45 \lor \neg \left(y.re \leq 0.0095\right):\\
                                                                                                                                                            \;\;\;\;{x.im}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
                                                                                                                                                            
                                                                                                                                                            \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 < -45 or 0.00949999999999999976 < y.re

                                                                                                                                                              1. Initial program 41.2%

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

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

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

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

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

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

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

                                                                                                                                                                    if -45 < y.re < 0.00949999999999999976

                                                                                                                                                                    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.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. Applied rewrites23.1%

                                                                                                                                                                        \[\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) \]
                                                                                                                                                                      2. Taylor expanded in y.re around inf

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

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

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

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

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

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

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

                                                                                                                                                                          Alternative 13: 25.6% accurate, 2.2× speedup?

                                                                                                                                                                          \[\begin{array}{l} \\ 1 \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right) \end{array} \]
                                                                                                                                                                          (FPCore (x.re x.im y.re y.im)
                                                                                                                                                                           :precision binary64
                                                                                                                                                                           (* 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) {
                                                                                                                                                                          	return 1.0 * cos((log(hypot(x_46_im, x_46_re)) * y_46_im));
                                                                                                                                                                          }
                                                                                                                                                                          
                                                                                                                                                                          public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                                                                                                          	return 1.0 * Math.cos((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
                                                                                                                                                                          }
                                                                                                                                                                          
                                                                                                                                                                          def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                                                                                                                                                          	return 1.0 * math.cos((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im))
                                                                                                                                                                          
                                                                                                                                                                          function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                                                                                                          	return Float64(1.0 * cos(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)))
                                                                                                                                                                          end
                                                                                                                                                                          
                                                                                                                                                                          function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                                                                                                          	tmp = 1.0 * cos((log(hypot(x_46_im, x_46_re)) * y_46_im));
                                                                                                                                                                          end
                                                                                                                                                                          
                                                                                                                                                                          code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 * N[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}
                                                                                                                                                                          
                                                                                                                                                                          \\
                                                                                                                                                                          1 \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)
                                                                                                                                                                          \end{array}
                                                                                                                                                                          
                                                                                                                                                                          Derivation
                                                                                                                                                                          1. Initial program 41.4%

                                                                                                                                                                            \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                                                                                                                                                          2. 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. Applied rewrites29.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) \]
                                                                                                                                                                            2. Taylor expanded in y.re around inf

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

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

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

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

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

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

                                                                                                                                                                                  Alternative 14: 25.4% accurate, 3.0× speedup?

                                                                                                                                                                                  \[\begin{array}{l} \\ 1 \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \end{array} \]
                                                                                                                                                                                  (FPCore (x.re x.im y.re y.im)
                                                                                                                                                                                   :precision binary64
                                                                                                                                                                                   (* 1.0 (sin (+ (/ (PI) 2.0) (* (atan2 x.im x.re) y.re)))))
                                                                                                                                                                                  \begin{array}{l}
                                                                                                                                                                                  
                                                                                                                                                                                  \\
                                                                                                                                                                                  1 \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
                                                                                                                                                                                  \end{array}
                                                                                                                                                                                  
                                                                                                                                                                                  Derivation
                                                                                                                                                                                  1. Initial program 41.4%

                                                                                                                                                                                    \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                                                                                                                                                                  2. 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. Applied rewrites29.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) \]
                                                                                                                                                                                    2. Taylor expanded in y.re around inf

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

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

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

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

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

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

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

                                                                                                                                                                                            \[\leadsto 1 \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \frac{\color{blue}{\mathsf{PI}\left(\right)}}{2}\right) \]
                                                                                                                                                                                          5. lift-/.f64N/A

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

                                                                                                                                                                                            \[\leadsto 1 \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{2} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]
                                                                                                                                                                                          7. lower-+.f6422.3

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

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

                                                                                                                                                                                        Alternative 15: 25.4% accurate, 3.2× speedup?

                                                                                                                                                                                        \[\begin{array}{l} \\ 1 \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \end{array} \]
                                                                                                                                                                                        (FPCore (x.re x.im y.re y.im)
                                                                                                                                                                                         :precision binary64
                                                                                                                                                                                         (* 1.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) {
                                                                                                                                                                                        	return 1.0 * cos((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
                                                                                                                                                                                            code = 1.0d0 * cos((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) {
                                                                                                                                                                                        	return 1.0 * Math.cos((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):
                                                                                                                                                                                        	return 1.0 * math.cos((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)
                                                                                                                                                                                        	return Float64(1.0 * cos(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)
                                                                                                                                                                                        	tmp = 1.0 * cos((atan2(x_46_im, x_46_re) * y_46_re));
                                                                                                                                                                                        end
                                                                                                                                                                                        
                                                                                                                                                                                        code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 * N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                                                                                                                                                                                        
                                                                                                                                                                                        \begin{array}{l}
                                                                                                                                                                                        
                                                                                                                                                                                        \\
                                                                                                                                                                                        1 \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
                                                                                                                                                                                        \end{array}
                                                                                                                                                                                        
                                                                                                                                                                                        Derivation
                                                                                                                                                                                        1. Initial program 41.4%

                                                                                                                                                                                          \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                                                                                                                                                                        2. 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. Applied rewrites29.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) \]
                                                                                                                                                                                          2. Taylor expanded in y.re around inf

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

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

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

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

                                                                                                                                                                                              Reproduce

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