powComplex, real part

Percentage Accurate: 40.8% → 82.3%
Time: 14.2s
Alternatives: 22
Speedup: 3.0×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\ e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
   (*
    (exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
    (cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
	return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
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 22 alternatives:

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

Initial Program: 40.8% 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: 82.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ t_1 := e^{y.im \cdot \left(y.re \cdot \frac{t\_0}{y.im} - \tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{if}\;x.re \leq 4 \cdot 10^{-201}:\\ \;\;\;\;t\_1 \cdot \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), \left(-y.im\right) \cdot t\_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), \left(-y.im\right) \cdot \log x.re\right)\right)\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (log (hypot x.im x.re)))
        (t_1 (exp (* y.im (- (* y.re (/ t_0 y.im)) (atan2 x.im x.re))))))
   (if (<= x.re 4e-201)
     (* t_1 (sin (fma 0.5 (PI) (* (- y.im) t_0))))
     (* t_1 (sin (fma 0.5 (PI) (* (- y.im) (log x.re))))))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := e^{y.im \cdot \left(y.re \cdot \frac{t\_0}{y.im} - \tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{if}\;x.re \leq 4 \cdot 10^{-201}:\\
\;\;\;\;t\_1 \cdot \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), \left(-y.im\right) \cdot t\_0\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sin \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), \left(-y.im\right) \cdot \log x.re\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x.re < 3.99999999999999978e-201

    1. Initial program 44.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{y.im \cdot \left(y.re \cdot \frac{\log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)}{y.im} - \tan^{-1}_* \frac{x.im}{x.re}\right)} \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) \]
      9. lower-hypot.f64N/A

        \[\leadsto e^{y.im \cdot \left(y.re \cdot \frac{\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}}{y.im} - \tan^{-1}_* \frac{x.im}{x.re}\right)} \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) \]
      10. lower-atan2.f6484.2

        \[\leadsto e^{y.im \cdot \left(y.re \cdot \frac{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{y.im} - \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right)} \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) \]
    7. Applied rewrites84.2%

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

      \[\leadsto e^{y.im \cdot \left(y.re \cdot \frac{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{y.im} - \tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \sin \color{blue}{\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) - y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)} \]
    9. Step-by-step derivation
      1. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999978e-201 < x.re

    1. Initial program 41.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. 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 rewrites63.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{y.im \cdot \left(y.re \cdot \frac{\log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)}{y.im} - \tan^{-1}_* \frac{x.im}{x.re}\right)} \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) \]
      9. lower-hypot.f64N/A

        \[\leadsto e^{y.im \cdot \left(y.re \cdot \frac{\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}}{y.im} - \tan^{-1}_* \frac{x.im}{x.re}\right)} \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) \]
      10. lower-atan2.f6478.4

        \[\leadsto e^{y.im \cdot \left(y.re \cdot \frac{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{y.im} - \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right)} \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) \]
    7. Applied rewrites78.4%

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

      \[\leadsto e^{y.im \cdot \left(y.re \cdot \frac{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{y.im} - \tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \sin \color{blue}{\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) - y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)} \]
    9. Step-by-step derivation
      1. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 2: 75.5% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \mathsf{PI}\left(\right)\\ t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ \mathbf{if}\;y.re \leq -6.5 \cdot 10^{-20}:\\ \;\;\;\;e^{\log \left(\sqrt{x.re \cdot 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\_1 \cdot y.im\right)\\ \mathbf{elif}\;y.re \leq 1.5 \cdot 10^{-14}:\\ \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(-y.im, t\_1, t\_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, t\_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \end{array} \end{array} \]
    (FPCore (x.re x.im y.re y.im)
     :precision binary64
     (let* ((t_0 (* 0.5 (PI))) (t_1 (log (hypot x.im x.re))))
       (if (<= y.re -6.5e-20)
         (*
          (exp
           (-
            (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
            (* (atan2 x.im x.re) y.im)))
          (cos (* t_1 y.im)))
         (if (<= y.re 1.5e-14)
           (* (exp (* (- y.im) (atan2 x.im x.re))) (sin (fma (- y.im) t_1 t_0)))
           (*
            (sin (fma (- y.re) (atan2 x.im x.re) t_0))
            (pow (hypot x.im x.re) y.re))))))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := 0.5 \cdot \mathsf{PI}\left(\right)\\
    t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
    \mathbf{if}\;y.re \leq -6.5 \cdot 10^{-20}:\\
    \;\;\;\;e^{\log \left(\sqrt{x.re \cdot 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\_1 \cdot y.im\right)\\
    
    \mathbf{elif}\;y.re \leq 1.5 \cdot 10^{-14}:\\
    \;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(-y.im, t\_1, t\_0\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, t\_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y.re < -6.50000000000000032e-20

      1. Initial program 53.3%

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

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

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

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

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

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

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

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

      if -6.50000000000000032e-20 < y.re < 1.4999999999999999e-14

      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 rewrites55.8%

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

          \[\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)} \]
        2. distribute-lft-neg-inN/A

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

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

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

          \[\leadsto e^{\color{blue}{\left(-y.im\right)} \cdot \tan^{-1}_* \frac{x.im}{x.re}} \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. lower-atan2.f64N/A

          \[\leadsto e^{\left(-y.im\right) \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}} \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) \]
        7. lower-sin.f64N/A

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

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

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

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

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

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

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

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

      if 1.4999999999999999e-14 < y.re

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 3: 75.6% accurate, 1.2× speedup?

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

      1. Initial program 55.0%

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

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

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

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

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

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

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

      if -0.80000000000000004 < y.re < 1.4999999999999999e-14

      1. Initial program 44.7%

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

        \[\leadsto \color{blue}{\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

          \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
      5. Applied rewrites40.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)} \]
      6. 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)}} \]
      7. Step-by-step derivation
        1. lower-*.f64N/A

          \[\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)}} \]
        2. lower-cos.f64N/A

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

          \[\leadsto \cos \color{blue}{\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. lower-log.f64N/A

          \[\leadsto \cos \left(y.im \cdot \color{blue}{\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)} \]
        5. unpow2N/A

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

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

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

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

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

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

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

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

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

      if 1.4999999999999999e-14 < y.re

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 4: 74.6% accurate, 1.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -0.0019 \lor \neg \left(y.re \leq 1.5 \cdot 10^{-14}\right):\\ \;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, 0.5 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \end{array} \end{array} \]
    (FPCore (x.re x.im y.re y.im)
     :precision binary64
     (if (or (<= y.re -0.0019) (not (<= y.re 1.5e-14)))
       (*
        (sin (fma (- y.re) (atan2 x.im x.re) (* 0.5 (PI))))
        (pow (hypot x.im x.re) y.re))
       (*
        (cos (* y.im (log (hypot x.im x.re))))
        (exp (* (- y.im) (atan2 x.im x.re))))))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y.re \leq -0.0019 \lor \neg \left(y.re \leq 1.5 \cdot 10^{-14}\right):\\
    \;\;\;\;\sin \left(\mathsf{fma}\left(-y.re, \tan^{-1}_* \frac{x.im}{x.re}, 0.5 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
    
    \mathbf{else}:\\
    \;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y.re < -0.0019 or 1.4999999999999999e-14 < y.re

      1. Initial program 41.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. 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 rewrites76.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -0.0019 < y.re < 1.4999999999999999e-14

      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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

          \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
      5. Applied rewrites40.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)} \]
      6. 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)}} \]
      7. Step-by-step derivation
        1. lower-*.f64N/A

          \[\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)}} \]
        2. lower-cos.f64N/A

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

          \[\leadsto \cos \color{blue}{\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. lower-log.f64N/A

          \[\leadsto \cos \left(y.im \cdot \color{blue}{\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)} \]
        5. unpow2N/A

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 65.0% accurate, 1.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{if}\;y.im \leq -4.5 \cdot 10^{+88}:\\ \;\;\;\;\cos \left(y.im \cdot \log \left(-x.im\right)\right) \cdot t\_0\\ \mathbf{elif}\;y.im \leq -17000000:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, \sqrt{x.re \cdot x.re}\right)\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;y.im \leq 9.5 \cdot 10^{+20}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\ \mathbf{elif}\;y.im \leq 4.6 \cdot 10^{+107}:\\ \;\;\;\;\cos \left(y.im \cdot \log \left(-x.re\right)\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\cos \left(y.im \cdot \log x.im\right) \cdot t\_0\\ \end{array} \end{array} \]
    (FPCore (x.re x.im y.re y.im)
     :precision binary64
     (let* ((t_0 (exp (* (- y.im) (atan2 x.im x.re)))))
       (if (<= y.im -4.5e+88)
         (* (cos (* y.im (log (- x.im)))) t_0)
         (if (<= y.im -17000000.0)
           (*
            (pow (hypot x.im (sqrt (* x.re x.re))) y.re)
            (cos (* (atan2 x.im x.re) y.re)))
           (if (<= y.im 9.5e+20)
             (* (pow (hypot x.im x.re) y.re) (sin (* 0.5 (PI))))
             (if (<= y.im 4.6e+107)
               (* (cos (* y.im (log (- x.re)))) t_0)
               (* (cos (* y.im (log x.im))) t_0)))))))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
    \mathbf{if}\;y.im \leq -4.5 \cdot 10^{+88}:\\
    \;\;\;\;\cos \left(y.im \cdot \log \left(-x.im\right)\right) \cdot t\_0\\
    
    \mathbf{elif}\;y.im \leq -17000000:\\
    \;\;\;\;{\left(\mathsf{hypot}\left(x.im, \sqrt{x.re \cdot x.re}\right)\right)}^{y.re} \cdot \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
    
    \mathbf{elif}\;y.im \leq 9.5 \cdot 10^{+20}:\\
    \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\
    
    \mathbf{elif}\;y.im \leq 4.6 \cdot 10^{+107}:\\
    \;\;\;\;\cos \left(y.im \cdot \log \left(-x.re\right)\right) \cdot t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;\cos \left(y.im \cdot \log x.im\right) \cdot t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 5 regimes
    2. if y.im < -4.5e88

      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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

          \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
      5. Applied rewrites29.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)} \]
      6. 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)}} \]
      7. Step-by-step derivation
        1. lower-*.f64N/A

          \[\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)}} \]
        2. lower-cos.f64N/A

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

          \[\leadsto \cos \color{blue}{\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. lower-log.f64N/A

          \[\leadsto \cos \left(y.im \cdot \color{blue}{\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)} \]
        5. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

        if -4.5e88 < y.im < -1.7e7

        1. Initial program 52.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

          if -1.7e7 < y.im < 9.5e20

          1. Initial program 47.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 9.5e20 < y.im < 4.6000000000000001e107

              1. Initial program 30.8%

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

                \[\leadsto \color{blue}{\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

                  \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
              5. Applied rewrites17.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)} \]
              6. 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)}} \]
              7. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\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)}} \]
                2. lower-cos.f64N/A

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

                  \[\leadsto \cos \color{blue}{\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. lower-log.f64N/A

                  \[\leadsto \cos \left(y.im \cdot \color{blue}{\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)} \]
                5. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

                if 4.6000000000000001e107 < y.im

                1. Initial program 34.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 x.im around inf

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

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

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

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

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

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

                Alternative 6: 64.7% accurate, 1.5× speedup?

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

                  1. Initial program 44.7%

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

                    \[\leadsto \color{blue}{\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

                      \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                  5. Applied rewrites34.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)} \]
                  6. 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)}} \]
                  7. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\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)}} \]
                    2. lower-cos.f64N/A

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

                      \[\leadsto \cos \color{blue}{\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. lower-log.f64N/A

                      \[\leadsto \cos \left(y.im \cdot \color{blue}{\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)} \]
                    5. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

                    if -2e22 < y.im < 9.5e20

                    1. Initial program 47.8%

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

                      \[\leadsto \color{blue}{\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

                        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                    5. Applied rewrites80.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)} \]
                    6. Step-by-step derivation
                      1. Applied rewrites83.0%

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

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

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

                        if 9.5e20 < y.im < 4.6000000000000001e107

                        1. Initial program 30.8%

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

                          \[\leadsto \color{blue}{\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

                            \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                        5. Applied rewrites17.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)} \]
                        6. 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)}} \]
                        7. Step-by-step derivation
                          1. lower-*.f64N/A

                            \[\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)}} \]
                          2. lower-cos.f64N/A

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

                            \[\leadsto \cos \color{blue}{\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. lower-log.f64N/A

                            \[\leadsto \cos \left(y.im \cdot \color{blue}{\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)} \]
                          5. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

                          if 4.6000000000000001e107 < y.im

                          1. Initial program 34.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 x.im around inf

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

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

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

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

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

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

                          Alternative 7: 65.5% accurate, 1.6× speedup?

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

                            1. Initial program 44.7%

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

                              \[\leadsto \color{blue}{\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

                                \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                            5. Applied rewrites34.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)} \]
                            6. 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)}} \]
                            7. Step-by-step derivation
                              1. lower-*.f64N/A

                                \[\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)}} \]
                              2. lower-cos.f64N/A

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

                                \[\leadsto \cos \color{blue}{\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. lower-log.f64N/A

                                \[\leadsto \cos \left(y.im \cdot \color{blue}{\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)} \]
                              5. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

                              if -2e22 < y.im < 4e113

                              1. Initial program 46.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  if 4e113 < y.im

                                  1. Initial program 32.1%

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

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

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

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

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

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

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

                                  Alternative 8: 64.4% accurate, 1.6× speedup?

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

                                    1. Initial program 37.8%

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

                                      \[\leadsto \color{blue}{\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                                        \[\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) \]
                                      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 \sin \left(\mathsf{fma}\left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
                                      3. Step-by-step derivation
                                        1. Applied rewrites38.5%

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

                                        if -3.49999999999999997e112 < y.im < 4e113

                                        1. Initial program 48.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            if 4e113 < y.im

                                            1. Initial program 32.1%

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

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

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

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

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

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

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

                                            Alternative 9: 63.2% accurate, 1.9× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.im \leq -3.5 \cdot 10^{+112} \lor \neg \left(y.im \leq 3 \cdot 10^{+147}\right):\\ \;\;\;\;{\left(x.re + 0.5 \cdot \frac{x.im \cdot x.im}{x.re}\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{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\ \end{array} \end{array} \]
                                            (FPCore (x.re x.im y.re y.im)
                                             :precision binary64
                                             (if (or (<= y.im -3.5e+112) (not (<= y.im 3e+147)))
                                               (*
                                                (pow (+ x.re (* 0.5 (/ (* x.im x.im) x.re))) y.re)
                                                (sin (fma (atan2 x.im x.re) y.re (/ (PI) 2.0))))
                                               (* (pow (hypot x.im x.re) y.re) (sin (* 0.5 (PI))))))
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;y.im \leq -3.5 \cdot 10^{+112} \lor \neg \left(y.im \leq 3 \cdot 10^{+147}\right):\\
                                            \;\;\;\;{\left(x.re + 0.5 \cdot \frac{x.im \cdot x.im}{x.re}\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{else}:\\
                                            \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if y.im < -3.49999999999999997e112 or 2.99999999999999993e147 < y.im

                                              1. Initial program 34.5%

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

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

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

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

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

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

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

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

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

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

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

                                                  \[\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) \]
                                                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 \sin \left(\mathsf{fma}\left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}, y.re, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
                                                3. Step-by-step derivation
                                                  1. Applied rewrites37.5%

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

                                                  if -3.49999999999999997e112 < y.im < 2.99999999999999993e147

                                                  1. Initial program 47.8%

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

                                                    \[\leadsto \color{blue}{\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -3.5 \cdot 10^{+112} \lor \neg \left(y.im \leq 3 \cdot 10^{+147}\right):\\ \;\;\;\;{\left(x.re + 0.5 \cdot \frac{x.im \cdot x.im}{x.re}\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{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\ \end{array} \]
                                                    6. Add Preprocessing

                                                    Alternative 10: 63.0% accurate, 1.9× speedup?

                                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\ \mathbf{if}\;y.im \leq -5 \cdot 10^{+111}:\\ \;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot t\_0\\ \mathbf{elif}\;y.im \leq 1.46 \cdot 10^{+149}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;{\left(x.im + 0.5 \cdot \frac{x.re \cdot x.re}{x.im}\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)\\ \end{array} \end{array} \]
                                                    (FPCore (x.re x.im y.re y.im)
                                                     :precision binary64
                                                     (let* ((t_0 (sin (* 0.5 (PI)))))
                                                       (if (<= y.im -5e+111)
                                                         (* (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re) t_0)
                                                         (if (<= y.im 1.46e+149)
                                                           (* (pow (hypot x.im x.re) y.re) t_0)
                                                           (*
                                                            (pow (+ x.im (* 0.5 (/ (* x.re x.re) x.im))) y.re)
                                                            (sin (fma (atan2 x.im x.re) y.re (/ (PI) 2.0))))))))
                                                    \begin{array}{l}
                                                    
                                                    \\
                                                    \begin{array}{l}
                                                    t_0 := \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\
                                                    \mathbf{if}\;y.im \leq -5 \cdot 10^{+111}:\\
                                                    \;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot t\_0\\
                                                    
                                                    \mathbf{elif}\;y.im \leq 1.46 \cdot 10^{+149}:\\
                                                    \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;{\left(x.im + 0.5 \cdot \frac{x.re \cdot x.re}{x.im}\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)\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 3 regimes
                                                    2. if y.im < -4.9999999999999997e111

                                                      1. Initial program 37.8%

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

                                                        \[\leadsto \color{blue}{\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                            if -4.9999999999999997e111 < y.im < 1.46e149

                                                            1. Initial program 47.8%

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

                                                              \[\leadsto \color{blue}{\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                if 1.46e149 < y.im

                                                                1. Initial program 30.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                  Alternative 11: 63.5% accurate, 2.1× speedup?

                                                                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\ \mathbf{if}\;y.im \leq -5 \cdot 10^{+111} \lor \neg \left(y.im \leq 2.6 \cdot 10^{+30}\right):\\ \;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\ \end{array} \end{array} \]
                                                                  (FPCore (x.re x.im y.re y.im)
                                                                   :precision binary64
                                                                   (let* ((t_0 (sin (* 0.5 (PI)))))
                                                                     (if (or (<= y.im -5e+111) (not (<= y.im 2.6e+30)))
                                                                       (* (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re) t_0)
                                                                       (* (pow (hypot x.im x.re) y.re) t_0))))
                                                                  \begin{array}{l}
                                                                  
                                                                  \\
                                                                  \begin{array}{l}
                                                                  t_0 := \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\
                                                                  \mathbf{if}\;y.im \leq -5 \cdot 10^{+111} \lor \neg \left(y.im \leq 2.6 \cdot 10^{+30}\right):\\
                                                                  \;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot t\_0\\
                                                                  
                                                                  \mathbf{else}:\\
                                                                  \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_0\\
                                                                  
                                                                  
                                                                  \end{array}
                                                                  \end{array}
                                                                  
                                                                  Derivation
                                                                  1. Split input into 2 regimes
                                                                  2. if y.im < -4.9999999999999997e111 or 2.59999999999999988e30 < y.im

                                                                    1. Initial program 35.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                          if -4.9999999999999997e111 < y.im < 2.59999999999999988e30

                                                                          1. Initial program 49.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -5 \cdot 10^{+111} \lor \neg \left(y.im \leq 2.6 \cdot 10^{+30}\right):\\ \;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\ \end{array} \]
                                                                            6. Add Preprocessing

                                                                            Alternative 12: 59.6% accurate, 2.8× speedup?

                                                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -3 \cdot 10^{-5} \lor \neg \left(y.re \leq 0.00013\right):\\ \;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), 1\right)\\ \end{array} \end{array} \]
                                                                            (FPCore (x.re x.im y.re y.im)
                                                                             :precision binary64
                                                                             (if (or (<= y.re -3e-5) (not (<= y.re 0.00013)))
                                                                               (* (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re) (sin (* 0.5 (PI))))
                                                                               (fma y.re (log (hypot x.im x.re)) 1.0)))
                                                                            \begin{array}{l}
                                                                            
                                                                            \\
                                                                            \begin{array}{l}
                                                                            \mathbf{if}\;y.re \leq -3 \cdot 10^{-5} \lor \neg \left(y.re \leq 0.00013\right):\\
                                                                            \;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\
                                                                            
                                                                            \mathbf{else}:\\
                                                                            \;\;\;\;\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), 1\right)\\
                                                                            
                                                                            
                                                                            \end{array}
                                                                            \end{array}
                                                                            
                                                                            Derivation
                                                                            1. Split input into 2 regimes
                                                                            2. if y.re < -3.00000000000000008e-5 or 1.29999999999999989e-4 < y.re

                                                                              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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                    if -3.00000000000000008e-5 < y.re < 1.29999999999999989e-4

                                                                                    1. Initial program 45.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -3 \cdot 10^{-5} \lor \neg \left(y.re \leq 0.00013\right):\\ \;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), 1\right)\\ \end{array} \]
                                                                                    10. Add Preprocessing

                                                                                    Alternative 13: 53.1% accurate, 3.0× speedup?

                                                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -0.00065 \lor \neg \left(y.re \leq 8.5\right):\\ \;\;\;\;{x.re}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), 1\right)\\ \end{array} \end{array} \]
                                                                                    (FPCore (x.re x.im y.re y.im)
                                                                                     :precision binary64
                                                                                     (if (or (<= y.re -0.00065) (not (<= y.re 8.5)))
                                                                                       (* (pow x.re y.re) (sin (* 0.5 (PI))))
                                                                                       (fma y.re (log (hypot x.im x.re)) 1.0)))
                                                                                    \begin{array}{l}
                                                                                    
                                                                                    \\
                                                                                    \begin{array}{l}
                                                                                    \mathbf{if}\;y.re \leq -0.00065 \lor \neg \left(y.re \leq 8.5\right):\\
                                                                                    \;\;\;\;{x.re}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\
                                                                                    
                                                                                    \mathbf{else}:\\
                                                                                    \;\;\;\;\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), 1\right)\\
                                                                                    
                                                                                    
                                                                                    \end{array}
                                                                                    \end{array}
                                                                                    
                                                                                    Derivation
                                                                                    1. Split input into 2 regimes
                                                                                    2. if y.re < -6.4999999999999997e-4 or 8.5 < y.re

                                                                                      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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                            if -6.4999999999999997e-4 < y.re < 8.5

                                                                                            1. Initial program 45.2%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                \[\leadsto \mathsf{fma}\left(y.re, \color{blue}{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}, 1\right) \]
                                                                                            8. Recombined 2 regimes into one program.
                                                                                            9. Final simplification49.6%

                                                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -0.00065 \lor \neg \left(y.re \leq 8.5\right):\\ \;\;\;\;{x.re}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), 1\right)\\ \end{array} \]
                                                                                            10. Add Preprocessing

                                                                                            Alternative 14: 50.4% accurate, 3.0× speedup?

                                                                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -1.1 \cdot 10^{+28} \lor \neg \left(y.re \leq 1.3 \cdot 10^{-16}\right):\\ \;\;\;\;{x.im}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), 1\right)\\ \end{array} \end{array} \]
                                                                                            (FPCore (x.re x.im y.re y.im)
                                                                                             :precision binary64
                                                                                             (if (or (<= y.re -1.1e+28) (not (<= y.re 1.3e-16)))
                                                                                               (* (pow x.im y.re) (sin (* 0.5 (PI))))
                                                                                               (fma y.re (log (hypot x.im x.re)) 1.0)))
                                                                                            \begin{array}{l}
                                                                                            
                                                                                            \\
                                                                                            \begin{array}{l}
                                                                                            \mathbf{if}\;y.re \leq -1.1 \cdot 10^{+28} \lor \neg \left(y.re \leq 1.3 \cdot 10^{-16}\right):\\
                                                                                            \;\;\;\;{x.im}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\
                                                                                            
                                                                                            \mathbf{else}:\\
                                                                                            \;\;\;\;\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), 1\right)\\
                                                                                            
                                                                                            
                                                                                            \end{array}
                                                                                            \end{array}
                                                                                            
                                                                                            Derivation
                                                                                            1. Split input into 2 regimes
                                                                                            2. if y.re < -1.09999999999999993e28 or 1.2999999999999999e-16 < y.re

                                                                                              1. Initial program 41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                    if -1.09999999999999993e28 < y.re < 1.2999999999999999e-16

                                                                                                    1. Initial program 45.4%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                        \[\leadsto \mathsf{fma}\left(y.re, \color{blue}{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}, 1\right) \]
                                                                                                    8. Recombined 2 regimes into one program.
                                                                                                    9. Final simplification43.0%

                                                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -1.1 \cdot 10^{+28} \lor \neg \left(y.re \leq 1.3 \cdot 10^{-16}\right):\\ \;\;\;\;{x.im}^{y.re} \cdot \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), 1\right)\\ \end{array} \]
                                                                                                    10. Add Preprocessing

                                                                                                    Alternative 15: 53.7% accurate, 3.0× speedup?

                                                                                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\ \mathbf{if}\;x.im \leq -2.3 \cdot 10^{+14}:\\ \;\;\;\;{\left(-x.im\right)}^{y.re} \cdot t\_0\\ \mathbf{elif}\;x.im \leq 2.8 \cdot 10^{-247}:\\ \;\;\;\;{x.re}^{y.re} \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;{x.im}^{y.re} \cdot t\_0\\ \end{array} \end{array} \]
                                                                                                    (FPCore (x.re x.im y.re y.im)
                                                                                                     :precision binary64
                                                                                                     (let* ((t_0 (sin (* 0.5 (PI)))))
                                                                                                       (if (<= x.im -2.3e+14)
                                                                                                         (* (pow (- x.im) y.re) t_0)
                                                                                                         (if (<= x.im 2.8e-247) (* (pow x.re y.re) t_0) (* (pow x.im y.re) t_0)))))
                                                                                                    \begin{array}{l}
                                                                                                    
                                                                                                    \\
                                                                                                    \begin{array}{l}
                                                                                                    t_0 := \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\\
                                                                                                    \mathbf{if}\;x.im \leq -2.3 \cdot 10^{+14}:\\
                                                                                                    \;\;\;\;{\left(-x.im\right)}^{y.re} \cdot t\_0\\
                                                                                                    
                                                                                                    \mathbf{elif}\;x.im \leq 2.8 \cdot 10^{-247}:\\
                                                                                                    \;\;\;\;{x.re}^{y.re} \cdot t\_0\\
                                                                                                    
                                                                                                    \mathbf{else}:\\
                                                                                                    \;\;\;\;{x.im}^{y.re} \cdot t\_0\\
                                                                                                    
                                                                                                    
                                                                                                    \end{array}
                                                                                                    \end{array}
                                                                                                    
                                                                                                    Derivation
                                                                                                    1. Split input into 3 regimes
                                                                                                    2. if x.im < -2.3e14

                                                                                                      1. Initial program 40.7%

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

                                                                                                        \[\leadsto \color{blue}{\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                            if -2.3e14 < x.im < 2.79999999999999986e-247

                                                                                                            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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                  if 2.79999999999999986e-247 < x.im

                                                                                                                  1. Initial program 43.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                          \[\leadsto {x.im}^{y.re} \cdot \sin \color{blue}{\left(0.5 \cdot \mathsf{PI}\left(\right)\right)} \]
                                                                                                                      4. Recombined 3 regimes into one program.
                                                                                                                      5. Add Preprocessing

                                                                                                                      Alternative 16: 27.9% accurate, 3.2× speedup?

                                                                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq 23.5:\\ \;\;\;\;\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y.re, \mathsf{fma}\left(-1, \log \left(\frac{-1}{x.im}\right), \left(0.5 \cdot x.re\right) \cdot \frac{x.re}{x.im \cdot x.im}\right), 1\right)\\ \end{array} \end{array} \]
                                                                                                                      (FPCore (x.re x.im y.re y.im)
                                                                                                                       :precision binary64
                                                                                                                       (if (<= y.re 23.5)
                                                                                                                         (fma y.re (log (hypot x.im x.re)) 1.0)
                                                                                                                         (fma
                                                                                                                          y.re
                                                                                                                          (fma -1.0 (log (/ -1.0 x.im)) (* (* 0.5 x.re) (/ x.re (* x.im x.im))))
                                                                                                                          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 <= 23.5) {
                                                                                                                      		tmp = fma(y_46_re, log(hypot(x_46_im, x_46_re)), 1.0);
                                                                                                                      	} else {
                                                                                                                      		tmp = fma(y_46_re, fma(-1.0, log((-1.0 / x_46_im)), ((0.5 * x_46_re) * (x_46_re / (x_46_im * x_46_im)))), 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 <= 23.5)
                                                                                                                      		tmp = fma(y_46_re, log(hypot(x_46_im, x_46_re)), 1.0);
                                                                                                                      	else
                                                                                                                      		tmp = fma(y_46_re, fma(-1.0, log(Float64(-1.0 / x_46_im)), Float64(Float64(0.5 * x_46_re) * Float64(x_46_re / Float64(x_46_im * x_46_im)))), 1.0);
                                                                                                                      	end
                                                                                                                      	return tmp
                                                                                                                      end
                                                                                                                      
                                                                                                                      code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 23.5], N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision], N[(y$46$re * N[(-1.0 * N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision] + N[(N[(0.5 * x$46$re), $MachinePrecision] * N[(x$46$re / N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]
                                                                                                                      
                                                                                                                      \begin{array}{l}
                                                                                                                      
                                                                                                                      \\
                                                                                                                      \begin{array}{l}
                                                                                                                      \mathbf{if}\;y.re \leq 23.5:\\
                                                                                                                      \;\;\;\;\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), 1\right)\\
                                                                                                                      
                                                                                                                      \mathbf{else}:\\
                                                                                                                      \;\;\;\;\mathsf{fma}\left(y.re, \mathsf{fma}\left(-1, \log \left(\frac{-1}{x.im}\right), \left(0.5 \cdot x.re\right) \cdot \frac{x.re}{x.im \cdot x.im}\right), 1\right)\\
                                                                                                                      
                                                                                                                      
                                                                                                                      \end{array}
                                                                                                                      \end{array}
                                                                                                                      
                                                                                                                      Derivation
                                                                                                                      1. Split input into 2 regimes
                                                                                                                      2. if y.re < 23.5

                                                                                                                        1. Initial program 48.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                          if 23.5 < y.re

                                                                                                                          1. Initial program 29.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                              \[\leadsto \mathsf{fma}\left(y.re, -1 \cdot \log \left(\frac{-1}{x.im}\right) + \frac{1}{2} \cdot \color{blue}{\frac{{x.re}^{2}}{{x.im}^{2}}}, 1\right) \]
                                                                                                                            3. Step-by-step derivation
                                                                                                                              1. Applied rewrites18.7%

                                                                                                                                \[\leadsto \mathsf{fma}\left(y.re, \mathsf{fma}\left(-1, \log \left(\frac{-1}{x.im}\right), \frac{0.5 \cdot \left(x.re \cdot x.re\right)}{x.im \cdot x.im}\right), 1\right) \]
                                                                                                                              2. Step-by-step derivation
                                                                                                                                1. Applied rewrites18.8%

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

                                                                                                                              Alternative 17: 27.7% accurate, 4.4× speedup?

                                                                                                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq 92000000000000:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y.re, \mathsf{fma}\left(-1, \log \left(\frac{-1}{x.im}\right), \left(0.5 \cdot x.re\right) \cdot \frac{x.re}{x.im \cdot x.im}\right), 1\right)\\ \end{array} \end{array} \]
                                                                                                                              (FPCore (x.re x.im y.re y.im)
                                                                                                                               :precision binary64
                                                                                                                               (if (<= y.re 92000000000000.0)
                                                                                                                                 1.0
                                                                                                                                 (fma
                                                                                                                                  y.re
                                                                                                                                  (fma -1.0 (log (/ -1.0 x.im)) (* (* 0.5 x.re) (/ x.re (* x.im x.im))))
                                                                                                                                  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 <= 92000000000000.0) {
                                                                                                                              		tmp = 1.0;
                                                                                                                              	} else {
                                                                                                                              		tmp = fma(y_46_re, fma(-1.0, log((-1.0 / x_46_im)), ((0.5 * x_46_re) * (x_46_re / (x_46_im * x_46_im)))), 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 <= 92000000000000.0)
                                                                                                                              		tmp = 1.0;
                                                                                                                              	else
                                                                                                                              		tmp = fma(y_46_re, fma(-1.0, log(Float64(-1.0 / x_46_im)), Float64(Float64(0.5 * x_46_re) * Float64(x_46_re / Float64(x_46_im * x_46_im)))), 1.0);
                                                                                                                              	end
                                                                                                                              	return tmp
                                                                                                                              end
                                                                                                                              
                                                                                                                              code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 92000000000000.0], 1.0, N[(y$46$re * N[(-1.0 * N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision] + N[(N[(0.5 * x$46$re), $MachinePrecision] * N[(x$46$re / N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]
                                                                                                                              
                                                                                                                              \begin{array}{l}
                                                                                                                              
                                                                                                                              \\
                                                                                                                              \begin{array}{l}
                                                                                                                              \mathbf{if}\;y.re \leq 92000000000000:\\
                                                                                                                              \;\;\;\;1\\
                                                                                                                              
                                                                                                                              \mathbf{else}:\\
                                                                                                                              \;\;\;\;\mathsf{fma}\left(y.re, \mathsf{fma}\left(-1, \log \left(\frac{-1}{x.im}\right), \left(0.5 \cdot x.re\right) \cdot \frac{x.re}{x.im \cdot x.im}\right), 1\right)\\
                                                                                                                              
                                                                                                                              
                                                                                                                              \end{array}
                                                                                                                              \end{array}
                                                                                                                              
                                                                                                                              Derivation
                                                                                                                              1. Split input into 2 regimes
                                                                                                                              2. if y.re < 9.2e13

                                                                                                                                1. Initial program 48.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                                    \[\leadsto 1 \]
                                                                                                                                  3. Step-by-step derivation
                                                                                                                                    1. Applied rewrites28.0%

                                                                                                                                      \[\leadsto 1 \]

                                                                                                                                    if 9.2e13 < y.re

                                                                                                                                    1. Initial program 28.8%

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

                                                                                                                                      \[\leadsto \color{blue}{\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                                          \[\leadsto \mathsf{fma}\left(y.re, \mathsf{fma}\left(-1, \log \left(\frac{-1}{x.im}\right), \frac{0.5 \cdot \left(x.re \cdot x.re\right)}{x.im \cdot x.im}\right), 1\right) \]
                                                                                                                                        2. Step-by-step derivation
                                                                                                                                          1. Applied rewrites19.0%

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

                                                                                                                                        Alternative 18: 27.6% accurate, 4.6× speedup?

                                                                                                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq 42000000000:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y.re, \mathsf{fma}\left(-1, -\log \left(-x.im\right), \frac{0.5 \cdot \left(x.re \cdot x.re\right)}{x.im \cdot x.im}\right), 1\right)\\ \end{array} \end{array} \]
                                                                                                                                        (FPCore (x.re x.im y.re y.im)
                                                                                                                                         :precision binary64
                                                                                                                                         (if (<= y.re 42000000000.0)
                                                                                                                                           1.0
                                                                                                                                           (fma
                                                                                                                                            y.re
                                                                                                                                            (fma -1.0 (- (log (- x.im))) (/ (* 0.5 (* x.re x.re)) (* x.im x.im)))
                                                                                                                                            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 <= 42000000000.0) {
                                                                                                                                        		tmp = 1.0;
                                                                                                                                        	} else {
                                                                                                                                        		tmp = fma(y_46_re, fma(-1.0, -log(-x_46_im), ((0.5 * (x_46_re * x_46_re)) / (x_46_im * x_46_im))), 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 <= 42000000000.0)
                                                                                                                                        		tmp = 1.0;
                                                                                                                                        	else
                                                                                                                                        		tmp = fma(y_46_re, fma(-1.0, Float64(-log(Float64(-x_46_im))), Float64(Float64(0.5 * Float64(x_46_re * x_46_re)) / Float64(x_46_im * x_46_im))), 1.0);
                                                                                                                                        	end
                                                                                                                                        	return tmp
                                                                                                                                        end
                                                                                                                                        
                                                                                                                                        code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 42000000000.0], 1.0, N[(y$46$re * N[(-1.0 * (-N[Log[(-x$46$im)], $MachinePrecision]) + N[(N[(0.5 * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]
                                                                                                                                        
                                                                                                                                        \begin{array}{l}
                                                                                                                                        
                                                                                                                                        \\
                                                                                                                                        \begin{array}{l}
                                                                                                                                        \mathbf{if}\;y.re \leq 42000000000:\\
                                                                                                                                        \;\;\;\;1\\
                                                                                                                                        
                                                                                                                                        \mathbf{else}:\\
                                                                                                                                        \;\;\;\;\mathsf{fma}\left(y.re, \mathsf{fma}\left(-1, -\log \left(-x.im\right), \frac{0.5 \cdot \left(x.re \cdot x.re\right)}{x.im \cdot x.im}\right), 1\right)\\
                                                                                                                                        
                                                                                                                                        
                                                                                                                                        \end{array}
                                                                                                                                        \end{array}
                                                                                                                                        
                                                                                                                                        Derivation
                                                                                                                                        1. Split input into 2 regimes
                                                                                                                                        2. if y.re < 4.2e10

                                                                                                                                          1. Initial program 48.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                                              \[\leadsto 1 \]
                                                                                                                                            3. Step-by-step derivation
                                                                                                                                              1. Applied rewrites28.0%

                                                                                                                                                \[\leadsto 1 \]

                                                                                                                                              if 4.2e10 < y.re

                                                                                                                                              1. Initial program 28.8%

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

                                                                                                                                                \[\leadsto \color{blue}{\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                                                    \[\leadsto \mathsf{fma}\left(y.re, \mathsf{fma}\left(-1, \log \left(\frac{-1}{x.im}\right), \frac{0.5 \cdot \left(x.re \cdot x.re\right)}{x.im \cdot x.im}\right), 1\right) \]
                                                                                                                                                  2. Step-by-step derivation
                                                                                                                                                    1. Applied rewrites19.0%

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

                                                                                                                                                  Alternative 19: 27.3% accurate, 4.8× speedup?

                                                                                                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq 5.5 \cdot 10^{+42}:\\ \;\;\;\;\mathsf{fma}\left(-y.im, \tan^{-1}_* \frac{x.im}{x.re}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y.re, \log x.re + \frac{0.5 \cdot \left(x.im \cdot x.im\right)}{x.re \cdot x.re}, 1\right)\\ \end{array} \end{array} \]
                                                                                                                                                  (FPCore (x.re x.im y.re y.im)
                                                                                                                                                   :precision binary64
                                                                                                                                                   (if (<= y.re 5.5e+42)
                                                                                                                                                     (fma (- y.im) (atan2 x.im x.re) 1.0)
                                                                                                                                                     (fma y.re (+ (log x.re) (/ (* 0.5 (* x.im x.im)) (* x.re 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 <= 5.5e+42) {
                                                                                                                                                  		tmp = fma(-y_46_im, atan2(x_46_im, x_46_re), 1.0);
                                                                                                                                                  	} else {
                                                                                                                                                  		tmp = fma(y_46_re, (log(x_46_re) + ((0.5 * (x_46_im * x_46_im)) / (x_46_re * 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 <= 5.5e+42)
                                                                                                                                                  		tmp = fma(Float64(-y_46_im), atan(x_46_im, x_46_re), 1.0);
                                                                                                                                                  	else
                                                                                                                                                  		tmp = fma(y_46_re, Float64(log(x_46_re) + Float64(Float64(0.5 * Float64(x_46_im * x_46_im)) / Float64(x_46_re * x_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, 5.5e+42], N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + 1.0), $MachinePrecision], N[(y$46$re * N[(N[Log[x$46$re], $MachinePrecision] + N[(N[(0.5 * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] / N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]
                                                                                                                                                  
                                                                                                                                                  \begin{array}{l}
                                                                                                                                                  
                                                                                                                                                  \\
                                                                                                                                                  \begin{array}{l}
                                                                                                                                                  \mathbf{if}\;y.re \leq 5.5 \cdot 10^{+42}:\\
                                                                                                                                                  \;\;\;\;\mathsf{fma}\left(-y.im, \tan^{-1}_* \frac{x.im}{x.re}, 1\right)\\
                                                                                                                                                  
                                                                                                                                                  \mathbf{else}:\\
                                                                                                                                                  \;\;\;\;\mathsf{fma}\left(y.re, \log x.re + \frac{0.5 \cdot \left(x.im \cdot x.im\right)}{x.re \cdot x.re}, 1\right)\\
                                                                                                                                                  
                                                                                                                                                  
                                                                                                                                                  \end{array}
                                                                                                                                                  \end{array}
                                                                                                                                                  
                                                                                                                                                  Derivation
                                                                                                                                                  1. Split input into 2 regimes
                                                                                                                                                  2. if y.re < 5.50000000000000001e42

                                                                                                                                                    1. Initial program 47.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

                                                                                                                                                        \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                                                                                                                    5. Applied rewrites53.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)} \]
                                                                                                                                                    6. 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)}} \]
                                                                                                                                                    7. Step-by-step derivation
                                                                                                                                                      1. lower-*.f64N/A

                                                                                                                                                        \[\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)}} \]
                                                                                                                                                      2. lower-cos.f64N/A

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

                                                                                                                                                        \[\leadsto \cos \color{blue}{\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. lower-log.f64N/A

                                                                                                                                                        \[\leadsto \cos \left(y.im \cdot \color{blue}{\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)} \]
                                                                                                                                                      5. unpow2N/A

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

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

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

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

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

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

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

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

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

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

                                                                                                                                                        \[\leadsto \cos \left(y.im \cdot \log x.im\right) \cdot 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 rewrites27.0%

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

                                                                                                                                                        if 5.50000000000000001e42 < y.re

                                                                                                                                                        1. Initial program 29.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                                                            \[\leadsto \mathsf{fma}\left(y.re, \log x.re + \frac{1}{2} \cdot \color{blue}{\frac{{x.im}^{2}}{{x.re}^{2}}}, 1\right) \]
                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                            1. Applied rewrites11.6%

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

                                                                                                                                                          Alternative 20: 26.8% accurate, 5.0× speedup?

                                                                                                                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq 3.9 \cdot 10^{+87}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y.re, \log \left(x.re + 0.5 \cdot \frac{x.im \cdot x.im}{x.re}\right), 1\right)\\ \end{array} \end{array} \]
                                                                                                                                                          (FPCore (x.re x.im y.re y.im)
                                                                                                                                                           :precision binary64
                                                                                                                                                           (if (<= y.re 3.9e+87)
                                                                                                                                                             1.0
                                                                                                                                                             (fma y.re (log (+ x.re (* 0.5 (/ (* x.im 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 <= 3.9e+87) {
                                                                                                                                                          		tmp = 1.0;
                                                                                                                                                          	} else {
                                                                                                                                                          		tmp = fma(y_46_re, log((x_46_re + (0.5 * ((x_46_im * 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 <= 3.9e+87)
                                                                                                                                                          		tmp = 1.0;
                                                                                                                                                          	else
                                                                                                                                                          		tmp = fma(y_46_re, log(Float64(x_46_re + Float64(0.5 * Float64(Float64(x_46_im * 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[LessEqual[y$46$re, 3.9e+87], 1.0, N[(y$46$re * N[Log[N[(x$46$re + N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]]
                                                                                                                                                          
                                                                                                                                                          \begin{array}{l}
                                                                                                                                                          
                                                                                                                                                          \\
                                                                                                                                                          \begin{array}{l}
                                                                                                                                                          \mathbf{if}\;y.re \leq 3.9 \cdot 10^{+87}:\\
                                                                                                                                                          \;\;\;\;1\\
                                                                                                                                                          
                                                                                                                                                          \mathbf{else}:\\
                                                                                                                                                          \;\;\;\;\mathsf{fma}\left(y.re, \log \left(x.re + 0.5 \cdot \frac{x.im \cdot x.im}{x.re}\right), 1\right)\\
                                                                                                                                                          
                                                                                                                                                          
                                                                                                                                                          \end{array}
                                                                                                                                                          \end{array}
                                                                                                                                                          
                                                                                                                                                          Derivation
                                                                                                                                                          1. Split input into 2 regimes
                                                                                                                                                          2. if y.re < 3.9000000000000002e87

                                                                                                                                                            1. Initial program 46.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                                                                \[\leadsto 1 \]
                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                1. Applied rewrites26.2%

                                                                                                                                                                  \[\leadsto 1 \]

                                                                                                                                                                if 3.9000000000000002e87 < y.re

                                                                                                                                                                1. Initial program 29.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                                                                  Alternative 21: 25.5% accurate, 6.2× speedup?

                                                                                                                                                                  \[\begin{array}{l} \\ \mathsf{fma}\left(-y.im, \tan^{-1}_* \frac{x.im}{x.re}, 1\right) \end{array} \]
                                                                                                                                                                  (FPCore (x.re x.im y.re y.im)
                                                                                                                                                                   :precision binary64
                                                                                                                                                                   (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) {
                                                                                                                                                                  	return fma(-y_46_im, atan2(x_46_im, x_46_re), 1.0);
                                                                                                                                                                  }
                                                                                                                                                                  
                                                                                                                                                                  function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                                                                                                  	return fma(Float64(-y_46_im), atan(x_46_im, x_46_re), 1.0)
                                                                                                                                                                  end
                                                                                                                                                                  
                                                                                                                                                                  code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + 1.0), $MachinePrecision]
                                                                                                                                                                  
                                                                                                                                                                  \begin{array}{l}
                                                                                                                                                                  
                                                                                                                                                                  \\
                                                                                                                                                                  \mathsf{fma}\left(-y.im, \tan^{-1}_* \frac{x.im}{x.re}, 1\right)
                                                                                                                                                                  \end{array}
                                                                                                                                                                  
                                                                                                                                                                  Derivation
                                                                                                                                                                  1. Initial program 43.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

                                                                                                                                                                      \[\leadsto {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(\color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.re\right) \]
                                                                                                                                                                  5. Applied rewrites55.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)} \]
                                                                                                                                                                  6. 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)}} \]
                                                                                                                                                                  7. Step-by-step derivation
                                                                                                                                                                    1. lower-*.f64N/A

                                                                                                                                                                      \[\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)}} \]
                                                                                                                                                                    2. lower-cos.f64N/A

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

                                                                                                                                                                      \[\leadsto \cos \color{blue}{\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. lower-log.f64N/A

                                                                                                                                                                      \[\leadsto \cos \left(y.im \cdot \color{blue}{\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)} \]
                                                                                                                                                                    5. unpow2N/A

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

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

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

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

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

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

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

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

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

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

                                                                                                                                                                      \[\leadsto \cos \left(y.im \cdot \log x.im\right) \cdot 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 rewrites21.5%

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

                                                                                                                                                                      Alternative 22: 25.3% 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 43.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                                                                          \[\leadsto 1 \]
                                                                                                                                                                        3. Step-by-step derivation
                                                                                                                                                                          1. Applied rewrites21.4%

                                                                                                                                                                            \[\leadsto 1 \]
                                                                                                                                                                          2. Add Preprocessing

                                                                                                                                                                          Reproduce

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