powComplex, imaginary part

Percentage Accurate: 40.8% → 80.2%
Time: 10.7s
Alternatives: 22
Speedup: 1.6×

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 \sin \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)))
    (sin (+ (* 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))) * sin(((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))) * sin(((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.sin(((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.sin(((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))) * sin(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))) * sin(((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[Sin[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 \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}

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 \sin \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)))
    (sin (+ (* 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))) * sin(((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))) * sin(((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.sin(((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.sin(((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))) * sin(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))) * sin(((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[Sin[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 \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}

Alternative 1: 80.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_1 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\ t_2 := e^{t\_1 \cdot y.re - t\_0}\\ t_3 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_4 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ t_5 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ \mathbf{if}\;t\_2 \cdot \sin \left(t\_1 \cdot y.im + t\_4\right) \leq -5 \cdot 10^{+193}:\\ \;\;\;\;t\_2 \cdot \left(\sin t\_3 + y.im \cdot \left(\cos t\_3 \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;e^{t\_5 \cdot y.re - t\_0} \cdot \sin \left(t\_5 \cdot y.im + t\_4\right)\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (* (atan2 x.im x.re) y.im))
        (t_1 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
        (t_2 (exp (- (* t_1 y.re) t_0)))
        (t_3 (* y.re (atan2 x.im x.re)))
        (t_4 (* (atan2 x.im x.re) y.re))
        (t_5 (log (hypot x.re x.im))))
   (if (<= (* t_2 (sin (+ (* t_1 y.im) t_4))) -5e+193)
     (*
      t_2
      (+
       (sin t_3)
       (* y.im (* (cos t_3) (log (sqrt (fma x.im x.im (* x.re x.re))))))))
     (* (exp (- (* t_5 y.re) t_0)) (sin (+ (* t_5 y.im) t_4))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
	double t_1 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
	double t_2 = exp(((t_1 * y_46_re) - t_0));
	double t_3 = y_46_re * atan2(x_46_im, x_46_re);
	double t_4 = atan2(x_46_im, x_46_re) * y_46_re;
	double t_5 = log(hypot(x_46_re, x_46_im));
	double tmp;
	if ((t_2 * sin(((t_1 * y_46_im) + t_4))) <= -5e+193) {
		tmp = t_2 * (sin(t_3) + (y_46_im * (cos(t_3) * log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)))))));
	} else {
		tmp = exp(((t_5 * y_46_re) - t_0)) * sin(((t_5 * y_46_im) + t_4));
	}
	return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im)
	t_1 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))
	t_2 = exp(Float64(Float64(t_1 * y_46_re) - t_0))
	t_3 = Float64(y_46_re * atan(x_46_im, x_46_re))
	t_4 = Float64(atan(x_46_im, x_46_re) * y_46_re)
	t_5 = log(hypot(x_46_re, x_46_im))
	tmp = 0.0
	if (Float64(t_2 * sin(Float64(Float64(t_1 * y_46_im) + t_4))) <= -5e+193)
		tmp = Float64(t_2 * Float64(sin(t_3) + Float64(y_46_im * Float64(cos(t_3) * log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))))))));
	else
		tmp = Float64(exp(Float64(Float64(t_5 * y_46_re) - t_0)) * sin(Float64(Float64(t_5 * y_46_im) + t_4)));
	end
	return tmp
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$5 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 * N[Sin[N[(N[(t$95$1 * y$46$im), $MachinePrecision] + t$95$4), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -5e+193], N[(t$95$2 * N[(N[Sin[t$95$3], $MachinePrecision] + N[(y$46$im * N[(N[Cos[t$95$3], $MachinePrecision] * N[Log[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(t$95$5 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$5 * y$46$im), $MachinePrecision] + t$95$4), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;e^{t\_5 \cdot y.re - t\_0} \cdot \sin \left(t\_5 \cdot y.im + t\_4\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -4.99999999999999972e193

    1. Initial program 40.8%

      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    2. Taylor expanded in y.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}{\left(\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + y.im \cdot \left(\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
    3. Step-by-step derivation
      1. 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 \left(\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \color{blue}{y.im \cdot \left(\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)}\right) \]
      2. 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 \left(\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \color{blue}{y.im} \cdot \left(\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\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 \left(\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + y.im \cdot \left(\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
      4. lift-atan2.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 \left(\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + y.im \cdot \left(\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
      5. lower-*.f64N/A

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

        \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + y.im \cdot \left(\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}\right)\right) \]
      7. 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 \left(\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + y.im \cdot \left(\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \log \color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}\right)\right) \]
      8. 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 \left(\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + y.im \cdot \left(\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \log \left(\sqrt{\color{blue}{{x.im}^{2} + {x.re}^{2}}}\right)\right)\right) \]
      9. lift-atan2.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 \left(\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + y.im \cdot \left(\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \log \left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)\right)\right) \]
      10. 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 \left(\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + y.im \cdot \left(\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
      11. lower-sqrt.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 \left(\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + y.im \cdot \left(\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
      12. pow2N/A

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

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

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

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

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

    if -4.99999999999999972e193 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re))))

    1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 80.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \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 (hypot x.re x.im))))
   (*
    (exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
    (sin (+ (* 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(hypot(x_46_re, x_46_im));
	return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
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.hypot(x_46_re, x_46_im));
	return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((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.hypot(x_46_re, x_46_im))
	return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((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(hypot(x_46_re, x_46_im))
	return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(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(hypot(x_46_re, x_46_im));
	tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((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[x$46$re ^ 2 + x$46$im ^ 2], $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[Sin[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(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Derivation
  1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 75.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{if}\;y.re \leq -3.1 \cdot 10^{-53}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 0.016:\\ \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0
         (*
          (exp
           (-
            (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
            (* (atan2 x.im x.re) y.im)))
          (sin (* y.re (atan2 x.im x.re))))))
   (if (<= y.re -3.1e-53)
     t_0
     (if (<= y.re 0.016)
       (*
        (exp (- (* y.im (atan2 x.im x.re))))
        (sin (+ (* (log (hypot x.re x.im)) y.im) (* (atan2 x.im x.re) y.re))))
       t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_re * atan2(x_46_im, x_46_re)));
	double tmp;
	if (y_46_re <= -3.1e-53) {
		tmp = t_0;
	} else if (y_46_re <= 0.016) {
		tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * sin(((log(hypot(x_46_re, x_46_im)) * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
	double tmp;
	if (y_46_re <= -3.1e-53) {
		tmp = t_0;
	} else if (y_46_re <= 0.016) {
		tmp = Math.exp(-(y_46_im * Math.atan2(x_46_im, x_46_re))) * Math.sin(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	t_0 = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin((y_46_re * math.atan2(x_46_im, x_46_re)))
	tmp = 0
	if y_46_re <= -3.1e-53:
		tmp = t_0
	elif y_46_re <= 0.016:
		tmp = math.exp(-(y_46_im * math.atan2(x_46_im, x_46_re))) * math.sin(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
	else:
		tmp = t_0
	return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(y_46_re * atan(x_46_im, x_46_re))))
	tmp = 0.0
	if (y_46_re <= -3.1e-53)
		tmp = t_0;
	elseif (y_46_re <= 0.016)
		tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re))));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_re * atan2(x_46_im, x_46_re)));
	tmp = 0.0;
	if (y_46_re <= -3.1e-53)
		tmp = t_0;
	elseif (y_46_re <= 0.016)
		tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * sin(((log(hypot(x_46_re, x_46_im)) * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -3.1e-53], t$95$0, If[LessEqual[y$46$re, 0.016], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * N[Sin[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -3.1 \cdot 10^{-53}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y.re \leq 0.016:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y.re < -3.10000000000000015e-53 or 0.016 < y.re

    1. Initial program 40.8%

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

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

        \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
    4. Applied rewrites53.6%

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

    if -3.10000000000000015e-53 < y.re < 0.016

    1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
      3. lift-atan2.f64N/A

        \[\leadsto e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
      4. lift-*.f6453.3

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

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

Alternative 4: 61.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \sin t\_0\\ t_2 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{if}\;x.im \leq -3.2 \cdot 10^{+192}:\\ \;\;\;\;t\_1 \cdot e^{-1 \cdot \left(y.re \cdot \log \left(\frac{-1}{x.im}\right)\right)}\\ \mathbf{elif}\;x.im \leq -3.9 \cdot 10^{+41}:\\ \;\;\;\;e^{-t\_2} \cdot \sin \left(\log \left(-1 \cdot x.im\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;x.im \leq 3.15 \cdot 10^{+40}:\\ \;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log x.im - t\_2} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.im, t\_0\right)\right)\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (* y.re (atan2 x.im x.re)))
        (t_1 (sin t_0))
        (t_2 (* y.im (atan2 x.im x.re))))
   (if (<= x.im -3.2e+192)
     (* t_1 (exp (* -1.0 (* y.re (log (/ -1.0 x.im))))))
     (if (<= x.im -3.9e+41)
       (*
        (exp (- t_2))
        (sin (+ (* (log (* -1.0 x.im)) y.im) (* (atan2 x.im x.re) y.re))))
       (if (<= x.im 3.15e+40)
         (*
          (exp
           (-
            (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
            (* (atan2 x.im x.re) y.im)))
          t_1)
         (*
          (exp (- (* y.re (log x.im)) t_2))
          (sin (fma y.im (log x.im) t_0))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = y_46_re * atan2(x_46_im, x_46_re);
	double t_1 = sin(t_0);
	double t_2 = y_46_im * atan2(x_46_im, x_46_re);
	double tmp;
	if (x_46_im <= -3.2e+192) {
		tmp = t_1 * exp((-1.0 * (y_46_re * log((-1.0 / x_46_im)))));
	} else if (x_46_im <= -3.9e+41) {
		tmp = exp(-t_2) * sin(((log((-1.0 * x_46_im)) * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
	} else if (x_46_im <= 3.15e+40) {
		tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_1;
	} else {
		tmp = exp(((y_46_re * log(x_46_im)) - t_2)) * sin(fma(y_46_im, log(x_46_im), t_0));
	}
	return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = Float64(y_46_re * atan(x_46_im, x_46_re))
	t_1 = sin(t_0)
	t_2 = Float64(y_46_im * atan(x_46_im, x_46_re))
	tmp = 0.0
	if (x_46_im <= -3.2e+192)
		tmp = Float64(t_1 * exp(Float64(-1.0 * Float64(y_46_re * log(Float64(-1.0 / x_46_im))))));
	elseif (x_46_im <= -3.9e+41)
		tmp = Float64(exp(Float64(-t_2)) * sin(Float64(Float64(log(Float64(-1.0 * x_46_im)) * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re))));
	elseif (x_46_im <= 3.15e+40)
		tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * t_1);
	else
		tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_im)) - t_2)) * sin(fma(y_46_im, log(x_46_im), t_0)));
	end
	return tmp
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -3.2e+192], N[(t$95$1 * N[Exp[N[(-1.0 * N[(y$46$re * N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, -3.9e+41], N[(N[Exp[(-t$95$2)], $MachinePrecision] * N[Sin[N[(N[(N[Log[N[(-1.0 * x$46$im), $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 3.15e+40], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$im], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t\_0\\
t_2 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.im \leq -3.2 \cdot 10^{+192}:\\
\;\;\;\;t\_1 \cdot e^{-1 \cdot \left(y.re \cdot \log \left(\frac{-1}{x.im}\right)\right)}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x.im < -3.20000000000000023e192

    1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sin \left(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)} \]
    6. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \sin \left(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)} \]
      2. lower-*.f64N/A

        \[\leadsto \sin \left(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)} \]
      3. lower-*.f64N/A

        \[\leadsto \sin \left(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)} \]
      4. lift-log.f64N/A

        \[\leadsto \sin \left(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)} \]
      5. lift-/.f6419.3

        \[\leadsto \sin \left(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)} \]
    7. Applied rewrites19.3%

      \[\leadsto \sin \left(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)} \]

    if -3.20000000000000023e192 < x.im < -3.8999999999999997e41

    1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
      3. lift-atan2.f64N/A

        \[\leadsto e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
      4. lift-*.f6453.3

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

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

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

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

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

    if -3.8999999999999997e41 < x.im < 3.15000000000000003e40

    1. Initial program 40.8%

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

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

        \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
    4. Applied rewrites53.6%

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

    if 3.15000000000000003e40 < x.im

    1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{y.re \cdot \log x.im - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
      12. lift-atan2.f6430.7

        \[\leadsto e^{y.re \cdot \log x.im - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
    4. Applied rewrites30.7%

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

Alternative 5: 59.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ t_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 t\_0\\ \mathbf{if}\;y.re \leq -9.6 \cdot 10^{-6}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq 0.046:\\ \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (sin (* y.re (atan2 x.im x.re))))
        (t_1
         (*
          (exp
           (-
            (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
            (* (atan2 x.im x.re) y.im)))
          t_0)))
   (if (<= y.re -9.6e-6)
     t_1
     (if (<= y.re 0.046) (* (exp (- (* y.im (atan2 x.im x.re)))) t_0) t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
	double t_1 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
	double tmp;
	if (y_46_re <= -9.6e-6) {
		tmp = t_1;
	} else if (y_46_re <= 0.046) {
		tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
    real(8), intent (in) :: x_46re
    real(8), intent (in) :: x_46im
    real(8), intent (in) :: y_46re
    real(8), intent (in) :: y_46im
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = sin((y_46re * atan2(x_46im, x_46re)))
    t_1 = exp(((log(sqrt(((x_46re * x_46re) + (x_46im * x_46im)))) * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * t_0
    if (y_46re <= (-9.6d-6)) then
        tmp = t_1
    else if (y_46re <= 0.046d0) then
        tmp = exp(-(y_46im * atan2(x_46im, x_46re))) * t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
	double t_1 = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
	double tmp;
	if (y_46_re <= -9.6e-6) {
		tmp = t_1;
	} else if (y_46_re <= 0.046) {
		tmp = Math.exp(-(y_46_im * Math.atan2(x_46_im, x_46_re))) * t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re)))
	t_1 = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * t_0
	tmp = 0
	if y_46_re <= -9.6e-6:
		tmp = t_1
	elif y_46_re <= 0.046:
		tmp = math.exp(-(y_46_im * math.atan2(x_46_im, x_46_re))) * t_0
	else:
		tmp = t_1
	return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re)))
	t_1 = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * t_0)
	tmp = 0.0
	if (y_46_re <= -9.6e-6)
		tmp = t_1;
	elseif (y_46_re <= 0.046)
		tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * t_0);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
	t_1 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
	tmp = 0.0;
	if (y_46_re <= -9.6e-6)
		tmp = t_1;
	elseif (y_46_re <= 0.046)
		tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -9.6e-6], t$95$1, If[LessEqual[y$46$re, 0.046], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * t$95$0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_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 t\_0\\
\mathbf{if}\;y.re \leq -9.6 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y.re \leq 0.046:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


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

    1. Initial program 40.8%

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

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

        \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
    4. Applied rewrites53.6%

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

    if -9.5999999999999996e-6 < y.re < 0.045999999999999999

    1. Initial program 40.8%

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

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

        \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
    4. Applied rewrites53.6%

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

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

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

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

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

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

Alternative 6: 58.9% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ t_1 := t\_0 \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\ t_2 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{if}\;y.re \leq -0.31:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq 1.35 \cdot 10^{+68}:\\ \;\;\;\;e^{-t\_2} \cdot t\_0\\ \mathbf{elif}\;y.re \leq 4 \cdot 10^{+177}:\\ \;\;\;\;e^{y.re \cdot \log x.re - t\_2} \cdot \sin \left(y.im \cdot \log x.re\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (sin (* y.re (atan2 x.im x.re))))
        (t_1 (* t_0 (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re)))
        (t_2 (* y.im (atan2 x.im x.re))))
   (if (<= y.re -0.31)
     t_1
     (if (<= y.re 1.35e+68)
       (* (exp (- t_2)) t_0)
       (if (<= y.re 4e+177)
         (* (exp (- (* y.re (log x.re)) t_2)) (sin (* y.im (log x.re))))
         t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
	double t_1 = t_0 * pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
	double t_2 = y_46_im * atan2(x_46_im, x_46_re);
	double tmp;
	if (y_46_re <= -0.31) {
		tmp = t_1;
	} else if (y_46_re <= 1.35e+68) {
		tmp = exp(-t_2) * t_0;
	} else if (y_46_re <= 4e+177) {
		tmp = exp(((y_46_re * log(x_46_re)) - t_2)) * sin((y_46_im * log(x_46_re)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re)))
	t_1 = Float64(t_0 * (sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re))
	t_2 = Float64(y_46_im * atan(x_46_im, x_46_re))
	tmp = 0.0
	if (y_46_re <= -0.31)
		tmp = t_1;
	elseif (y_46_re <= 1.35e+68)
		tmp = Float64(exp(Float64(-t_2)) * t_0);
	elseif (y_46_re <= 4e+177)
		tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_re)) - t_2)) * sin(Float64(y_46_im * log(x_46_re))));
	else
		tmp = t_1;
	end
	return tmp
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.31], t$95$1, If[LessEqual[y$46$re, 1.35e+68], N[(N[Exp[(-t$95$2)], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 4e+177], N[(N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := t\_0 \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
t_2 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -0.31:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y.re \leq 1.35 \cdot 10^{+68}:\\
\;\;\;\;e^{-t\_2} \cdot t\_0\\

\mathbf{elif}\;y.re \leq 4 \cdot 10^{+177}:\\
\;\;\;\;e^{y.re \cdot \log x.re - t\_2} \cdot \sin \left(y.im \cdot \log x.re\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y.re < -0.309999999999999998 or 4e177 < y.re

    1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.309999999999999998 < y.re < 1.34999999999999995e68

    1. Initial program 40.8%

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

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

        \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
    4. Applied rewrites53.6%

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

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

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

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

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

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

    if 1.34999999999999995e68 < y.re < 4e177

    1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{y.re \cdot \log x.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.re, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
      12. lift-atan2.f6432.4

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

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

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

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

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

        \[\leadsto e^{y.re \cdot \log x.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.im \cdot \log x.re\right) \]
    7. Applied rewrites28.2%

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

Alternative 7: 56.3% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ t_1 := t\_0 \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\ \mathbf{if}\;y.re \leq -0.31:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq 0.46:\\ \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (sin (* y.re (atan2 x.im x.re))))
        (t_1 (* t_0 (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))))
   (if (<= y.re -0.31)
     t_1
     (if (<= y.re 0.46) (* (exp (- (* y.im (atan2 x.im x.re)))) t_0) t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
	double t_1 = t_0 * pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
	double tmp;
	if (y_46_re <= -0.31) {
		tmp = t_1;
	} else if (y_46_re <= 0.46) {
		tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re)))
	t_1 = Float64(t_0 * (sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re))
	tmp = 0.0
	if (y_46_re <= -0.31)
		tmp = t_1;
	elseif (y_46_re <= 0.46)
		tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * t_0);
	else
		tmp = t_1;
	end
	return tmp
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.31], t$95$1, If[LessEqual[y$46$re, 0.46], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * t$95$0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := t\_0 \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -0.31:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y.re \leq 0.46:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y.re < -0.309999999999999998 or 0.46000000000000002 < y.re

    1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.309999999999999998 < y.re < 0.46000000000000002

    1. Initial program 40.8%

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

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

        \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
    4. Applied rewrites53.6%

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

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

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

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

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

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

Alternative 8: 49.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\\ t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {t\_0}^{y.re}\\ \mathbf{if}\;y.re \leq -3.15 \cdot 10^{-186}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq 6.4 \cdot 10^{-205}:\\ \;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \sin \left(y.im \cdot \log t\_0\right)\\ \mathbf{elif}\;y.re \leq 1.3 \cdot 10^{-34}:\\ \;\;\;\;\left(y.re \cdot \mathsf{fma}\left(-0.16666666666666666, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (sqrt (fma x.im x.im (* x.re x.re))))
        (t_1 (* (sin (* y.re (atan2 x.im x.re))) (pow t_0 y.re))))
   (if (<= y.re -3.15e-186)
     t_1
     (if (<= y.re 6.4e-205)
       (* (exp (* y.im (- (atan2 x.im x.re)))) (sin (* y.im (log t_0))))
       (if (<= y.re 1.3e-34)
         (*
          (*
           y.re
           (fma
            -0.16666666666666666
            (* (* y.re y.re) (pow (atan2 x.im x.re) 3.0))
            (atan2 x.im x.re)))
          1.0)
         t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)));
	double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(t_0, y_46_re);
	double tmp;
	if (y_46_re <= -3.15e-186) {
		tmp = t_1;
	} else if (y_46_re <= 6.4e-205) {
		tmp = exp((y_46_im * -atan2(x_46_im, x_46_re))) * sin((y_46_im * log(t_0)));
	} else if (y_46_re <= 1.3e-34) {
		tmp = (y_46_re * fma(-0.16666666666666666, ((y_46_re * y_46_re) * pow(atan2(x_46_im, x_46_re), 3.0)), atan2(x_46_im, x_46_re))) * 1.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)))
	t_1 = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (t_0 ^ y_46_re))
	tmp = 0.0
	if (y_46_re <= -3.15e-186)
		tmp = t_1;
	elseif (y_46_re <= 6.4e-205)
		tmp = Float64(exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))) * sin(Float64(y_46_im * log(t_0))));
	elseif (y_46_re <= 1.3e-34)
		tmp = Float64(Float64(y_46_re * fma(-0.16666666666666666, Float64(Float64(y_46_re * y_46_re) * (atan(x_46_im, x_46_re) ^ 3.0)), atan(x_46_im, x_46_re))) * 1.0);
	else
		tmp = t_1;
	end
	return tmp
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[t$95$0, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -3.15e-186], t$95$1, If[LessEqual[y$46$re, 6.4e-205], N[(N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[t$95$0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.3e-34], N[(N[(y$46$re * N[(-0.16666666666666666 * N[(N[(y$46$re * y$46$re), $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {t\_0}^{y.re}\\
\mathbf{if}\;y.re \leq -3.15 \cdot 10^{-186}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y.re \leq 6.4 \cdot 10^{-205}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \sin \left(y.im \cdot \log t\_0\right)\\

\mathbf{elif}\;y.re \leq 1.3 \cdot 10^{-34}:\\
\;\;\;\;\left(y.re \cdot \mathsf{fma}\left(-0.16666666666666666, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y.re < -3.1499999999999999e-186 or 1.3e-34 < y.re

    1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.1499999999999999e-186 < y.re < 6.40000000000000018e-205

    1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.40000000000000018e-205 < y.re < 1.3e-34

    1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, {y.re}^{2} \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
        4. unpow2N/A

          \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
        5. lower-*.f64N/A

          \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
        6. lower-pow.f64N/A

          \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
        7. lift-atan2.f64N/A

          \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
        8. lift-atan2.f6420.2

          \[\leadsto \left(y.re \cdot \mathsf{fma}\left(-0.16666666666666666, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
      4. Applied rewrites20.2%

        \[\leadsto \left(y.re \cdot \mathsf{fma}\left(-0.16666666666666666, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
    7. Recombined 3 regimes into one program.
    8. Add Preprocessing

    Alternative 9: 47.2% accurate, 1.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ t_1 := t\_0 \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\ \mathbf{if}\;y.re \leq -3.5 \cdot 10^{-239}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq 2.8 \cdot 10^{-185}:\\ \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.im \cdot \log x.re\right)\\ \mathbf{elif}\;y.re \leq 1.3 \cdot 10^{-34}:\\ \;\;\;\;t\_0 \cdot 1\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x.re x.im y.re y.im)
     :precision binary64
     (let* ((t_0 (sin (* y.re (atan2 x.im x.re))))
            (t_1 (* t_0 (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))))
       (if (<= y.re -3.5e-239)
         t_1
         (if (<= y.re 2.8e-185)
           (* (exp (- (* y.im (atan2 x.im x.re)))) (sin (* y.im (log x.re))))
           (if (<= y.re 1.3e-34) (* t_0 1.0) t_1)))))
    double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
    	double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
    	double t_1 = t_0 * pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
    	double tmp;
    	if (y_46_re <= -3.5e-239) {
    		tmp = t_1;
    	} else if (y_46_re <= 2.8e-185) {
    		tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * sin((y_46_im * log(x_46_re)));
    	} else if (y_46_re <= 1.3e-34) {
    		tmp = t_0 * 1.0;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x_46_re, x_46_im, y_46_re, y_46_im)
    	t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re)))
    	t_1 = Float64(t_0 * (sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re))
    	tmp = 0.0
    	if (y_46_re <= -3.5e-239)
    		tmp = t_1;
    	elseif (y_46_re <= 2.8e-185)
    		tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(Float64(y_46_im * log(x_46_re))));
    	elseif (y_46_re <= 1.3e-34)
    		tmp = Float64(t_0 * 1.0);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -3.5e-239], t$95$1, If[LessEqual[y$46$re, 2.8e-185], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.3e-34], N[(t$95$0 * 1.0), $MachinePrecision], t$95$1]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
    t_1 := t\_0 \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
    \mathbf{if}\;y.re \leq -3.5 \cdot 10^{-239}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;y.re \leq 2.8 \cdot 10^{-185}:\\
    \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.im \cdot \log x.re\right)\\
    
    \mathbf{elif}\;y.re \leq 1.3 \cdot 10^{-34}:\\
    \;\;\;\;t\_0 \cdot 1\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y.re < -3.50000000000000005e-239 or 1.3e-34 < y.re

      1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -3.50000000000000005e-239 < y.re < 2.79999999999999991e-185

      1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto e^{y.re \cdot \log x.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.re, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
        12. lift-atan2.f6432.4

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

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

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

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

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

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

          \[\leadsto e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.im \cdot \log x.re\right) \]
        5. lift-exp.f64N/A

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

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

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

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

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

      if 2.79999999999999991e-185 < y.re < 1.3e-34

      1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 10: 43.2% accurate, 1.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{if}\;x.re \leq -22500000000000:\\ \;\;\;\;t\_0 \cdot e^{-1 \cdot \left(y.re \cdot \log \left(\frac{-1}{x.re}\right)\right)}\\ \mathbf{elif}\;x.re \leq 2.7 \cdot 10^{-75}:\\ \;\;\;\;t\_0 \cdot {\left(\sqrt{x.im \cdot x.im}\right)}^{y.re}\\ \mathbf{elif}\;x.re \leq 9.8 \cdot 10^{+122}:\\ \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.im \cdot \log x.re\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot {x.re}^{y.re}\\ \end{array} \end{array} \]
      (FPCore (x.re x.im y.re y.im)
       :precision binary64
       (let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
         (if (<= x.re -22500000000000.0)
           (* t_0 (exp (* -1.0 (* y.re (log (/ -1.0 x.re))))))
           (if (<= x.re 2.7e-75)
             (* t_0 (pow (sqrt (* x.im x.im)) y.re))
             (if (<= x.re 9.8e+122)
               (* (exp (- (* y.im (atan2 x.im x.re)))) (sin (* y.im (log x.re))))
               (* t_0 (pow x.re y.re)))))))
      double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
      	double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
      	double tmp;
      	if (x_46_re <= -22500000000000.0) {
      		tmp = t_0 * exp((-1.0 * (y_46_re * log((-1.0 / x_46_re)))));
      	} else if (x_46_re <= 2.7e-75) {
      		tmp = t_0 * pow(sqrt((x_46_im * x_46_im)), y_46_re);
      	} else if (x_46_re <= 9.8e+122) {
      		tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * sin((y_46_im * log(x_46_re)));
      	} else {
      		tmp = t_0 * pow(x_46_re, y_46_re);
      	}
      	return tmp;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x_46re, x_46im, y_46re, y_46im)
      use fmin_fmax_functions
          real(8), intent (in) :: x_46re
          real(8), intent (in) :: x_46im
          real(8), intent (in) :: y_46re
          real(8), intent (in) :: y_46im
          real(8) :: t_0
          real(8) :: tmp
          t_0 = sin((y_46re * atan2(x_46im, x_46re)))
          if (x_46re <= (-22500000000000.0d0)) then
              tmp = t_0 * exp(((-1.0d0) * (y_46re * log(((-1.0d0) / x_46re)))))
          else if (x_46re <= 2.7d-75) then
              tmp = t_0 * (sqrt((x_46im * x_46im)) ** y_46re)
          else if (x_46re <= 9.8d+122) then
              tmp = exp(-(y_46im * atan2(x_46im, x_46re))) * sin((y_46im * log(x_46re)))
          else
              tmp = t_0 * (x_46re ** y_46re)
          end if
          code = tmp
      end function
      
      public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
      	double t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
      	double tmp;
      	if (x_46_re <= -22500000000000.0) {
      		tmp = t_0 * Math.exp((-1.0 * (y_46_re * Math.log((-1.0 / x_46_re)))));
      	} else if (x_46_re <= 2.7e-75) {
      		tmp = t_0 * Math.pow(Math.sqrt((x_46_im * x_46_im)), y_46_re);
      	} else if (x_46_re <= 9.8e+122) {
      		tmp = Math.exp(-(y_46_im * Math.atan2(x_46_im, x_46_re))) * Math.sin((y_46_im * Math.log(x_46_re)));
      	} else {
      		tmp = t_0 * Math.pow(x_46_re, y_46_re);
      	}
      	return tmp;
      }
      
      def code(x_46_re, x_46_im, y_46_re, y_46_im):
      	t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re)))
      	tmp = 0
      	if x_46_re <= -22500000000000.0:
      		tmp = t_0 * math.exp((-1.0 * (y_46_re * math.log((-1.0 / x_46_re)))))
      	elif x_46_re <= 2.7e-75:
      		tmp = t_0 * math.pow(math.sqrt((x_46_im * x_46_im)), y_46_re)
      	elif x_46_re <= 9.8e+122:
      		tmp = math.exp(-(y_46_im * math.atan2(x_46_im, x_46_re))) * math.sin((y_46_im * math.log(x_46_re)))
      	else:
      		tmp = t_0 * math.pow(x_46_re, y_46_re)
      	return tmp
      
      function code(x_46_re, x_46_im, y_46_re, y_46_im)
      	t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re)))
      	tmp = 0.0
      	if (x_46_re <= -22500000000000.0)
      		tmp = Float64(t_0 * exp(Float64(-1.0 * Float64(y_46_re * log(Float64(-1.0 / x_46_re))))));
      	elseif (x_46_re <= 2.7e-75)
      		tmp = Float64(t_0 * (sqrt(Float64(x_46_im * x_46_im)) ^ y_46_re));
      	elseif (x_46_re <= 9.8e+122)
      		tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(Float64(y_46_im * log(x_46_re))));
      	else
      		tmp = Float64(t_0 * (x_46_re ^ y_46_re));
      	end
      	return tmp
      end
      
      function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
      	t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
      	tmp = 0.0;
      	if (x_46_re <= -22500000000000.0)
      		tmp = t_0 * exp((-1.0 * (y_46_re * log((-1.0 / x_46_re)))));
      	elseif (x_46_re <= 2.7e-75)
      		tmp = t_0 * (sqrt((x_46_im * x_46_im)) ^ y_46_re);
      	elseif (x_46_re <= 9.8e+122)
      		tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * sin((y_46_im * log(x_46_re)));
      	else
      		tmp = t_0 * (x_46_re ^ y_46_re);
      	end
      	tmp_2 = tmp;
      end
      
      code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -22500000000000.0], N[(t$95$0 * N[Exp[N[(-1.0 * N[(y$46$re * N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 2.7e-75], N[(t$95$0 * N[Power[N[Sqrt[N[(x$46$im * x$46$im), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 9.8e+122], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
      \mathbf{if}\;x.re \leq -22500000000000:\\
      \;\;\;\;t\_0 \cdot e^{-1 \cdot \left(y.re \cdot \log \left(\frac{-1}{x.re}\right)\right)}\\
      
      \mathbf{elif}\;x.re \leq 2.7 \cdot 10^{-75}:\\
      \;\;\;\;t\_0 \cdot {\left(\sqrt{x.im \cdot x.im}\right)}^{y.re}\\
      
      \mathbf{elif}\;x.re \leq 9.8 \cdot 10^{+122}:\\
      \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.im \cdot \log x.re\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if x.re < -2.25e13

        1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{-1 \cdot \left(y.re \cdot \log \left(\frac{-1}{x.re}\right)\right)} \]
        6. Step-by-step derivation
          1. lower-exp.f64N/A

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

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

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

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{-1 \cdot \left(y.re \cdot \log \left(\frac{-1}{x.re}\right)\right)} \]
          5. lower-/.f6420.2

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{-1 \cdot \left(y.re \cdot \log \left(\frac{-1}{x.re}\right)\right)} \]
        7. Applied rewrites20.2%

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

        if -2.25e13 < x.re < 2.6999999999999998e-75

        1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{x.im \cdot x.im}\right)}^{y.re} \]
          2. lift-*.f6436.8

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{x.im \cdot x.im}\right)}^{y.re} \]
        7. Applied rewrites36.8%

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

        if 2.6999999999999998e-75 < x.re < 9.7999999999999995e122

        1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto e^{y.re \cdot \log x.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.re, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
          12. lift-atan2.f6432.4

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

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

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

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

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

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

            \[\leadsto e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.im \cdot \log x.re\right) \]
          5. lift-exp.f64N/A

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

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

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

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

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

        if 9.7999999999999995e122 < x.re

        1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{\color{blue}{y.re}} \]
        6. Step-by-step derivation
          1. lower-pow.f6431.5

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{y.re} \]
        7. Applied rewrites31.5%

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

      Alternative 11: 41.4% accurate, 1.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{if}\;x.im \leq -0.68:\\ \;\;\;\;t\_0 \cdot e^{-1 \cdot \left(y.re \cdot \log \left(\frac{-1}{x.im}\right)\right)}\\ \mathbf{elif}\;x.im \leq 1.16 \cdot 10^{-76}:\\ \;\;\;\;t\_0 \cdot {x.re}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot e^{y.re \cdot \log x.im}\\ \end{array} \end{array} \]
      (FPCore (x.re x.im y.re y.im)
       :precision binary64
       (let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
         (if (<= x.im -0.68)
           (* t_0 (exp (* -1.0 (* y.re (log (/ -1.0 x.im))))))
           (if (<= x.im 1.16e-76)
             (* t_0 (pow x.re y.re))
             (* t_0 (exp (* y.re (log x.im))))))))
      double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
      	double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
      	double tmp;
      	if (x_46_im <= -0.68) {
      		tmp = t_0 * exp((-1.0 * (y_46_re * log((-1.0 / x_46_im)))));
      	} else if (x_46_im <= 1.16e-76) {
      		tmp = t_0 * pow(x_46_re, y_46_re);
      	} else {
      		tmp = t_0 * exp((y_46_re * log(x_46_im)));
      	}
      	return tmp;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x_46re, x_46im, y_46re, y_46im)
      use fmin_fmax_functions
          real(8), intent (in) :: x_46re
          real(8), intent (in) :: x_46im
          real(8), intent (in) :: y_46re
          real(8), intent (in) :: y_46im
          real(8) :: t_0
          real(8) :: tmp
          t_0 = sin((y_46re * atan2(x_46im, x_46re)))
          if (x_46im <= (-0.68d0)) then
              tmp = t_0 * exp(((-1.0d0) * (y_46re * log(((-1.0d0) / x_46im)))))
          else if (x_46im <= 1.16d-76) then
              tmp = t_0 * (x_46re ** y_46re)
          else
              tmp = t_0 * exp((y_46re * log(x_46im)))
          end if
          code = tmp
      end function
      
      public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
      	double t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
      	double tmp;
      	if (x_46_im <= -0.68) {
      		tmp = t_0 * Math.exp((-1.0 * (y_46_re * Math.log((-1.0 / x_46_im)))));
      	} else if (x_46_im <= 1.16e-76) {
      		tmp = t_0 * Math.pow(x_46_re, y_46_re);
      	} else {
      		tmp = t_0 * Math.exp((y_46_re * Math.log(x_46_im)));
      	}
      	return tmp;
      }
      
      def code(x_46_re, x_46_im, y_46_re, y_46_im):
      	t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re)))
      	tmp = 0
      	if x_46_im <= -0.68:
      		tmp = t_0 * math.exp((-1.0 * (y_46_re * math.log((-1.0 / x_46_im)))))
      	elif x_46_im <= 1.16e-76:
      		tmp = t_0 * math.pow(x_46_re, y_46_re)
      	else:
      		tmp = t_0 * math.exp((y_46_re * math.log(x_46_im)))
      	return tmp
      
      function code(x_46_re, x_46_im, y_46_re, y_46_im)
      	t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re)))
      	tmp = 0.0
      	if (x_46_im <= -0.68)
      		tmp = Float64(t_0 * exp(Float64(-1.0 * Float64(y_46_re * log(Float64(-1.0 / x_46_im))))));
      	elseif (x_46_im <= 1.16e-76)
      		tmp = Float64(t_0 * (x_46_re ^ y_46_re));
      	else
      		tmp = Float64(t_0 * exp(Float64(y_46_re * log(x_46_im))));
      	end
      	return tmp
      end
      
      function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
      	t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
      	tmp = 0.0;
      	if (x_46_im <= -0.68)
      		tmp = t_0 * exp((-1.0 * (y_46_re * log((-1.0 / x_46_im)))));
      	elseif (x_46_im <= 1.16e-76)
      		tmp = t_0 * (x_46_re ^ y_46_re);
      	else
      		tmp = t_0 * exp((y_46_re * log(x_46_im)));
      	end
      	tmp_2 = tmp;
      end
      
      code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -0.68], N[(t$95$0 * N[Exp[N[(-1.0 * N[(y$46$re * N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.16e-76], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Exp[N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
      \mathbf{if}\;x.im \leq -0.68:\\
      \;\;\;\;t\_0 \cdot e^{-1 \cdot \left(y.re \cdot \log \left(\frac{-1}{x.im}\right)\right)}\\
      
      \mathbf{elif}\;x.im \leq 1.16 \cdot 10^{-76}:\\
      \;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0 \cdot e^{y.re \cdot \log x.im}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if x.im < -0.680000000000000049

        1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \sin \left(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)} \]
        6. Step-by-step derivation
          1. lower-exp.f64N/A

            \[\leadsto \sin \left(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)} \]
          2. lower-*.f64N/A

            \[\leadsto \sin \left(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)} \]
          3. lower-*.f64N/A

            \[\leadsto \sin \left(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)} \]
          4. lift-log.f64N/A

            \[\leadsto \sin \left(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)} \]
          5. lift-/.f6419.3

            \[\leadsto \sin \left(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)} \]
        7. Applied rewrites19.3%

          \[\leadsto \sin \left(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)} \]

        if -0.680000000000000049 < x.im < 1.1599999999999999e-76

        1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{\color{blue}{y.re}} \]
        6. Step-by-step derivation
          1. lower-pow.f6431.5

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{y.re} \]
        7. Applied rewrites31.5%

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

        if 1.1599999999999999e-76 < x.im

        1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \sin \left(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)} \]
        6. Step-by-step derivation
          1. lower-exp.f64N/A

            \[\leadsto \sin \left(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)} \]
          2. lower-*.f64N/A

            \[\leadsto \sin \left(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)} \]
          3. inv-powN/A

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{-1 \cdot \left(y.re \cdot \log \left({x.im}^{-1}\right)\right)} \]
          4. log-pow-revN/A

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

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{-1 \cdot \left(y.re \cdot \left(-1 \cdot \log x.im\right)\right)} \]
          6. log-pow-revN/A

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{-1 \cdot \left(y.re \cdot \log \left({x.im}^{-1}\right)\right)} \]
          7. inv-powN/A

            \[\leadsto \sin \left(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)} \]
          8. log-recN/A

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

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

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{-1 \cdot \left(y.re \cdot \left(-\log x.im\right)\right)} \]
        7. Applied rewrites18.8%

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

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

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

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{y.re \cdot \log x.im} \]
        10. Applied rewrites18.8%

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

      Alternative 12: 41.1% accurate, 1.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{if}\;x.im \leq -0.68:\\ \;\;\;\;t\_0 \cdot {\left(\sqrt{x.im \cdot x.im}\right)}^{y.re}\\ \mathbf{elif}\;x.im \leq 1.16 \cdot 10^{-76}:\\ \;\;\;\;t\_0 \cdot {x.re}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot e^{y.re \cdot \log x.im}\\ \end{array} \end{array} \]
      (FPCore (x.re x.im y.re y.im)
       :precision binary64
       (let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
         (if (<= x.im -0.68)
           (* t_0 (pow (sqrt (* x.im x.im)) y.re))
           (if (<= x.im 1.16e-76)
             (* t_0 (pow x.re y.re))
             (* t_0 (exp (* y.re (log x.im))))))))
      double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
      	double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
      	double tmp;
      	if (x_46_im <= -0.68) {
      		tmp = t_0 * pow(sqrt((x_46_im * x_46_im)), y_46_re);
      	} else if (x_46_im <= 1.16e-76) {
      		tmp = t_0 * pow(x_46_re, y_46_re);
      	} else {
      		tmp = t_0 * exp((y_46_re * log(x_46_im)));
      	}
      	return tmp;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x_46re, x_46im, y_46re, y_46im)
      use fmin_fmax_functions
          real(8), intent (in) :: x_46re
          real(8), intent (in) :: x_46im
          real(8), intent (in) :: y_46re
          real(8), intent (in) :: y_46im
          real(8) :: t_0
          real(8) :: tmp
          t_0 = sin((y_46re * atan2(x_46im, x_46re)))
          if (x_46im <= (-0.68d0)) then
              tmp = t_0 * (sqrt((x_46im * x_46im)) ** y_46re)
          else if (x_46im <= 1.16d-76) then
              tmp = t_0 * (x_46re ** y_46re)
          else
              tmp = t_0 * exp((y_46re * log(x_46im)))
          end if
          code = tmp
      end function
      
      public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
      	double t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
      	double tmp;
      	if (x_46_im <= -0.68) {
      		tmp = t_0 * Math.pow(Math.sqrt((x_46_im * x_46_im)), y_46_re);
      	} else if (x_46_im <= 1.16e-76) {
      		tmp = t_0 * Math.pow(x_46_re, y_46_re);
      	} else {
      		tmp = t_0 * Math.exp((y_46_re * Math.log(x_46_im)));
      	}
      	return tmp;
      }
      
      def code(x_46_re, x_46_im, y_46_re, y_46_im):
      	t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re)))
      	tmp = 0
      	if x_46_im <= -0.68:
      		tmp = t_0 * math.pow(math.sqrt((x_46_im * x_46_im)), y_46_re)
      	elif x_46_im <= 1.16e-76:
      		tmp = t_0 * math.pow(x_46_re, y_46_re)
      	else:
      		tmp = t_0 * math.exp((y_46_re * math.log(x_46_im)))
      	return tmp
      
      function code(x_46_re, x_46_im, y_46_re, y_46_im)
      	t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re)))
      	tmp = 0.0
      	if (x_46_im <= -0.68)
      		tmp = Float64(t_0 * (sqrt(Float64(x_46_im * x_46_im)) ^ y_46_re));
      	elseif (x_46_im <= 1.16e-76)
      		tmp = Float64(t_0 * (x_46_re ^ y_46_re));
      	else
      		tmp = Float64(t_0 * exp(Float64(y_46_re * log(x_46_im))));
      	end
      	return tmp
      end
      
      function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
      	t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
      	tmp = 0.0;
      	if (x_46_im <= -0.68)
      		tmp = t_0 * (sqrt((x_46_im * x_46_im)) ^ y_46_re);
      	elseif (x_46_im <= 1.16e-76)
      		tmp = t_0 * (x_46_re ^ y_46_re);
      	else
      		tmp = t_0 * exp((y_46_re * log(x_46_im)));
      	end
      	tmp_2 = tmp;
      end
      
      code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -0.68], N[(t$95$0 * N[Power[N[Sqrt[N[(x$46$im * x$46$im), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.16e-76], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Exp[N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
      \mathbf{if}\;x.im \leq -0.68:\\
      \;\;\;\;t\_0 \cdot {\left(\sqrt{x.im \cdot x.im}\right)}^{y.re}\\
      
      \mathbf{elif}\;x.im \leq 1.16 \cdot 10^{-76}:\\
      \;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0 \cdot e^{y.re \cdot \log x.im}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if x.im < -0.680000000000000049

        1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{x.im \cdot x.im}\right)}^{y.re} \]
          2. lift-*.f6436.8

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{x.im \cdot x.im}\right)}^{y.re} \]
        7. Applied rewrites36.8%

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

        if -0.680000000000000049 < x.im < 1.1599999999999999e-76

        1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{\color{blue}{y.re}} \]
        6. Step-by-step derivation
          1. lower-pow.f6431.5

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{y.re} \]
        7. Applied rewrites31.5%

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

        if 1.1599999999999999e-76 < x.im

        1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \sin \left(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)} \]
        6. Step-by-step derivation
          1. lower-exp.f64N/A

            \[\leadsto \sin \left(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)} \]
          2. lower-*.f64N/A

            \[\leadsto \sin \left(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)} \]
          3. inv-powN/A

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{-1 \cdot \left(y.re \cdot \log \left({x.im}^{-1}\right)\right)} \]
          4. log-pow-revN/A

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

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{-1 \cdot \left(y.re \cdot \left(-1 \cdot \log x.im\right)\right)} \]
          6. log-pow-revN/A

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{-1 \cdot \left(y.re \cdot \log \left({x.im}^{-1}\right)\right)} \]
          7. inv-powN/A

            \[\leadsto \sin \left(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)} \]
          8. log-recN/A

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

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

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{-1 \cdot \left(y.re \cdot \left(-\log x.im\right)\right)} \]
        7. Applied rewrites18.8%

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

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

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

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{y.re \cdot \log x.im} \]
        10. Applied rewrites18.8%

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

      Alternative 13: 35.0% accurate, 1.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{if}\;y.re \leq -530000:\\ \;\;\;\;t\_0 \cdot {x.re}^{y.re}\\ \mathbf{elif}\;y.re \leq 2.8 \cdot 10^{-185}:\\ \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.im \cdot \log x.re\right)\\ \mathbf{elif}\;y.re \leq 7.5 \cdot 10^{+191}:\\ \;\;\;\;\left(y.re \cdot \mathsf{fma}\left(-0.16666666666666666, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot {x.im}^{y.re}\\ \end{array} \end{array} \]
      (FPCore (x.re x.im y.re y.im)
       :precision binary64
       (let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
         (if (<= y.re -530000.0)
           (* t_0 (pow x.re y.re))
           (if (<= y.re 2.8e-185)
             (* (exp (- (* y.im (atan2 x.im x.re)))) (sin (* y.im (log x.re))))
             (if (<= y.re 7.5e+191)
               (*
                (*
                 y.re
                 (fma
                  -0.16666666666666666
                  (* (* y.re y.re) (pow (atan2 x.im x.re) 3.0))
                  (atan2 x.im x.re)))
                1.0)
               (* t_0 (pow x.im y.re)))))))
      double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
      	double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
      	double tmp;
      	if (y_46_re <= -530000.0) {
      		tmp = t_0 * pow(x_46_re, y_46_re);
      	} else if (y_46_re <= 2.8e-185) {
      		tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * sin((y_46_im * log(x_46_re)));
      	} else if (y_46_re <= 7.5e+191) {
      		tmp = (y_46_re * fma(-0.16666666666666666, ((y_46_re * y_46_re) * pow(atan2(x_46_im, x_46_re), 3.0)), atan2(x_46_im, x_46_re))) * 1.0;
      	} else {
      		tmp = t_0 * pow(x_46_im, y_46_re);
      	}
      	return tmp;
      }
      
      function code(x_46_re, x_46_im, y_46_re, y_46_im)
      	t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re)))
      	tmp = 0.0
      	if (y_46_re <= -530000.0)
      		tmp = Float64(t_0 * (x_46_re ^ y_46_re));
      	elseif (y_46_re <= 2.8e-185)
      		tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(Float64(y_46_im * log(x_46_re))));
      	elseif (y_46_re <= 7.5e+191)
      		tmp = Float64(Float64(y_46_re * fma(-0.16666666666666666, Float64(Float64(y_46_re * y_46_re) * (atan(x_46_im, x_46_re) ^ 3.0)), atan(x_46_im, x_46_re))) * 1.0);
      	else
      		tmp = Float64(t_0 * (x_46_im ^ y_46_re));
      	end
      	return tmp
      end
      
      code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -530000.0], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.8e-185], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7.5e+191], N[(N[(y$46$re * N[(-0.16666666666666666 * N[(N[(y$46$re * y$46$re), $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
      \mathbf{if}\;y.re \leq -530000:\\
      \;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
      
      \mathbf{elif}\;y.re \leq 2.8 \cdot 10^{-185}:\\
      \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.im \cdot \log x.re\right)\\
      
      \mathbf{elif}\;y.re \leq 7.5 \cdot 10^{+191}:\\
      \;\;\;\;\left(y.re \cdot \mathsf{fma}\left(-0.16666666666666666, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if y.re < -5.3e5

        1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{\color{blue}{y.re}} \]
        6. Step-by-step derivation
          1. lower-pow.f6431.5

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{y.re} \]
        7. Applied rewrites31.5%

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

        if -5.3e5 < y.re < 2.79999999999999991e-185

        1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto e^{y.re \cdot \log x.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.re, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
          12. lift-atan2.f6432.4

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

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

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

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

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

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

            \[\leadsto e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.im \cdot \log x.re\right) \]
          5. lift-exp.f64N/A

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

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

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

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

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

        if 2.79999999999999991e-185 < y.re < 7.5e191

        1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, {y.re}^{2} \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
            4. unpow2N/A

              \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
            5. lower-*.f64N/A

              \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
            6. lower-pow.f64N/A

              \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
            7. lift-atan2.f64N/A

              \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
            8. lift-atan2.f6420.2

              \[\leadsto \left(y.re \cdot \mathsf{fma}\left(-0.16666666666666666, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
          4. Applied rewrites20.2%

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

          if 7.5e191 < y.re

          1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{\color{blue}{y.re}} \]
          6. Step-by-step derivation
            1. lower-pow.f6431.6

              \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re} \]
          7. Applied rewrites31.6%

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

        Alternative 14: 32.9% accurate, 1.6× speedup?

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

          1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{\color{blue}{y.re}} \]
          6. Step-by-step derivation
            1. lower-pow.f6431.5

              \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{y.re} \]
          7. Applied rewrites31.5%

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

          if -2.1e11 < y.re < 7.5e191

          1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, {y.re}^{2} \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
              4. unpow2N/A

                \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
              5. lower-*.f64N/A

                \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
              6. lower-pow.f64N/A

                \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
              7. lift-atan2.f64N/A

                \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
              8. lift-atan2.f6420.2

                \[\leadsto \left(y.re \cdot \mathsf{fma}\left(-0.16666666666666666, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
            4. Applied rewrites20.2%

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

            if 7.5e191 < y.re

            1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{\color{blue}{y.re}} \]
            6. Step-by-step derivation
              1. lower-pow.f6431.6

                \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re} \]
            7. Applied rewrites31.6%

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

          Alternative 15: 31.9% accurate, 1.6× speedup?

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

            1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{\color{blue}{y.re}} \]
            6. Step-by-step derivation
              1. lower-pow.f6431.6

                \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re} \]
            7. Applied rewrites31.6%

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

            if -2e20 < y.re < 7.5e191

            1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, {y.re}^{2} \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
                4. unpow2N/A

                  \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
                5. lower-*.f64N/A

                  \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
                6. lower-pow.f64N/A

                  \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
                7. lift-atan2.f64N/A

                  \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
                8. lift-atan2.f6420.2

                  \[\leadsto \left(y.re \cdot \mathsf{fma}\left(-0.16666666666666666, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
              4. Applied rewrites20.2%

                \[\leadsto \left(y.re \cdot \mathsf{fma}\left(-0.16666666666666666, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
            7. Recombined 2 regimes into one program.
            8. Add Preprocessing

            Alternative 16: 23.2% accurate, 1.7× speedup?

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

              1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                5. pow2N/A

                  \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                6. pow2N/A

                  \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                7. lift-fma.f64N/A

                  \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                8. lift-*.f64N/A

                  \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                9. lift-sqrt.f64N/A

                  \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                10. lift-atan2.f64N/A

                  \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                11. lift-atan2.f6417.3

                  \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
              7. Applied rewrites17.3%

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

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

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

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

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

                  \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
                5. lift-*.f64N/A

                  \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
                6. lift-sqrt.f64N/A

                  \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
                7. lift-log.f64N/A

                  \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
                8. lift-atan2.f64N/A

                  \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
                9. lift-*.f6414.9

                  \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
              10. Applied rewrites14.9%

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

              if -0.122 < y.im < 3.39999999999999985e-171

              1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, {y.re}^{2} \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
                  4. unpow2N/A

                    \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
                  5. lower-*.f64N/A

                    \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
                  6. lower-pow.f64N/A

                    \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
                  7. lift-atan2.f64N/A

                    \[\leadsto \left(y.re \cdot \mathsf{fma}\left(\frac{-1}{6}, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
                  8. lift-atan2.f6420.2

                    \[\leadsto \left(y.re \cdot \mathsf{fma}\left(-0.16666666666666666, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot 1 \]
                4. Applied rewrites20.2%

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

                if 3.39999999999999985e-171 < y.im

                1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  5. pow2N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  6. pow2N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  7. lift-fma.f64N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  8. lift-*.f64N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  9. lift-sqrt.f64N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  10. lift-atan2.f64N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  11. lift-atan2.f6417.3

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                7. Applied rewrites17.3%

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

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

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

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

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

                    \[\leadsto \left(y.re \cdot y.re\right) \cdot \mathsf{fma}\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \tan^{-1}_* \frac{x.im}{x.re}, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right) \]
                  5. pow2N/A

                    \[\leadsto \left(y.re \cdot y.re\right) \cdot \mathsf{fma}\left(\log \left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), \tan^{-1}_* \frac{x.im}{x.re}, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right) \]
                  6. pow2N/A

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

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

                    \[\leadsto \left(y.re \cdot y.re\right) \cdot \mathsf{fma}\left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right), \tan^{-1}_* \frac{x.im}{x.re}, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right) \]
                  9. lift-*.f64N/A

                    \[\leadsto \left(y.re \cdot y.re\right) \cdot \mathsf{fma}\left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right), \tan^{-1}_* \frac{x.im}{x.re}, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right) \]
                  10. lift-log.f64N/A

                    \[\leadsto \left(y.re \cdot y.re\right) \cdot \mathsf{fma}\left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right), \tan^{-1}_* \frac{x.im}{x.re}, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right) \]
                  11. lift-atan2.f64N/A

                    \[\leadsto \left(y.re \cdot y.re\right) \cdot \mathsf{fma}\left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right), \tan^{-1}_* \frac{x.im}{x.re}, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right) \]
                  12. lower-/.f64N/A

                    \[\leadsto \left(y.re \cdot y.re\right) \cdot \mathsf{fma}\left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right), \tan^{-1}_* \frac{x.im}{x.re}, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right) \]
                  13. lift-atan2.f6417.6

                    \[\leadsto \left(y.re \cdot y.re\right) \cdot \mathsf{fma}\left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right), \tan^{-1}_* \frac{x.im}{x.re}, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right) \]
                10. Applied rewrites17.6%

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

              Alternative 17: 19.6% accurate, 2.0× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -2.5 \cdot 10^{-67}:\\ \;\;\;\;y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{elif}\;y.re \leq 1.52 \cdot 10^{+49}:\\ \;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \end{array} \end{array} \]
              (FPCore (x.re x.im y.re y.im)
               :precision binary64
               (if (<= y.re -2.5e-67)
                 (*
                  y.re
                  (fma
                   y.re
                   (* (log (sqrt (* x.im x.im))) (atan2 x.im x.re))
                   (atan2 x.im x.re)))
                 (if (<= y.re 1.52e+49)
                   (* (sin (* y.re (atan2 x.im x.re))) 1.0)
                   (*
                    (* y.re y.re)
                    (* (log (sqrt (fma x.im x.im (* x.re x.re)))) (atan2 x.im x.re))))))
              double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
              	double tmp;
              	if (y_46_re <= -2.5e-67) {
              		tmp = y_46_re * fma(y_46_re, (log(sqrt((x_46_im * x_46_im))) * atan2(x_46_im, x_46_re)), atan2(x_46_im, x_46_re));
              	} else if (y_46_re <= 1.52e+49) {
              		tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * 1.0;
              	} else {
              		tmp = (y_46_re * y_46_re) * (log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)))) * atan2(x_46_im, x_46_re));
              	}
              	return tmp;
              }
              
              function code(x_46_re, x_46_im, y_46_re, y_46_im)
              	tmp = 0.0
              	if (y_46_re <= -2.5e-67)
              		tmp = Float64(y_46_re * fma(y_46_re, Float64(log(sqrt(Float64(x_46_im * x_46_im))) * atan(x_46_im, x_46_re)), atan(x_46_im, x_46_re)));
              	elseif (y_46_re <= 1.52e+49)
              		tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * 1.0);
              	else
              		tmp = Float64(Float64(y_46_re * y_46_re) * Float64(log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)))) * atan(x_46_im, x_46_re)));
              	end
              	return tmp
              end
              
              code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -2.5e-67], N[(y$46$re * N[(y$46$re * N[(N[Log[N[Sqrt[N[(x$46$im * x$46$im), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.52e+49], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(y$46$re * y$46$re), $MachinePrecision] * N[(N[Log[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;y.re \leq -2.5 \cdot 10^{-67}:\\
              \;\;\;\;y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right)\\
              
              \mathbf{elif}\;y.re \leq 1.52 \cdot 10^{+49}:\\
              \;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot 1\\
              
              \mathbf{else}:\\
              \;\;\;\;\left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if y.re < -2.4999999999999999e-67

                1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  5. pow2N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  6. pow2N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  7. lift-fma.f64N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  8. lift-*.f64N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  9. lift-sqrt.f64N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  10. lift-atan2.f64N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  11. lift-atan2.f6417.3

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                7. Applied rewrites17.3%

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

                  \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                9. Step-by-step derivation
                  1. pow2N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  2. lower-*.f6417.5

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                10. Applied rewrites17.5%

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

                if -2.4999999999999999e-67 < y.re < 1.52e49

                1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if 1.52e49 < y.re

                  1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    5. pow2N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    6. pow2N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    7. lift-fma.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    8. lift-*.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    9. lift-sqrt.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    10. lift-atan2.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    11. lift-atan2.f6417.3

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  7. Applied rewrites17.3%

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

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

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

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

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

                      \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    5. lift-*.f64N/A

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

                      \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    7. lift-fma.f64N/A

                      \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    8. lift-*.f64N/A

                      \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    9. lift-log.f64N/A

                      \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    10. lift-atan2.f64N/A

                      \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    11. lift-*.f6414.0

                      \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  10. Applied rewrites14.0%

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

                Alternative 18: 18.5% accurate, 2.2× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x.re \leq -5 \cdot 10^{-310}:\\ \;\;\;\;y.re \cdot \mathsf{fma}\left(y.re, -1 \cdot \left(\log \left(\frac{-1}{x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{else}:\\ \;\;\;\;y.re \cdot \mathsf{fma}\left(y.re, \log x.re \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \end{array} \end{array} \]
                (FPCore (x.re x.im y.re y.im)
                 :precision binary64
                 (if (<= x.re -5e-310)
                   (*
                    y.re
                    (fma
                     y.re
                     (* -1.0 (* (log (/ -1.0 x.re)) (atan2 x.im x.re)))
                     (atan2 x.im x.re)))
                   (* y.re (fma y.re (* (log x.re) (atan2 x.im x.re)) (atan2 x.im x.re)))))
                double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                	double tmp;
                	if (x_46_re <= -5e-310) {
                		tmp = y_46_re * fma(y_46_re, (-1.0 * (log((-1.0 / x_46_re)) * atan2(x_46_im, x_46_re))), atan2(x_46_im, x_46_re));
                	} else {
                		tmp = y_46_re * fma(y_46_re, (log(x_46_re) * atan2(x_46_im, x_46_re)), atan2(x_46_im, x_46_re));
                	}
                	return tmp;
                }
                
                function code(x_46_re, x_46_im, y_46_re, y_46_im)
                	tmp = 0.0
                	if (x_46_re <= -5e-310)
                		tmp = Float64(y_46_re * fma(y_46_re, Float64(-1.0 * Float64(log(Float64(-1.0 / x_46_re)) * atan(x_46_im, x_46_re))), atan(x_46_im, x_46_re)));
                	else
                		tmp = Float64(y_46_re * fma(y_46_re, Float64(log(x_46_re) * atan(x_46_im, x_46_re)), atan(x_46_im, x_46_re)));
                	end
                	return tmp
                end
                
                code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, -5e-310], N[(y$46$re * N[(y$46$re * N[(-1.0 * N[(N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$46$re * N[(y$46$re * N[(N[Log[x$46$re], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;x.re \leq -5 \cdot 10^{-310}:\\
                \;\;\;\;y.re \cdot \mathsf{fma}\left(y.re, -1 \cdot \left(\log \left(\frac{-1}{x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \tan^{-1}_* \frac{x.im}{x.re}\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;y.re \cdot \mathsf{fma}\left(y.re, \log x.re \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if x.re < -4.999999999999985e-310

                  1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    5. pow2N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    6. pow2N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    7. lift-fma.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    8. lift-*.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    9. lift-sqrt.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    10. lift-atan2.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    11. lift-atan2.f6417.3

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  7. Applied rewrites17.3%

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

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

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

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

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

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, -1 \cdot \left(\log \left(\frac{-1}{x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    5. lift-atan2.f649.4

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, -1 \cdot \left(\log \left(\frac{-1}{x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  10. Applied rewrites9.4%

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

                  if -4.999999999999985e-310 < x.re

                  1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    5. pow2N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    6. pow2N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    7. lift-fma.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    8. lift-*.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    9. lift-sqrt.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    10. lift-atan2.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    11. lift-atan2.f6417.3

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  7. Applied rewrites17.3%

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

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

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log x.re \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    2. lift-log.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log x.re \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    3. lift-atan2.f648.9

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log x.re \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  10. Applied rewrites8.9%

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

                Alternative 19: 18.3% accurate, 2.2× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x.re \leq 0.072:\\ \;\;\;\;y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{else}:\\ \;\;\;\;y.re \cdot \mathsf{fma}\left(y.re, \log x.re \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \end{array} \end{array} \]
                (FPCore (x.re x.im y.re y.im)
                 :precision binary64
                 (if (<= x.re 0.072)
                   (*
                    y.re
                    (fma
                     y.re
                     (* (log (sqrt (* x.im x.im))) (atan2 x.im x.re))
                     (atan2 x.im x.re)))
                   (* y.re (fma y.re (* (log x.re) (atan2 x.im x.re)) (atan2 x.im x.re)))))
                double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                	double tmp;
                	if (x_46_re <= 0.072) {
                		tmp = y_46_re * fma(y_46_re, (log(sqrt((x_46_im * x_46_im))) * atan2(x_46_im, x_46_re)), atan2(x_46_im, x_46_re));
                	} else {
                		tmp = y_46_re * fma(y_46_re, (log(x_46_re) * atan2(x_46_im, x_46_re)), atan2(x_46_im, x_46_re));
                	}
                	return tmp;
                }
                
                function code(x_46_re, x_46_im, y_46_re, y_46_im)
                	tmp = 0.0
                	if (x_46_re <= 0.072)
                		tmp = Float64(y_46_re * fma(y_46_re, Float64(log(sqrt(Float64(x_46_im * x_46_im))) * atan(x_46_im, x_46_re)), atan(x_46_im, x_46_re)));
                	else
                		tmp = Float64(y_46_re * fma(y_46_re, Float64(log(x_46_re) * atan(x_46_im, x_46_re)), atan(x_46_im, x_46_re)));
                	end
                	return tmp
                end
                
                code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, 0.072], N[(y$46$re * N[(y$46$re * N[(N[Log[N[Sqrt[N[(x$46$im * x$46$im), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$46$re * N[(y$46$re * N[(N[Log[x$46$re], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;x.re \leq 0.072:\\
                \;\;\;\;y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;y.re \cdot \mathsf{fma}\left(y.re, \log x.re \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if x.re < 0.0719999999999999946

                  1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    5. pow2N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    6. pow2N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    7. lift-fma.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    8. lift-*.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    9. lift-sqrt.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    10. lift-atan2.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    11. lift-atan2.f6417.3

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  7. Applied rewrites17.3%

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

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  9. Step-by-step derivation
                    1. pow2N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    2. lower-*.f6417.5

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  10. Applied rewrites17.5%

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

                  if 0.0719999999999999946 < x.re

                  1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    5. pow2N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    6. pow2N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    7. lift-fma.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    8. lift-*.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    9. lift-sqrt.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    10. lift-atan2.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    11. lift-atan2.f6417.3

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  7. Applied rewrites17.3%

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

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

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log x.re \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    2. lift-log.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log x.re \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    3. lift-atan2.f648.9

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log x.re \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  10. Applied rewrites8.9%

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

                Alternative 20: 17.2% accurate, 2.4× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x.re \leq 7.5 \cdot 10^{-266}:\\ \;\;\;\;y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y.re \cdot \mathsf{fma}\left(y.re, \log x.re \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \end{array} \end{array} \]
                (FPCore (x.re x.im y.re y.im)
                 :precision binary64
                 (if (<= x.re 7.5e-266)
                   (*
                    y.re
                    (* y.re (* (log (sqrt (fma x.im x.im (* x.re x.re)))) (atan2 x.im x.re))))
                   (* y.re (fma y.re (* (log x.re) (atan2 x.im x.re)) (atan2 x.im x.re)))))
                double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                	double tmp;
                	if (x_46_re <= 7.5e-266) {
                		tmp = y_46_re * (y_46_re * (log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)))) * atan2(x_46_im, x_46_re)));
                	} else {
                		tmp = y_46_re * fma(y_46_re, (log(x_46_re) * atan2(x_46_im, x_46_re)), atan2(x_46_im, x_46_re));
                	}
                	return tmp;
                }
                
                function code(x_46_re, x_46_im, y_46_re, y_46_im)
                	tmp = 0.0
                	if (x_46_re <= 7.5e-266)
                		tmp = Float64(y_46_re * Float64(y_46_re * Float64(log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)))) * atan(x_46_im, x_46_re))));
                	else
                		tmp = Float64(y_46_re * fma(y_46_re, Float64(log(x_46_re) * atan(x_46_im, x_46_re)), atan(x_46_im, x_46_re)));
                	end
                	return tmp
                end
                
                code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, 7.5e-266], N[(y$46$re * N[(y$46$re * N[(N[Log[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$46$re * N[(y$46$re * N[(N[Log[x$46$re], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;x.re \leq 7.5 \cdot 10^{-266}:\\
                \;\;\;\;y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;y.re \cdot \mathsf{fma}\left(y.re, \log x.re \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if x.re < 7.4999999999999995e-266

                  1. Initial program 40.8%

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

                    \[\leadsto \color{blue}{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                  3. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                    2. lower-sin.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
                    3. lower-*.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{{x.im}^{2} + {x.re}^{2}}}\right)}^{y.re} \]
                    4. lift-atan2.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re} \]
                    5. lower-pow.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{\color{blue}{y.re}} \]
                    6. lower-sqrt.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                    7. pow2N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)}^{y.re} \]
                    8. lower-fma.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}\right)}^{y.re} \]
                    9. pow2N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \]
                    10. lift-*.f6444.2

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \]
                  4. Applied rewrites44.2%

                    \[\leadsto \color{blue}{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
                  5. Taylor expanded in y.re around 0

                    \[\leadsto y.re \cdot \color{blue}{\left(y.re \cdot \left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                  6. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right) \]
                    2. lower-fma.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    3. lower-*.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{\color{blue}{x.re}}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    4. lower-log.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    5. pow2N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    6. pow2N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    7. lift-fma.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    8. lift-*.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    9. lift-sqrt.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    10. lift-atan2.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    11. lift-atan2.f6417.3

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  7. Applied rewrites17.3%

                    \[\leadsto y.re \cdot \color{blue}{\mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                  8. Taylor expanded in y.re around inf

                    \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right)\right) \]
                  9. Step-by-step derivation
                    1. pow2N/A

                      \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
                    2. pow2N/A

                      \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
                    3. lower-*.f64N/A

                      \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{\color{blue}{x.re}}\right)\right) \]
                    4. lift-fma.f64N/A

                      \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
                    5. lift-*.f64N/A

                      \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
                    6. lift-sqrt.f64N/A

                      \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
                    7. lift-log.f64N/A

                      \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
                    8. lift-atan2.f64N/A

                      \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
                    9. lift-*.f6414.9

                      \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
                  10. Applied rewrites14.9%

                    \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right)\right) \]

                  if 7.4999999999999995e-266 < x.re

                  1. Initial program 40.8%

                    \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                  2. Taylor expanded in y.im around 0

                    \[\leadsto \color{blue}{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                  3. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                    2. lower-sin.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
                    3. lower-*.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{{x.im}^{2} + {x.re}^{2}}}\right)}^{y.re} \]
                    4. lift-atan2.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re} \]
                    5. lower-pow.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{\color{blue}{y.re}} \]
                    6. lower-sqrt.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                    7. pow2N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)}^{y.re} \]
                    8. lower-fma.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}\right)}^{y.re} \]
                    9. pow2N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \]
                    10. lift-*.f6444.2

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \]
                  4. Applied rewrites44.2%

                    \[\leadsto \color{blue}{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
                  5. Taylor expanded in y.re around 0

                    \[\leadsto y.re \cdot \color{blue}{\left(y.re \cdot \left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                  6. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right) \]
                    2. lower-fma.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    3. lower-*.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{\color{blue}{x.re}}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    4. lower-log.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    5. pow2N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    6. pow2N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    7. lift-fma.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    8. lift-*.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    9. lift-sqrt.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    10. lift-atan2.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    11. lift-atan2.f6417.3

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  7. Applied rewrites17.3%

                    \[\leadsto y.re \cdot \color{blue}{\mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                  8. Taylor expanded in x.im around 0

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log x.re \cdot \tan^{-1}_* \frac{x.im}{\color{blue}{x.re}}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  9. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log x.re \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    2. lift-log.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log x.re \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    3. lift-atan2.f648.9

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log x.re \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  10. Applied rewrites8.9%

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log x.re \cdot \tan^{-1}_* \frac{x.im}{\color{blue}{x.re}}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                3. Recombined 2 regimes into one program.
                4. Add Preprocessing

                Alternative 21: 16.1% accurate, 2.4× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x.im \leq 2.35 \cdot 10^{-255}:\\ \;\;\;\;\left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{else}:\\ \;\;\;\;y.re \cdot \mathsf{fma}\left(y.re, \log x.im \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \end{array} \end{array} \]
                (FPCore (x.re x.im y.re y.im)
                 :precision binary64
                 (if (<= x.im 2.35e-255)
                   (*
                    (* y.re y.re)
                    (* (log (sqrt (fma x.im x.im (* x.re x.re)))) (atan2 x.im x.re)))
                   (* y.re (fma y.re (* (log x.im) (atan2 x.im x.re)) (atan2 x.im x.re)))))
                double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                	double tmp;
                	if (x_46_im <= 2.35e-255) {
                		tmp = (y_46_re * y_46_re) * (log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)))) * atan2(x_46_im, x_46_re));
                	} else {
                		tmp = y_46_re * fma(y_46_re, (log(x_46_im) * atan2(x_46_im, x_46_re)), atan2(x_46_im, x_46_re));
                	}
                	return tmp;
                }
                
                function code(x_46_re, x_46_im, y_46_re, y_46_im)
                	tmp = 0.0
                	if (x_46_im <= 2.35e-255)
                		tmp = Float64(Float64(y_46_re * y_46_re) * Float64(log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)))) * atan(x_46_im, x_46_re)));
                	else
                		tmp = Float64(y_46_re * fma(y_46_re, Float64(log(x_46_im) * atan(x_46_im, x_46_re)), atan(x_46_im, x_46_re)));
                	end
                	return tmp
                end
                
                code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, 2.35e-255], N[(N[(y$46$re * y$46$re), $MachinePrecision] * N[(N[Log[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$46$re * N[(y$46$re * N[(N[Log[x$46$im], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;x.im \leq 2.35 \cdot 10^{-255}:\\
                \;\;\;\;\left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;y.re \cdot \mathsf{fma}\left(y.re, \log x.im \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if x.im < 2.34999999999999985e-255

                  1. Initial program 40.8%

                    \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                  2. Taylor expanded in y.im around 0

                    \[\leadsto \color{blue}{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                  3. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                    2. lower-sin.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
                    3. lower-*.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{{x.im}^{2} + {x.re}^{2}}}\right)}^{y.re} \]
                    4. lift-atan2.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re} \]
                    5. lower-pow.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{\color{blue}{y.re}} \]
                    6. lower-sqrt.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                    7. pow2N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)}^{y.re} \]
                    8. lower-fma.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}\right)}^{y.re} \]
                    9. pow2N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \]
                    10. lift-*.f6444.2

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \]
                  4. Applied rewrites44.2%

                    \[\leadsto \color{blue}{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
                  5. Taylor expanded in y.re around 0

                    \[\leadsto y.re \cdot \color{blue}{\left(y.re \cdot \left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                  6. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right) \]
                    2. lower-fma.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    3. lower-*.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{\color{blue}{x.re}}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    4. lower-log.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    5. pow2N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    6. pow2N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    7. lift-fma.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    8. lift-*.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    9. lift-sqrt.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    10. lift-atan2.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    11. lift-atan2.f6417.3

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  7. Applied rewrites17.3%

                    \[\leadsto y.re \cdot \color{blue}{\mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                  8. Taylor expanded in y.re around inf

                    \[\leadsto {y.re}^{2} \cdot \left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right) \]
                  9. Step-by-step derivation
                    1. pow2N/A

                      \[\leadsto {y.re}^{2} \cdot \left(\log \left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    2. pow2N/A

                      \[\leadsto {y.re}^{2} \cdot \left(\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    3. lower-*.f64N/A

                      \[\leadsto {y.re}^{2} \cdot \left(\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{\color{blue}{x.re}}\right) \]
                    4. pow2N/A

                      \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    5. lift-*.f64N/A

                      \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    6. lower-sqrt.f64N/A

                      \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    7. lift-fma.f64N/A

                      \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    8. lift-*.f64N/A

                      \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    9. lift-log.f64N/A

                      \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    10. lift-atan2.f64N/A

                      \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    11. lift-*.f6414.0

                      \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  10. Applied rewrites14.0%

                    \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right) \]

                  if 2.34999999999999985e-255 < x.im

                  1. Initial program 40.8%

                    \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                  2. Taylor expanded in y.im around 0

                    \[\leadsto \color{blue}{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                  3. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                    2. lower-sin.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
                    3. lower-*.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{{x.im}^{2} + {x.re}^{2}}}\right)}^{y.re} \]
                    4. lift-atan2.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re} \]
                    5. lower-pow.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{\color{blue}{y.re}} \]
                    6. lower-sqrt.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                    7. pow2N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)}^{y.re} \]
                    8. lower-fma.f64N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}\right)}^{y.re} \]
                    9. pow2N/A

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \]
                    10. lift-*.f6444.2

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \]
                  4. Applied rewrites44.2%

                    \[\leadsto \color{blue}{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
                  5. Taylor expanded in y.re around 0

                    \[\leadsto y.re \cdot \color{blue}{\left(y.re \cdot \left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                  6. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right) \]
                    2. lower-fma.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    3. lower-*.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{\color{blue}{x.re}}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    4. lower-log.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    5. pow2N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    6. pow2N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    7. lift-fma.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    8. lift-*.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    9. lift-sqrt.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    10. lift-atan2.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    11. lift-atan2.f6417.3

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  7. Applied rewrites17.3%

                    \[\leadsto y.re \cdot \color{blue}{\mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                  8. Taylor expanded in x.re around 0

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log x.im \cdot \tan^{-1}_* \frac{x.im}{\color{blue}{x.re}}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  9. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log x.im \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    2. lift-log.f64N/A

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log x.im \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                    3. lift-atan2.f649.3

                      \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log x.im \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  10. Applied rewrites9.3%

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log x.im \cdot \tan^{-1}_* \frac{x.im}{\color{blue}{x.re}}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                3. Recombined 2 regimes into one program.
                4. Add Preprocessing

                Alternative 22: 14.0% accurate, 3.1× speedup?

                \[\begin{array}{l} \\ \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \end{array} \]
                (FPCore (x.re x.im y.re y.im)
                 :precision binary64
                 (*
                  (* y.re y.re)
                  (* (log (sqrt (fma x.im x.im (* x.re x.re)))) (atan2 x.im x.re))))
                double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                	return (y_46_re * y_46_re) * (log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)))) * atan2(x_46_im, x_46_re));
                }
                
                function code(x_46_re, x_46_im, y_46_re, y_46_im)
                	return Float64(Float64(y_46_re * y_46_re) * Float64(log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)))) * atan(x_46_im, x_46_re)))
                end
                
                code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(y$46$re * y$46$re), $MachinePrecision] * N[(N[Log[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)
                \end{array}
                
                Derivation
                1. Initial program 40.8%

                  \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                2. Taylor expanded in y.im around 0

                  \[\leadsto \color{blue}{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                3. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
                  2. lower-sin.f64N/A

                    \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \]
                  3. lower-*.f64N/A

                    \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{{x.im}^{2} + {x.re}^{2}}}\right)}^{y.re} \]
                  4. lift-atan2.f64N/A

                    \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re} \]
                  5. lower-pow.f64N/A

                    \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{\color{blue}{y.re}} \]
                  6. lower-sqrt.f64N/A

                    \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re} \]
                  7. pow2N/A

                    \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)}^{y.re} \]
                  8. lower-fma.f64N/A

                    \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}\right)}^{y.re} \]
                  9. pow2N/A

                    \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \]
                  10. lift-*.f6444.2

                    \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \]
                4. Applied rewrites44.2%

                  \[\leadsto \color{blue}{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \]
                5. Taylor expanded in y.re around 0

                  \[\leadsto y.re \cdot \color{blue}{\left(y.re \cdot \left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                6. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto y.re \cdot \left(y.re \cdot \left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right) \]
                  2. lower-fma.f64N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  3. lower-*.f64N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{\color{blue}{x.re}}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  4. lower-log.f64N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  5. pow2N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  6. pow2N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  7. lift-fma.f64N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  8. lift-*.f64N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  9. lift-sqrt.f64N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  10. lift-atan2.f64N/A

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  11. lift-atan2.f6417.3

                    \[\leadsto y.re \cdot \mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                7. Applied rewrites17.3%

                  \[\leadsto y.re \cdot \color{blue}{\mathsf{fma}\left(y.re, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
                8. Taylor expanded in y.re around inf

                  \[\leadsto {y.re}^{2} \cdot \left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right) \]
                9. Step-by-step derivation
                  1. pow2N/A

                    \[\leadsto {y.re}^{2} \cdot \left(\log \left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  2. pow2N/A

                    \[\leadsto {y.re}^{2} \cdot \left(\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  3. lower-*.f64N/A

                    \[\leadsto {y.re}^{2} \cdot \left(\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{\color{blue}{x.re}}\right) \]
                  4. pow2N/A

                    \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  5. lift-*.f64N/A

                    \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  6. lower-sqrt.f64N/A

                    \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  7. lift-fma.f64N/A

                    \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  8. lift-*.f64N/A

                    \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  9. lift-log.f64N/A

                    \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  10. lift-atan2.f64N/A

                    \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                  11. lift-*.f6414.0

                    \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
                10. Applied rewrites14.0%

                  \[\leadsto \left(y.re \cdot y.re\right) \cdot \left(\log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right) \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right) \]
                11. Add Preprocessing

                Reproduce

                ?
                herbie shell --seed 2025127 
                (FPCore (x.re x.im y.re y.im)
                  :name "powComplex, imaginary part"
                  :precision binary64
                  (* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))