powComplex, real part

Percentage Accurate: 42.2% → 79.8%
Time: 10.6s
Alternatives: 14
Speedup: 5.7×

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 14 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: 42.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.8% accurate, 0.9× 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 -1.05 \cdot 10^{-21}:\\ \;\;\;\;t\_0 \cdot \sin \left(\left(-\mathsf{fma}\left(y.im, t\_1, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)\\ \mathbf{elif}\;y.re \leq 0.00068:\\ \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), y.im \cdot t\_1\right)\right)\\ \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 -1.05e-21)
     (*
      t_0
      (sin (+ (- (fma y.im t_1 (* (atan2 x.im x.re) y.re))) (/ (PI) 2.0))))
     (if (<= y.re 0.00068)
       (*
        (exp (* (- y.im) (atan2 x.im x.re)))
        (sin (fma 0.5 (PI) (* y.im t_1))))
       (* 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 -1.05 \cdot 10^{-21}:\\
\;\;\;\;t\_0 \cdot \sin \left(\left(-\mathsf{fma}\left(y.im, t\_1, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)\\

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

\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 < -1.05000000000000006e-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. Step-by-step derivation
      1. lift-cos.f64N/A

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

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

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

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

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

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

    if -1.05000000000000006e-21 < y.re < 6.8e-4

    1. Initial program 39.5%

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

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

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

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

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

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

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

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

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

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

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

      if 6.8e-4 < y.re

      1. Initial program 42.9%

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

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

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

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

      Alternative 2: 80.4% accurate, 1.0× 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.05 \cdot 10^{-21} \lor \neg \left(y.re \leq 0.00068\right):\\ \;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im\right)\\ \mathbf{else}:\\ \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), y.im \cdot t\_0\right)\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 (or (<= y.re -1.05e-21) (not (<= y.re 0.00068)))
           (*
            (exp
             (-
              (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
              (* (atan2 x.im x.re) y.im)))
            (cos (* t_0 y.im)))
           (*
            (exp (* (- y.im) (atan2 x.im x.re)))
            (sin (fma 0.5 (PI) (* y.im t_0)))))))
      \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.05 \cdot 10^{-21} \lor \neg \left(y.re \leq 0.00068\right):\\
      \;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), y.im \cdot t\_0\right)\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y.re < -1.05000000000000006e-21 or 6.8e-4 < y.re

        1. Initial program 43.9%

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

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

          if -1.05000000000000006e-21 < y.re < 6.8e-4

          1. Initial program 39.5%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -1.05 \cdot 10^{-21} \lor \neg \left(y.re \leq 0.00068\right):\\ \;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\ \mathbf{else}:\\ \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\\ \end{array} \]
          9. Add Preprocessing

          Alternative 3: 78.7% accurate, 1.2× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -2.5 \cdot 10^{-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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;y.re \leq 9.5 \cdot 10^{-8}:\\ \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1\\ \end{array} \end{array} \]
          (FPCore (x.re x.im y.re y.im)
           :precision binary64
           (if (<= y.re -2.5e-8)
             (*
              (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 9.5e-8)
               (*
                (exp (* (- y.im) (atan2 x.im x.re)))
                (sin (fma 0.5 (PI) (* y.im (log (hypot x.im x.re))))))
               (* (pow (hypot x.im x.re) y.re) 1.0))))
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y.re \leq -2.5 \cdot 10^{-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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
          
          \mathbf{elif}\;y.re \leq 9.5 \cdot 10^{-8}:\\
          \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if y.re < -2.4999999999999999e-8

            1. Initial program 44.9%

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

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

              if -2.4999999999999999e-8 < y.re < 9.50000000000000036e-8

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

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

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

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

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

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

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

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

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

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

                if 9.50000000000000036e-8 < y.re

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

                    \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\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 1 \]
                  3. Step-by-step derivation
                    1. Applied rewrites77.8%

                      \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1 \]
                  4. Recombined 3 regimes into one program.
                  5. Final simplification81.8%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -2.5 \cdot 10^{-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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;y.re \leq 9.5 \cdot 10^{-8}:\\ \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1\\ \end{array} \]
                  6. Add Preprocessing

                  Alternative 4: 77.4% accurate, 1.3× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{if}\;y.re \leq -1.05 \cdot 10^{-21}:\\ \;\;\;\;t\_0 \cdot \sin \left(\mathsf{fma}\left(-\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\\ \mathbf{elif}\;y.re \leq 9.5 \cdot 10^{-8}:\\ \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot 1\\ \end{array} \end{array} \]
                  (FPCore (x.re x.im y.re y.im)
                   :precision binary64
                   (let* ((t_0 (pow (hypot x.im x.re) y.re)))
                     (if (<= y.re -1.05e-21)
                       (* t_0 (sin (fma (- (atan2 x.im x.re)) y.re (/ (PI) 2.0))))
                       (if (<= y.re 9.5e-8)
                         (*
                          (exp (* (- y.im) (atan2 x.im x.re)))
                          (sin (fma 0.5 (PI) (* y.im (log (hypot x.im x.re))))))
                         (* t_0 1.0)))))
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
                  \mathbf{if}\;y.re \leq -1.05 \cdot 10^{-21}:\\
                  \;\;\;\;t\_0 \cdot \sin \left(\mathsf{fma}\left(-\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\\
                  
                  \mathbf{elif}\;y.re \leq 9.5 \cdot 10^{-8}:\\
                  \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_0 \cdot 1\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if y.re < -1.05000000000000006e-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}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                    4. Step-by-step derivation
                      1. Applied rewrites68.9%

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

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

                        if -1.05000000000000006e-21 < y.re < 9.50000000000000036e-8

                        1. Initial program 39.8%

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

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

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

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

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

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

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

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

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

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

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

                          if 9.50000000000000036e-8 < y.re

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

                              \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\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 1 \]
                            3. Step-by-step derivation
                              1. Applied rewrites77.8%

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

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

                            Alternative 5: 76.8% accurate, 1.6× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{if}\;y.re \leq -1.05 \cdot 10^{-21}:\\ \;\;\;\;t\_0 \cdot \sin \left(\mathsf{fma}\left(-\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\\ \mathbf{elif}\;y.re \leq 1.3 \cdot 10^{-8}:\\ \;\;\;\;1 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot 1\\ \end{array} \end{array} \]
                            (FPCore (x.re x.im y.re y.im)
                             :precision binary64
                             (let* ((t_0 (pow (hypot x.im x.re) y.re)))
                               (if (<= y.re -1.05e-21)
                                 (* t_0 (sin (fma (- (atan2 x.im x.re)) y.re (/ (PI) 2.0))))
                                 (if (<= y.re 1.3e-8)
                                   (* 1.0 (exp (* (- y.im) (atan2 x.im x.re))))
                                   (* t_0 1.0)))))
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
                            \mathbf{if}\;y.re \leq -1.05 \cdot 10^{-21}:\\
                            \;\;\;\;t\_0 \cdot \sin \left(\mathsf{fma}\left(-\tan^{-1}_* \frac{x.im}{x.re}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\\
                            
                            \mathbf{elif}\;y.re \leq 1.3 \cdot 10^{-8}:\\
                            \;\;\;\;1 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;t\_0 \cdot 1\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if y.re < -1.05000000000000006e-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}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                              4. Step-by-step derivation
                                1. Applied rewrites68.9%

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

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

                                  if -1.05000000000000006e-21 < y.re < 1.3000000000000001e-8

                                  1. Initial program 39.8%

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

                                    \[\leadsto \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)}} \]
                                  4. Step-by-step derivation
                                    1. Applied rewrites81.9%

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

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

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

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

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

                                        if 1.3000000000000001e-8 < y.re

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

                                            \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\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 1 \]
                                          3. Step-by-step derivation
                                            1. Applied rewrites77.8%

                                              \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1 \]
                                          4. Recombined 3 regimes into one program.
                                          5. Add Preprocessing

                                          Alternative 6: 76.5% accurate, 3.0× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -65000000000000:\\ \;\;\;\;{\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re} \cdot 1\\ \mathbf{elif}\;y.re \leq 1.3 \cdot 10^{-8}:\\ \;\;\;\;1 \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 1\\ \end{array} \end{array} \]
                                          (FPCore (x.re x.im y.re y.im)
                                           :precision binary64
                                           (if (<= y.re -65000000000000.0)
                                             (* (pow (fma (/ (* x.im x.im) x.re) 0.5 x.re) y.re) 1.0)
                                             (if (<= y.re 1.3e-8)
                                               (* 1.0 (exp (* (- y.im) (atan2 x.im x.re))))
                                               (* (pow (hypot x.im x.re) y.re) 1.0))))
                                          double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                          	double tmp;
                                          	if (y_46_re <= -65000000000000.0) {
                                          		tmp = pow(fma(((x_46_im * x_46_im) / x_46_re), 0.5, x_46_re), y_46_re) * 1.0;
                                          	} else if (y_46_re <= 1.3e-8) {
                                          		tmp = 1.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) * 1.0;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                          	tmp = 0.0
                                          	if (y_46_re <= -65000000000000.0)
                                          		tmp = Float64((fma(Float64(Float64(x_46_im * x_46_im) / x_46_re), 0.5, x_46_re) ^ y_46_re) * 1.0);
                                          	elseif (y_46_re <= 1.3e-8)
                                          		tmp = Float64(1.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) * 1.0);
                                          	end
                                          	return tmp
                                          end
                                          
                                          code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -65000000000000.0], N[(N[Power[N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] * 0.5 + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[y$46$re, 1.3e-8], N[(1.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] * 1.0), $MachinePrecision]]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;y.re \leq -65000000000000:\\
                                          \;\;\;\;{\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re} \cdot 1\\
                                          
                                          \mathbf{elif}\;y.re \leq 1.3 \cdot 10^{-8}:\\
                                          \;\;\;\;1 \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 1\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 3 regimes
                                          2. if y.re < -6.5e13

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

                                                \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\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 1 \]
                                              3. Step-by-step derivation
                                                1. Applied rewrites74.1%

                                                  \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1 \]
                                                2. Taylor expanded in x.im around 0

                                                  \[\leadsto {\left(x.re + \frac{1}{2} \cdot \frac{{x.im}^{2}}{x.re}\right)}^{y.re} \cdot 1 \]
                                                3. Step-by-step derivation
                                                  1. Applied rewrites78.4%

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

                                                  if -6.5e13 < y.re < 1.3000000000000001e-8

                                                  1. Initial program 40.5%

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

                                                    \[\leadsto \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)}} \]
                                                  4. Step-by-step derivation
                                                    1. Applied rewrites81.6%

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

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

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

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

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

                                                        if 1.3000000000000001e-8 < y.re

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

                                                            \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\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 1 \]
                                                          3. Step-by-step derivation
                                                            1. Applied rewrites77.8%

                                                              \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1 \]
                                                          4. Recombined 3 regimes into one program.
                                                          5. Add Preprocessing

                                                          Alternative 7: 63.9% accurate, 3.2× speedup?

                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.im \leq -3.3 \cdot 10^{+40}:\\ \;\;\;\;{\left(\mathsf{fma}\left(\frac{0.5}{x.re}, \frac{x.im \cdot x.im}{x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1\\ \end{array} \end{array} \]
                                                          (FPCore (x.re x.im y.re y.im)
                                                           :precision binary64
                                                           (if (<= y.im -3.3e+40)
                                                             (* (pow (* (fma (/ 0.5 x.re) (/ (* x.im x.im) x.re) 1.0) x.re) y.re) 1.0)
                                                             (* (pow (hypot x.im x.re) y.re) 1.0)))
                                                          double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                          	double tmp;
                                                          	if (y_46_im <= -3.3e+40) {
                                                          		tmp = pow((fma((0.5 / x_46_re), ((x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re), y_46_re) * 1.0;
                                                          	} else {
                                                          		tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * 1.0;
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                          	tmp = 0.0
                                                          	if (y_46_im <= -3.3e+40)
                                                          		tmp = Float64((Float64(fma(Float64(0.5 / x_46_re), Float64(Float64(x_46_im * x_46_im) / x_46_re), 1.0) * x_46_re) ^ y_46_re) * 1.0);
                                                          	else
                                                          		tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * 1.0);
                                                          	end
                                                          	return tmp
                                                          end
                                                          
                                                          code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -3.3e+40], N[(N[Power[N[(N[(N[(0.5 / x$46$re), $MachinePrecision] * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + 1.0), $MachinePrecision] * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]
                                                          
                                                          \begin{array}{l}
                                                          
                                                          \\
                                                          \begin{array}{l}
                                                          \mathbf{if}\;y.im \leq -3.3 \cdot 10^{+40}:\\
                                                          \;\;\;\;{\left(\mathsf{fma}\left(\frac{0.5}{x.re}, \frac{x.im \cdot x.im}{x.re}, 1\right) \cdot x.re\right)}^{y.re} \cdot 1\\
                                                          
                                                          \mathbf{else}:\\
                                                          \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1\\
                                                          
                                                          
                                                          \end{array}
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Split input into 2 regimes
                                                          2. if y.im < -3.2999999999999998e40

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

                                                                \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\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 1 \]
                                                              3. Step-by-step derivation
                                                                1. Applied rewrites24.1%

                                                                  \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1 \]
                                                                2. Taylor expanded in x.re around inf

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

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

                                                                  if -3.2999999999999998e40 < y.im

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

                                                                      \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\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 1 \]
                                                                    3. Step-by-step derivation
                                                                      1. Applied rewrites74.8%

                                                                        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1 \]
                                                                    4. Recombined 2 regimes into one program.
                                                                    5. Add Preprocessing

                                                                    Alternative 8: 59.4% accurate, 4.5× speedup?

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

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

                                                                          \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\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 1 \]
                                                                        3. Step-by-step derivation
                                                                          1. Applied rewrites69.5%

                                                                            \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1 \]
                                                                          2. Taylor expanded in x.re around inf

                                                                            \[\leadsto {\left(x.re \cdot \left(1 + \frac{1}{2} \cdot \frac{{x.im}^{2}}{{x.re}^{2}}\right)\right)}^{y.re} \cdot 1 \]
                                                                          3. Step-by-step derivation
                                                                            1. Applied rewrites71.4%

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

                                                                            if -2.40000000000000002e-27 < y.re < 1.59999999999999993e-5

                                                                            1. Initial program 39.0%

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

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

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

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

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

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

                                                                                  if 1.59999999999999993e-5 < y.re

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

                                                                                      \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\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 1 \]
                                                                                    3. Step-by-step derivation
                                                                                      1. Applied rewrites77.9%

                                                                                        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1 \]
                                                                                      2. Taylor expanded in x.im around 0

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

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

                                                                                      Alternative 9: 59.4% accurate, 4.8× speedup?

                                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -2.55 \cdot 10^{-27} \lor \neg \left(y.re \leq 1.6 \cdot 10^{-5}\right):\\ \;\;\;\;{\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y.im, \tan^{-1}_* \frac{x.im}{x.re}, 1\right)\\ \end{array} \end{array} \]
                                                                                      (FPCore (x.re x.im y.re y.im)
                                                                                       :precision binary64
                                                                                       (if (or (<= y.re -2.55e-27) (not (<= y.re 1.6e-5)))
                                                                                         (* (pow (fma (/ (* x.im x.im) x.re) 0.5 x.re) y.re) 1.0)
                                                                                         (fma (- y.im) (atan2 x.im x.re) 1.0)))
                                                                                      double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                      	double tmp;
                                                                                      	if ((y_46_re <= -2.55e-27) || !(y_46_re <= 1.6e-5)) {
                                                                                      		tmp = pow(fma(((x_46_im * x_46_im) / x_46_re), 0.5, x_46_re), y_46_re) * 1.0;
                                                                                      	} else {
                                                                                      		tmp = fma(-y_46_im, atan2(x_46_im, x_46_re), 1.0);
                                                                                      	}
                                                                                      	return tmp;
                                                                                      }
                                                                                      
                                                                                      function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                      	tmp = 0.0
                                                                                      	if ((y_46_re <= -2.55e-27) || !(y_46_re <= 1.6e-5))
                                                                                      		tmp = Float64((fma(Float64(Float64(x_46_im * x_46_im) / x_46_re), 0.5, x_46_re) ^ y_46_re) * 1.0);
                                                                                      	else
                                                                                      		tmp = fma(Float64(-y_46_im), atan(x_46_im, x_46_re), 1.0);
                                                                                      	end
                                                                                      	return tmp
                                                                                      end
                                                                                      
                                                                                      code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -2.55e-27], N[Not[LessEqual[y$46$re, 1.6e-5]], $MachinePrecision]], N[(N[Power[N[(N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] * 0.5 + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + 1.0), $MachinePrecision]]
                                                                                      
                                                                                      \begin{array}{l}
                                                                                      
                                                                                      \\
                                                                                      \begin{array}{l}
                                                                                      \mathbf{if}\;y.re \leq -2.55 \cdot 10^{-27} \lor \neg \left(y.re \leq 1.6 \cdot 10^{-5}\right):\\
                                                                                      \;\;\;\;{\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re} \cdot 1\\
                                                                                      
                                                                                      \mathbf{else}:\\
                                                                                      \;\;\;\;\mathsf{fma}\left(-y.im, \tan^{-1}_* \frac{x.im}{x.re}, 1\right)\\
                                                                                      
                                                                                      
                                                                                      \end{array}
                                                                                      \end{array}
                                                                                      
                                                                                      Derivation
                                                                                      1. Split input into 2 regimes
                                                                                      2. if y.re < -2.55e-27 or 1.59999999999999993e-5 < y.re

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

                                                                                            \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\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 1 \]
                                                                                          3. Step-by-step derivation
                                                                                            1. Applied rewrites74.1%

                                                                                              \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1 \]
                                                                                            2. Taylor expanded in x.im around 0

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

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

                                                                                              if -2.55e-27 < y.re < 1.59999999999999993e-5

                                                                                              1. Initial program 39.0%

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

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

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

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

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

                                                                                                      \[\leadsto \mathsf{fma}\left(-y.im, \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}, 1\right) \]
                                                                                                  4. Recombined 2 regimes into one program.
                                                                                                  5. Final simplification64.0%

                                                                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -2.55 \cdot 10^{-27} \lor \neg \left(y.re \leq 1.6 \cdot 10^{-5}\right):\\ \;\;\;\;{\left(\mathsf{fma}\left(\frac{x.im \cdot x.im}{x.re}, 0.5, x.re\right)\right)}^{y.re} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y.im, \tan^{-1}_* \frac{x.im}{x.re}, 1\right)\\ \end{array} \]
                                                                                                  6. Add Preprocessing

                                                                                                  Alternative 10: 56.3% accurate, 5.0× speedup?

                                                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x.re \leq -5 \cdot 10^{-310}:\\ \;\;\;\;{\left(-x.re\right)}^{y.re} \cdot 1\\ \mathbf{elif}\;x.re \leq 1.5 \cdot 10^{-18}:\\ \;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;{x.re}^{y.re} \cdot 1\\ \end{array} \end{array} \]
                                                                                                  (FPCore (x.re x.im y.re y.im)
                                                                                                   :precision binary64
                                                                                                   (if (<= x.re -5e-310)
                                                                                                     (* (pow (- x.re) y.re) 1.0)
                                                                                                     (if (<= x.re 1.5e-18)
                                                                                                       (* (pow (* x.im x.im) (/ y.re 2.0)) 1.0)
                                                                                                       (* (pow x.re y.re) 1.0))))
                                                                                                  double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                                  	double tmp;
                                                                                                  	if (x_46_re <= -5e-310) {
                                                                                                  		tmp = pow(-x_46_re, y_46_re) * 1.0;
                                                                                                  	} else if (x_46_re <= 1.5e-18) {
                                                                                                  		tmp = pow((x_46_im * x_46_im), (y_46_re / 2.0)) * 1.0;
                                                                                                  	} else {
                                                                                                  		tmp = pow(x_46_re, y_46_re) * 1.0;
                                                                                                  	}
                                                                                                  	return tmp;
                                                                                                  }
                                                                                                  
                                                                                                  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) :: tmp
                                                                                                      if (x_46re <= (-5d-310)) then
                                                                                                          tmp = (-x_46re ** y_46re) * 1.0d0
                                                                                                      else if (x_46re <= 1.5d-18) then
                                                                                                          tmp = ((x_46im * x_46im) ** (y_46re / 2.0d0)) * 1.0d0
                                                                                                      else
                                                                                                          tmp = (x_46re ** y_46re) * 1.0d0
                                                                                                      end if
                                                                                                      code = tmp
                                                                                                  end function
                                                                                                  
                                                                                                  public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                                  	double tmp;
                                                                                                  	if (x_46_re <= -5e-310) {
                                                                                                  		tmp = Math.pow(-x_46_re, y_46_re) * 1.0;
                                                                                                  	} else if (x_46_re <= 1.5e-18) {
                                                                                                  		tmp = Math.pow((x_46_im * x_46_im), (y_46_re / 2.0)) * 1.0;
                                                                                                  	} else {
                                                                                                  		tmp = Math.pow(x_46_re, y_46_re) * 1.0;
                                                                                                  	}
                                                                                                  	return tmp;
                                                                                                  }
                                                                                                  
                                                                                                  def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                                                                                  	tmp = 0
                                                                                                  	if x_46_re <= -5e-310:
                                                                                                  		tmp = math.pow(-x_46_re, y_46_re) * 1.0
                                                                                                  	elif x_46_re <= 1.5e-18:
                                                                                                  		tmp = math.pow((x_46_im * x_46_im), (y_46_re / 2.0)) * 1.0
                                                                                                  	else:
                                                                                                  		tmp = math.pow(x_46_re, y_46_re) * 1.0
                                                                                                  	return tmp
                                                                                                  
                                                                                                  function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                                  	tmp = 0.0
                                                                                                  	if (x_46_re <= -5e-310)
                                                                                                  		tmp = Float64((Float64(-x_46_re) ^ y_46_re) * 1.0);
                                                                                                  	elseif (x_46_re <= 1.5e-18)
                                                                                                  		tmp = Float64((Float64(x_46_im * x_46_im) ^ Float64(y_46_re / 2.0)) * 1.0);
                                                                                                  	else
                                                                                                  		tmp = Float64((x_46_re ^ y_46_re) * 1.0);
                                                                                                  	end
                                                                                                  	return tmp
                                                                                                  end
                                                                                                  
                                                                                                  function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                                  	tmp = 0.0;
                                                                                                  	if (x_46_re <= -5e-310)
                                                                                                  		tmp = (-x_46_re ^ y_46_re) * 1.0;
                                                                                                  	elseif (x_46_re <= 1.5e-18)
                                                                                                  		tmp = ((x_46_im * x_46_im) ^ (y_46_re / 2.0)) * 1.0;
                                                                                                  	else
                                                                                                  		tmp = (x_46_re ^ y_46_re) * 1.0;
                                                                                                  	end
                                                                                                  	tmp_2 = tmp;
                                                                                                  end
                                                                                                  
                                                                                                  code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, -5e-310], N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$re, 1.5e-18], N[(N[Power[N[(x$46$im * x$46$im), $MachinePrecision], N[(y$46$re / 2.0), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
                                                                                                  
                                                                                                  \begin{array}{l}
                                                                                                  
                                                                                                  \\
                                                                                                  \begin{array}{l}
                                                                                                  \mathbf{if}\;x.re \leq -5 \cdot 10^{-310}:\\
                                                                                                  \;\;\;\;{\left(-x.re\right)}^{y.re} \cdot 1\\
                                                                                                  
                                                                                                  \mathbf{elif}\;x.re \leq 1.5 \cdot 10^{-18}:\\
                                                                                                  \;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)} \cdot 1\\
                                                                                                  
                                                                                                  \mathbf{else}:\\
                                                                                                  \;\;\;\;{x.re}^{y.re} \cdot 1\\
                                                                                                  
                                                                                                  
                                                                                                  \end{array}
                                                                                                  \end{array}
                                                                                                  
                                                                                                  Derivation
                                                                                                  1. Split input into 3 regimes
                                                                                                  2. if x.re < -4.999999999999985e-310

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

                                                                                                        \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\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 1 \]
                                                                                                      3. Step-by-step derivation
                                                                                                        1. Applied rewrites65.8%

                                                                                                          \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1 \]
                                                                                                        2. Taylor expanded in x.re around -inf

                                                                                                          \[\leadsto {\left(-1 \cdot x.re\right)}^{y.re} \cdot 1 \]
                                                                                                        3. Step-by-step derivation
                                                                                                          1. Applied rewrites61.3%

                                                                                                            \[\leadsto {\left(-x.re\right)}^{y.re} \cdot 1 \]

                                                                                                          if -4.999999999999985e-310 < x.re < 1.49999999999999991e-18

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

                                                                                                              \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\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 1 \]
                                                                                                            3. Step-by-step derivation
                                                                                                              1. Applied rewrites62.3%

                                                                                                                \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1 \]
                                                                                                              2. Taylor expanded in x.re around 0

                                                                                                                \[\leadsto {x.im}^{y.re} \cdot 1 \]
                                                                                                              3. Step-by-step derivation
                                                                                                                1. Applied rewrites50.4%

                                                                                                                  \[\leadsto {x.im}^{y.re} \cdot 1 \]
                                                                                                                2. Step-by-step derivation
                                                                                                                  1. Applied rewrites55.1%

                                                                                                                    \[\leadsto {\left(x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)} \cdot 1 \]

                                                                                                                  if 1.49999999999999991e-18 < x.re

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

                                                                                                                      \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\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 1 \]
                                                                                                                    3. Step-by-step derivation
                                                                                                                      1. Applied rewrites63.0%

                                                                                                                        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1 \]
                                                                                                                      2. Taylor expanded in x.re around inf

                                                                                                                        \[\leadsto {x.re}^{y.re} \cdot 1 \]
                                                                                                                      3. Step-by-step derivation
                                                                                                                        1. Applied rewrites62.5%

                                                                                                                          \[\leadsto {x.re}^{y.re} \cdot 1 \]
                                                                                                                      4. Recombined 3 regimes into one program.
                                                                                                                      5. Add Preprocessing

                                                                                                                      Alternative 11: 52.2% accurate, 5.7× speedup?

                                                                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -2.1 \cdot 10^{-11} \lor \neg \left(y.re \leq 1.55\right):\\ \;\;\;\;{x.im}^{y.re} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
                                                                                                                      (FPCore (x.re x.im y.re y.im)
                                                                                                                       :precision binary64
                                                                                                                       (if (or (<= y.re -2.1e-11) (not (<= y.re 1.55))) (* (pow x.im y.re) 1.0) 1.0))
                                                                                                                      double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                                                      	double tmp;
                                                                                                                      	if ((y_46_re <= -2.1e-11) || !(y_46_re <= 1.55)) {
                                                                                                                      		tmp = pow(x_46_im, y_46_re) * 1.0;
                                                                                                                      	} else {
                                                                                                                      		tmp = 1.0;
                                                                                                                      	}
                                                                                                                      	return tmp;
                                                                                                                      }
                                                                                                                      
                                                                                                                      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) :: tmp
                                                                                                                          if ((y_46re <= (-2.1d-11)) .or. (.not. (y_46re <= 1.55d0))) then
                                                                                                                              tmp = (x_46im ** y_46re) * 1.0d0
                                                                                                                          else
                                                                                                                              tmp = 1.0d0
                                                                                                                          end if
                                                                                                                          code = tmp
                                                                                                                      end function
                                                                                                                      
                                                                                                                      public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                                                      	double tmp;
                                                                                                                      	if ((y_46_re <= -2.1e-11) || !(y_46_re <= 1.55)) {
                                                                                                                      		tmp = Math.pow(x_46_im, y_46_re) * 1.0;
                                                                                                                      	} else {
                                                                                                                      		tmp = 1.0;
                                                                                                                      	}
                                                                                                                      	return tmp;
                                                                                                                      }
                                                                                                                      
                                                                                                                      def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                                                                                                      	tmp = 0
                                                                                                                      	if (y_46_re <= -2.1e-11) or not (y_46_re <= 1.55):
                                                                                                                      		tmp = math.pow(x_46_im, y_46_re) * 1.0
                                                                                                                      	else:
                                                                                                                      		tmp = 1.0
                                                                                                                      	return tmp
                                                                                                                      
                                                                                                                      function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                                                      	tmp = 0.0
                                                                                                                      	if ((y_46_re <= -2.1e-11) || !(y_46_re <= 1.55))
                                                                                                                      		tmp = Float64((x_46_im ^ y_46_re) * 1.0);
                                                                                                                      	else
                                                                                                                      		tmp = 1.0;
                                                                                                                      	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 <= -2.1e-11) || ~((y_46_re <= 1.55)))
                                                                                                                      		tmp = (x_46_im ^ y_46_re) * 1.0;
                                                                                                                      	else
                                                                                                                      		tmp = 1.0;
                                                                                                                      	end
                                                                                                                      	tmp_2 = tmp;
                                                                                                                      end
                                                                                                                      
                                                                                                                      code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -2.1e-11], N[Not[LessEqual[y$46$re, 1.55]], $MachinePrecision]], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], 1.0]
                                                                                                                      
                                                                                                                      \begin{array}{l}
                                                                                                                      
                                                                                                                      \\
                                                                                                                      \begin{array}{l}
                                                                                                                      \mathbf{if}\;y.re \leq -2.1 \cdot 10^{-11} \lor \neg \left(y.re \leq 1.55\right):\\
                                                                                                                      \;\;\;\;{x.im}^{y.re} \cdot 1\\
                                                                                                                      
                                                                                                                      \mathbf{else}:\\
                                                                                                                      \;\;\;\;1\\
                                                                                                                      
                                                                                                                      
                                                                                                                      \end{array}
                                                                                                                      \end{array}
                                                                                                                      
                                                                                                                      Derivation
                                                                                                                      1. Split input into 2 regimes
                                                                                                                      2. if y.re < -2.0999999999999999e-11 or 1.55000000000000004 < y.re

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

                                                                                                                            \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\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 1 \]
                                                                                                                          3. Step-by-step derivation
                                                                                                                            1. Applied rewrites75.4%

                                                                                                                              \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1 \]
                                                                                                                            2. Taylor expanded in x.re around 0

                                                                                                                              \[\leadsto {x.im}^{y.re} \cdot 1 \]
                                                                                                                            3. Step-by-step derivation
                                                                                                                              1. Applied rewrites54.5%

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

                                                                                                                              if -2.0999999999999999e-11 < y.re < 1.55000000000000004

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

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

                                                                                                                                  \[\leadsto 1 \]
                                                                                                                                3. Step-by-step derivation
                                                                                                                                  1. Applied rewrites54.6%

                                                                                                                                    \[\leadsto 1 \]
                                                                                                                                4. Recombined 2 regimes into one program.
                                                                                                                                5. Final simplification54.5%

                                                                                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -2.1 \cdot 10^{-11} \lor \neg \left(y.re \leq 1.55\right):\\ \;\;\;\;{x.im}^{y.re} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
                                                                                                                                6. Add Preprocessing

                                                                                                                                Alternative 12: 54.8% accurate, 5.7× speedup?

                                                                                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x.im \leq -1.9 \cdot 10^{-296}:\\ \;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\ \mathbf{elif}\;x.im \leq 5.5 \cdot 10^{-27}:\\ \;\;\;\;{x.re}^{y.re} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;{x.im}^{y.re} \cdot 1\\ \end{array} \end{array} \]
                                                                                                                                (FPCore (x.re x.im y.re y.im)
                                                                                                                                 :precision binary64
                                                                                                                                 (if (<= x.im -1.9e-296)
                                                                                                                                   (* (pow (- x.im) y.re) 1.0)
                                                                                                                                   (if (<= x.im 5.5e-27) (* (pow x.re y.re) 1.0) (* (pow x.im y.re) 1.0))))
                                                                                                                                double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                                                                	double tmp;
                                                                                                                                	if (x_46_im <= -1.9e-296) {
                                                                                                                                		tmp = pow(-x_46_im, y_46_re) * 1.0;
                                                                                                                                	} else if (x_46_im <= 5.5e-27) {
                                                                                                                                		tmp = pow(x_46_re, y_46_re) * 1.0;
                                                                                                                                	} else {
                                                                                                                                		tmp = pow(x_46_im, y_46_re) * 1.0;
                                                                                                                                	}
                                                                                                                                	return tmp;
                                                                                                                                }
                                                                                                                                
                                                                                                                                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) :: tmp
                                                                                                                                    if (x_46im <= (-1.9d-296)) then
                                                                                                                                        tmp = (-x_46im ** y_46re) * 1.0d0
                                                                                                                                    else if (x_46im <= 5.5d-27) then
                                                                                                                                        tmp = (x_46re ** y_46re) * 1.0d0
                                                                                                                                    else
                                                                                                                                        tmp = (x_46im ** y_46re) * 1.0d0
                                                                                                                                    end if
                                                                                                                                    code = tmp
                                                                                                                                end function
                                                                                                                                
                                                                                                                                public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                                                                	double tmp;
                                                                                                                                	if (x_46_im <= -1.9e-296) {
                                                                                                                                		tmp = Math.pow(-x_46_im, y_46_re) * 1.0;
                                                                                                                                	} else if (x_46_im <= 5.5e-27) {
                                                                                                                                		tmp = Math.pow(x_46_re, y_46_re) * 1.0;
                                                                                                                                	} else {
                                                                                                                                		tmp = Math.pow(x_46_im, y_46_re) * 1.0;
                                                                                                                                	}
                                                                                                                                	return tmp;
                                                                                                                                }
                                                                                                                                
                                                                                                                                def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                                                                                                                	tmp = 0
                                                                                                                                	if x_46_im <= -1.9e-296:
                                                                                                                                		tmp = math.pow(-x_46_im, y_46_re) * 1.0
                                                                                                                                	elif x_46_im <= 5.5e-27:
                                                                                                                                		tmp = math.pow(x_46_re, y_46_re) * 1.0
                                                                                                                                	else:
                                                                                                                                		tmp = math.pow(x_46_im, y_46_re) * 1.0
                                                                                                                                	return tmp
                                                                                                                                
                                                                                                                                function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                                                                	tmp = 0.0
                                                                                                                                	if (x_46_im <= -1.9e-296)
                                                                                                                                		tmp = Float64((Float64(-x_46_im) ^ y_46_re) * 1.0);
                                                                                                                                	elseif (x_46_im <= 5.5e-27)
                                                                                                                                		tmp = Float64((x_46_re ^ y_46_re) * 1.0);
                                                                                                                                	else
                                                                                                                                		tmp = Float64((x_46_im ^ y_46_re) * 1.0);
                                                                                                                                	end
                                                                                                                                	return tmp
                                                                                                                                end
                                                                                                                                
                                                                                                                                function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                                                                	tmp = 0.0;
                                                                                                                                	if (x_46_im <= -1.9e-296)
                                                                                                                                		tmp = (-x_46_im ^ y_46_re) * 1.0;
                                                                                                                                	elseif (x_46_im <= 5.5e-27)
                                                                                                                                		tmp = (x_46_re ^ y_46_re) * 1.0;
                                                                                                                                	else
                                                                                                                                		tmp = (x_46_im ^ y_46_re) * 1.0;
                                                                                                                                	end
                                                                                                                                	tmp_2 = tmp;
                                                                                                                                end
                                                                                                                                
                                                                                                                                code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, -1.9e-296], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$im, 5.5e-27], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
                                                                                                                                
                                                                                                                                \begin{array}{l}
                                                                                                                                
                                                                                                                                \\
                                                                                                                                \begin{array}{l}
                                                                                                                                \mathbf{if}\;x.im \leq -1.9 \cdot 10^{-296}:\\
                                                                                                                                \;\;\;\;{\left(-x.im\right)}^{y.re} \cdot 1\\
                                                                                                                                
                                                                                                                                \mathbf{elif}\;x.im \leq 5.5 \cdot 10^{-27}:\\
                                                                                                                                \;\;\;\;{x.re}^{y.re} \cdot 1\\
                                                                                                                                
                                                                                                                                \mathbf{else}:\\
                                                                                                                                \;\;\;\;{x.im}^{y.re} \cdot 1\\
                                                                                                                                
                                                                                                                                
                                                                                                                                \end{array}
                                                                                                                                \end{array}
                                                                                                                                
                                                                                                                                Derivation
                                                                                                                                1. Split input into 3 regimes
                                                                                                                                2. if x.im < -1.9000000000000001e-296

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

                                                                                                                                      \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\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 1 \]
                                                                                                                                    3. Step-by-step derivation
                                                                                                                                      1. Applied rewrites65.0%

                                                                                                                                        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1 \]
                                                                                                                                      2. Taylor expanded in x.im around -inf

                                                                                                                                        \[\leadsto {\left(-1 \cdot x.im\right)}^{y.re} \cdot 1 \]
                                                                                                                                      3. Step-by-step derivation
                                                                                                                                        1. Applied rewrites60.4%

                                                                                                                                          \[\leadsto {\left(-x.im\right)}^{y.re} \cdot 1 \]

                                                                                                                                        if -1.9000000000000001e-296 < x.im < 5.5000000000000002e-27

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

                                                                                                                                            \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\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 1 \]
                                                                                                                                          3. Step-by-step derivation
                                                                                                                                            1. Applied rewrites61.4%

                                                                                                                                              \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1 \]
                                                                                                                                            2. Taylor expanded in x.re around inf

                                                                                                                                              \[\leadsto {x.re}^{y.re} \cdot 1 \]
                                                                                                                                            3. Step-by-step derivation
                                                                                                                                              1. Applied rewrites52.0%

                                                                                                                                                \[\leadsto {x.re}^{y.re} \cdot 1 \]

                                                                                                                                              if 5.5000000000000002e-27 < x.im

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

                                                                                                                                                  \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\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 1 \]
                                                                                                                                                3. Step-by-step derivation
                                                                                                                                                  1. Applied rewrites65.1%

                                                                                                                                                    \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1 \]
                                                                                                                                                  2. Taylor expanded in x.re around 0

                                                                                                                                                    \[\leadsto {x.im}^{y.re} \cdot 1 \]
                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                    1. Applied rewrites65.1%

                                                                                                                                                      \[\leadsto {x.im}^{y.re} \cdot 1 \]
                                                                                                                                                  4. Recombined 3 regimes into one program.
                                                                                                                                                  5. Add Preprocessing

                                                                                                                                                  Alternative 13: 52.4% accurate, 5.7× speedup?

                                                                                                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -2.1 \cdot 10^{-11}:\\ \;\;\;\;{x.im}^{y.re} \cdot 1\\ \mathbf{elif}\;y.re \leq 2 \cdot 10^{-5}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;{x.re}^{y.re} \cdot 1\\ \end{array} \end{array} \]
                                                                                                                                                  (FPCore (x.re x.im y.re y.im)
                                                                                                                                                   :precision binary64
                                                                                                                                                   (if (<= y.re -2.1e-11)
                                                                                                                                                     (* (pow x.im y.re) 1.0)
                                                                                                                                                     (if (<= y.re 2e-5) 1.0 (* (pow x.re y.re) 1.0))))
                                                                                                                                                  double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                                                                                  	double tmp;
                                                                                                                                                  	if (y_46_re <= -2.1e-11) {
                                                                                                                                                  		tmp = pow(x_46_im, y_46_re) * 1.0;
                                                                                                                                                  	} else if (y_46_re <= 2e-5) {
                                                                                                                                                  		tmp = 1.0;
                                                                                                                                                  	} else {
                                                                                                                                                  		tmp = pow(x_46_re, y_46_re) * 1.0;
                                                                                                                                                  	}
                                                                                                                                                  	return tmp;
                                                                                                                                                  }
                                                                                                                                                  
                                                                                                                                                  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) :: tmp
                                                                                                                                                      if (y_46re <= (-2.1d-11)) then
                                                                                                                                                          tmp = (x_46im ** y_46re) * 1.0d0
                                                                                                                                                      else if (y_46re <= 2d-5) then
                                                                                                                                                          tmp = 1.0d0
                                                                                                                                                      else
                                                                                                                                                          tmp = (x_46re ** y_46re) * 1.0d0
                                                                                                                                                      end if
                                                                                                                                                      code = tmp
                                                                                                                                                  end function
                                                                                                                                                  
                                                                                                                                                  public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                                                                                  	double tmp;
                                                                                                                                                  	if (y_46_re <= -2.1e-11) {
                                                                                                                                                  		tmp = Math.pow(x_46_im, y_46_re) * 1.0;
                                                                                                                                                  	} else if (y_46_re <= 2e-5) {
                                                                                                                                                  		tmp = 1.0;
                                                                                                                                                  	} else {
                                                                                                                                                  		tmp = Math.pow(x_46_re, y_46_re) * 1.0;
                                                                                                                                                  	}
                                                                                                                                                  	return tmp;
                                                                                                                                                  }
                                                                                                                                                  
                                                                                                                                                  def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                                                                                                                                  	tmp = 0
                                                                                                                                                  	if y_46_re <= -2.1e-11:
                                                                                                                                                  		tmp = math.pow(x_46_im, y_46_re) * 1.0
                                                                                                                                                  	elif y_46_re <= 2e-5:
                                                                                                                                                  		tmp = 1.0
                                                                                                                                                  	else:
                                                                                                                                                  		tmp = math.pow(x_46_re, y_46_re) * 1.0
                                                                                                                                                  	return tmp
                                                                                                                                                  
                                                                                                                                                  function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                                                                                  	tmp = 0.0
                                                                                                                                                  	if (y_46_re <= -2.1e-11)
                                                                                                                                                  		tmp = Float64((x_46_im ^ y_46_re) * 1.0);
                                                                                                                                                  	elseif (y_46_re <= 2e-5)
                                                                                                                                                  		tmp = 1.0;
                                                                                                                                                  	else
                                                                                                                                                  		tmp = Float64((x_46_re ^ y_46_re) * 1.0);
                                                                                                                                                  	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 <= -2.1e-11)
                                                                                                                                                  		tmp = (x_46_im ^ y_46_re) * 1.0;
                                                                                                                                                  	elseif (y_46_re <= 2e-5)
                                                                                                                                                  		tmp = 1.0;
                                                                                                                                                  	else
                                                                                                                                                  		tmp = (x_46_re ^ y_46_re) * 1.0;
                                                                                                                                                  	end
                                                                                                                                                  	tmp_2 = tmp;
                                                                                                                                                  end
                                                                                                                                                  
                                                                                                                                                  code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -2.1e-11], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[y$46$re, 2e-5], 1.0, N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
                                                                                                                                                  
                                                                                                                                                  \begin{array}{l}
                                                                                                                                                  
                                                                                                                                                  \\
                                                                                                                                                  \begin{array}{l}
                                                                                                                                                  \mathbf{if}\;y.re \leq -2.1 \cdot 10^{-11}:\\
                                                                                                                                                  \;\;\;\;{x.im}^{y.re} \cdot 1\\
                                                                                                                                                  
                                                                                                                                                  \mathbf{elif}\;y.re \leq 2 \cdot 10^{-5}:\\
                                                                                                                                                  \;\;\;\;1\\
                                                                                                                                                  
                                                                                                                                                  \mathbf{else}:\\
                                                                                                                                                  \;\;\;\;{x.re}^{y.re} \cdot 1\\
                                                                                                                                                  
                                                                                                                                                  
                                                                                                                                                  \end{array}
                                                                                                                                                  \end{array}
                                                                                                                                                  
                                                                                                                                                  Derivation
                                                                                                                                                  1. Split input into 3 regimes
                                                                                                                                                  2. if y.re < -2.0999999999999999e-11

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

                                                                                                                                                        \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\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 1 \]
                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                        1. Applied rewrites72.3%

                                                                                                                                                          \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1 \]
                                                                                                                                                        2. Taylor expanded in x.re around 0

                                                                                                                                                          \[\leadsto {x.im}^{y.re} \cdot 1 \]
                                                                                                                                                        3. Step-by-step derivation
                                                                                                                                                          1. Applied rewrites50.5%

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

                                                                                                                                                          if -2.0999999999999999e-11 < y.re < 2.00000000000000016e-5

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

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

                                                                                                                                                              \[\leadsto 1 \]
                                                                                                                                                            3. Step-by-step derivation
                                                                                                                                                              1. Applied rewrites54.6%

                                                                                                                                                                \[\leadsto 1 \]

                                                                                                                                                              if 2.00000000000000016e-5 < y.re

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

                                                                                                                                                                  \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\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 1 \]
                                                                                                                                                                3. Step-by-step derivation
                                                                                                                                                                  1. Applied rewrites77.9%

                                                                                                                                                                    \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot 1 \]
                                                                                                                                                                  2. Taylor expanded in x.re around inf

                                                                                                                                                                    \[\leadsto {x.re}^{y.re} \cdot 1 \]
                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                    1. Applied rewrites68.5%

                                                                                                                                                                      \[\leadsto {x.re}^{y.re} \cdot 1 \]
                                                                                                                                                                  4. Recombined 3 regimes into one program.
                                                                                                                                                                  5. Add Preprocessing

                                                                                                                                                                  Alternative 14: 25.8% accurate, 680.0× speedup?

                                                                                                                                                                  \[\begin{array}{l} \\ 1 \end{array} \]
                                                                                                                                                                  (FPCore (x.re x.im y.re y.im) :precision binary64 1.0)
                                                                                                                                                                  double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                                                                                                  	return 1.0;
                                                                                                                                                                  }
                                                                                                                                                                  
                                                                                                                                                                  module fmin_fmax_functions
                                                                                                                                                                      implicit none
                                                                                                                                                                      private
                                                                                                                                                                      public fmax
                                                                                                                                                                      public fmin
                                                                                                                                                                  
                                                                                                                                                                      interface fmax
                                                                                                                                                                          module procedure fmax88
                                                                                                                                                                          module procedure fmax44
                                                                                                                                                                          module procedure fmax84
                                                                                                                                                                          module procedure fmax48
                                                                                                                                                                      end interface
                                                                                                                                                                      interface fmin
                                                                                                                                                                          module procedure fmin88
                                                                                                                                                                          module procedure fmin44
                                                                                                                                                                          module procedure fmin84
                                                                                                                                                                          module procedure fmin48
                                                                                                                                                                      end interface
                                                                                                                                                                  contains
                                                                                                                                                                      real(8) function fmax88(x, y) result (res)
                                                                                                                                                                          real(8), intent (in) :: x
                                                                                                                                                                          real(8), intent (in) :: y
                                                                                                                                                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                      end function
                                                                                                                                                                      real(4) function fmax44(x, y) result (res)
                                                                                                                                                                          real(4), intent (in) :: x
                                                                                                                                                                          real(4), intent (in) :: y
                                                                                                                                                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                      end function
                                                                                                                                                                      real(8) function fmax84(x, y) result(res)
                                                                                                                                                                          real(8), intent (in) :: x
                                                                                                                                                                          real(4), intent (in) :: y
                                                                                                                                                                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                      end function
                                                                                                                                                                      real(8) function fmax48(x, y) result(res)
                                                                                                                                                                          real(4), intent (in) :: x
                                                                                                                                                                          real(8), intent (in) :: y
                                                                                                                                                                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                                                                                      end function
                                                                                                                                                                      real(8) function fmin88(x, y) result (res)
                                                                                                                                                                          real(8), intent (in) :: x
                                                                                                                                                                          real(8), intent (in) :: y
                                                                                                                                                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                      end function
                                                                                                                                                                      real(4) function fmin44(x, y) result (res)
                                                                                                                                                                          real(4), intent (in) :: x
                                                                                                                                                                          real(4), intent (in) :: y
                                                                                                                                                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                      end function
                                                                                                                                                                      real(8) function fmin84(x, y) result(res)
                                                                                                                                                                          real(8), intent (in) :: x
                                                                                                                                                                          real(4), intent (in) :: y
                                                                                                                                                                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                      end function
                                                                                                                                                                      real(8) function fmin48(x, y) result(res)
                                                                                                                                                                          real(4), intent (in) :: x
                                                                                                                                                                          real(8), intent (in) :: y
                                                                                                                                                                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                                                                                      end function
                                                                                                                                                                  end module
                                                                                                                                                                  
                                                                                                                                                                  real(8) function code(x_46re, x_46im, y_46re, y_46im)
                                                                                                                                                                  use fmin_fmax_functions
                                                                                                                                                                      real(8), intent (in) :: x_46re
                                                                                                                                                                      real(8), intent (in) :: x_46im
                                                                                                                                                                      real(8), intent (in) :: y_46re
                                                                                                                                                                      real(8), intent (in) :: y_46im
                                                                                                                                                                      code = 1.0d0
                                                                                                                                                                  end function
                                                                                                                                                                  
                                                                                                                                                                  public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                                                                                                  	return 1.0;
                                                                                                                                                                  }
                                                                                                                                                                  
                                                                                                                                                                  def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                                                                                                                                                  	return 1.0
                                                                                                                                                                  
                                                                                                                                                                  function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                                                                                                  	return 1.0
                                                                                                                                                                  end
                                                                                                                                                                  
                                                                                                                                                                  function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                                                                                                  	tmp = 1.0;
                                                                                                                                                                  end
                                                                                                                                                                  
                                                                                                                                                                  code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 1.0
                                                                                                                                                                  
                                                                                                                                                                  \begin{array}{l}
                                                                                                                                                                  
                                                                                                                                                                  \\
                                                                                                                                                                  1
                                                                                                                                                                  \end{array}
                                                                                                                                                                  
                                                                                                                                                                  Derivation
                                                                                                                                                                  1. Initial program 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}{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                                                                                                                                                                  4. Step-by-step derivation
                                                                                                                                                                    1. Applied rewrites63.5%

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

                                                                                                                                                                      \[\leadsto 1 \]
                                                                                                                                                                    3. Step-by-step derivation
                                                                                                                                                                      1. Applied rewrites31.9%

                                                                                                                                                                        \[\leadsto 1 \]
                                                                                                                                                                      2. Add Preprocessing

                                                                                                                                                                      Reproduce

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