powComplex, imaginary part

Percentage Accurate: 39.8% → 66.0%
Time: 19.5s
Alternatives: 16
Speedup: 2.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)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
    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}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 16 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: 39.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)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
    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: 66.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \log \left(\frac{-1}{x.re}\right)\\ \mathbf{if}\;x.re \leq -5 \cdot 10^{-309}:\\ \;\;\;\;e^{-\mathsf{fma}\left(y.re, t\_1, t\_0\right)} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, t\_1 \cdot \left(-y.im\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log x.re - t\_0} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.re, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (* y.im (atan2 x.im x.re))) (t_1 (log (/ -1.0 x.re))))
   (if (<= x.re -5e-309)
     (*
      (exp (- (fma y.re t_1 t_0)))
      (sin (fma y.re (atan2 x.im x.re) (* t_1 (- y.im)))))
     (*
      (exp (- (* y.re (log x.re)) t_0))
      (sin (fma y.im (log x.re) (* y.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 t_0 = y_46_im * atan2(x_46_im, x_46_re);
	double t_1 = log((-1.0 / x_46_re));
	double tmp;
	if (x_46_re <= -5e-309) {
		tmp = exp(-fma(y_46_re, t_1, t_0)) * sin(fma(y_46_re, atan2(x_46_im, x_46_re), (t_1 * -y_46_im)));
	} else {
		tmp = exp(((y_46_re * log(x_46_re)) - t_0)) * sin(fma(y_46_im, log(x_46_re), (y_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)
	t_0 = Float64(y_46_im * atan(x_46_im, x_46_re))
	t_1 = log(Float64(-1.0 / x_46_re))
	tmp = 0.0
	if (x_46_re <= -5e-309)
		tmp = Float64(exp(Float64(-fma(y_46_re, t_1, t_0))) * sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(t_1 * Float64(-y_46_im)))));
	else
		tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0)) * sin(fma(y_46_im, log(x_46_re), Float64(y_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_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -5e-309], N[(N[Exp[(-N[(y$46$re * t$95$1 + t$95$0), $MachinePrecision])], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(t$95$1 * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision] + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

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


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

    1. Initial program 43.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999995e-309 < x.re

    1. Initial program 35.5%

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

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

        \[\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. lower--.f64N/A

        \[\leadsto e^{\color{blue}{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) \]
      4. lower-*.f64N/A

        \[\leadsto e^{\color{blue}{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) \]
      5. lower-log.f64N/A

        \[\leadsto e^{y.re \cdot \color{blue}{\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 - \color{blue}{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) \]
      7. lower-atan2.f64N/A

        \[\leadsto e^{y.re \cdot \log x.re - y.im \cdot \color{blue}{\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 \color{blue}{\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 \color{blue}{\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, \color{blue}{\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, \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right) \]
      12. lower-atan2.f6468.6

        \[\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 \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right)\right) \]
    5. Applied rewrites68.6%

      \[\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)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 55.2% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_6 \leq \infty:\\
\;\;\;\;t\_5 \cdot {t\_2}^{y.re}\\

\mathbf{else}:\\
\;\;\;\;e^{-t\_0} \cdot \sin t\_4\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 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)))) < -0.0

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

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

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

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

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

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

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

    if -0.0 < (*.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)))) < +inf.0

    1. Initial program 72.2%

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

      \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \cdot \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. lower-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \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. lower-sqrt.f64N/A

        \[\leadsto {\color{blue}{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}}^{y.re} \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. unpow2N/A

        \[\leadsto {\left(\sqrt{\color{blue}{x.im \cdot x.im} + {x.re}^{2}}\right)}^{y.re} \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. lower-fma.f64N/A

        \[\leadsto {\left(\sqrt{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \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. unpow2N/A

        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \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) \]
      6. lower-*.f6467.8

        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \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. Applied rewrites67.8%

      \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}} \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) \]

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

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

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

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

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

        \[\leadsto e^{\color{blue}{\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^{\color{blue}{\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) \]
      3. lower-*.f64N/A

        \[\leadsto e^{\mathsf{neg}\left(\color{blue}{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) \]
      4. lower-atan2.f6447.3

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

      \[\leadsto e^{\color{blue}{-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 3 regimes into one program.
  4. Final simplification62.8%

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

Alternative 3: 62.8% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x.im < -1.9999999999999998e-308

    1. Initial program 36.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. Add Preprocessing
    3. Taylor expanded in x.im around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999998e-308 < x.im

    1. Initial program 41.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. Add Preprocessing
    3. 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)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\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. lower--.f64N/A

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

        \[\leadsto e^{\color{blue}{\log x.im \cdot y.re} - 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) \]
      5. lower-*.f64N/A

        \[\leadsto e^{\color{blue}{\log x.im \cdot y.re} - 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-log.f64N/A

        \[\leadsto e^{\color{blue}{\log x.im} \cdot y.re - 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) \]
      7. lower-*.f64N/A

        \[\leadsto e^{\log x.im \cdot y.re - \color{blue}{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-atan2.f64N/A

        \[\leadsto e^{\log x.im \cdot y.re - y.im \cdot \color{blue}{\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-sin.f64N/A

        \[\leadsto e^{\log x.im \cdot y.re - 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)} \]
      10. lower-fma.f64N/A

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

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

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

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

      \[\leadsto \color{blue}{e^{\log x.im \cdot y.re - 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 2 regimes into one program.
  4. Final simplification65.2%

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

Alternative 4: 59.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{if}\;x.re \leq -2.3 \cdot 10^{-104}:\\ \;\;\;\;e^{-t\_1} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, \log \left(\frac{-1}{x.re}\right) \cdot \left(-y.im\right)\right)\right)\\ \mathbf{elif}\;x.re \leq 2.8 \cdot 10^{-275}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_1} \cdot \sin t\_0\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log x.re - t\_1} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.re, 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 (* y.im (atan2 x.im x.re))))
   (if (<= x.re -2.3e-104)
     (*
      (exp (- t_1))
      (sin (fma y.re (atan2 x.im x.re) (* (log (/ -1.0 x.re)) (- y.im)))))
     (if (<= x.re 2.8e-275)
       (*
        (exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1))
        (sin t_0))
       (*
        (exp (- (* y.re (log x.re)) t_1))
        (sin (fma y.im (log x.re) 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 = y_46_im * atan2(x_46_im, x_46_re);
	double tmp;
	if (x_46_re <= -2.3e-104) {
		tmp = exp(-t_1) * sin(fma(y_46_re, atan2(x_46_im, x_46_re), (log((-1.0 / x_46_re)) * -y_46_im)));
	} else if (x_46_re <= 2.8e-275) {
		tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) * sin(t_0);
	} else {
		tmp = exp(((y_46_re * log(x_46_re)) - t_1)) * sin(fma(y_46_im, log(x_46_re), 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 = Float64(y_46_im * atan(x_46_im, x_46_re))
	tmp = 0.0
	if (x_46_re <= -2.3e-104)
		tmp = Float64(exp(Float64(-t_1)) * sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(log(Float64(-1.0 / x_46_re)) * Float64(-y_46_im)))));
	elseif (x_46_re <= 2.8e-275)
		tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_1)) * sin(t_0));
	else
		tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_re)) - t_1)) * sin(fma(y_46_im, log(x_46_re), t_0)));
	end
	return tmp
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -2.3e-104], N[(N[Exp[(-t$95$1)], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 2.8e-275], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $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 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq -2.3 \cdot 10^{-104}:\\
\;\;\;\;e^{-t\_1} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, \log \left(\frac{-1}{x.re}\right) \cdot \left(-y.im\right)\right)\right)\\

\mathbf{elif}\;x.re \leq 2.8 \cdot 10^{-275}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_1} \cdot \sin t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x.re < -2.2999999999999999e-104

    1. Initial program 35.5%

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

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

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

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

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

        \[\leadsto e^{\color{blue}{\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^{\color{blue}{\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) \]
      3. lower-*.f64N/A

        \[\leadsto e^{\mathsf{neg}\left(\color{blue}{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) \]
      4. lower-atan2.f6449.7

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.2999999999999999e-104 < x.re < 2.79999999999999994e-275

    1. Initial program 54.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 \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. Add Preprocessing
    3. Taylor expanded in y.im around 0

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

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

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

    if 2.79999999999999994e-275 < x.re

    1. Initial program 36.2%

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

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

        \[\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. lower--.f64N/A

        \[\leadsto e^{\color{blue}{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) \]
      4. lower-*.f64N/A

        \[\leadsto e^{\color{blue}{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) \]
      5. lower-log.f64N/A

        \[\leadsto e^{y.re \cdot \color{blue}{\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 - \color{blue}{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) \]
      7. lower-atan2.f64N/A

        \[\leadsto e^{y.re \cdot \log x.re - y.im \cdot \color{blue}{\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 \color{blue}{\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 \color{blue}{\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, \color{blue}{\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, \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right) \]
      12. lower-atan2.f6469.0

        \[\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 \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right)\right) \]
    5. Applied rewrites69.0%

      \[\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)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification66.4%

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

Alternative 5: 60.2% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;y.re \leq 0.0076:\\
\;\;\;\;e^{-t\_0} \cdot t\_1\\

\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot t\_1\\


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

    1. Initial program 32.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(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y.im around 0

      \[\leadsto \color{blue}{\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}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\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. lower-*.f64N/A

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

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

        \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
      9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
      10. lower-*.f6484.0

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

      \[\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.48999999999999999 < y.re < 0.00759999999999999998

    1. Initial program 40.9%

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

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

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

        \[\leadsto e^{\color{blue}{\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^{\color{blue}{\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) \]
      3. lower-*.f64N/A

        \[\leadsto e^{\mathsf{neg}\left(\color{blue}{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) \]
      4. lower-atan2.f6455.1

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

      \[\leadsto e^{\color{blue}{-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 0.00759999999999999998 < y.re

    1. Initial program 41.5%

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

      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
    4. 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 \sin \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
      2. lower-atan2.f6458.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 \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right) \]
    5. Applied rewrites58.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 \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification61.4%

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

Alternative 6: 58.6% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_2 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\ t_3 := \sin t\_0\\ \mathbf{if}\;y.re \leq -0.49:\\ \;\;\;\;t\_2 \cdot t\_3\\ \mathbf{elif}\;y.re \leq 0.066:\\ \;\;\;\;e^{-t\_1} \cdot t\_3\\ \mathbf{elif}\;y.re \leq 7 \cdot 10^{+100}:\\ \;\;\;\;t\_3 \cdot e^{y.re \cdot \log \left(\sqrt{x.im \cdot x.im}\right) - t\_1}\\ \mathbf{else}:\\ \;\;\;\;t\_2 \cdot \sin \left(-t\_0\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 (* y.im (atan2 x.im x.re)))
        (t_2 (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))
        (t_3 (sin t_0)))
   (if (<= y.re -0.49)
     (* t_2 t_3)
     (if (<= y.re 0.066)
       (* (exp (- t_1)) t_3)
       (if (<= y.re 7e+100)
         (* t_3 (exp (- (* y.re (log (sqrt (* x.im x.im)))) t_1)))
         (* t_2 (sin (- 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 = y_46_im * atan2(x_46_im, x_46_re);
	double t_2 = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
	double t_3 = sin(t_0);
	double tmp;
	if (y_46_re <= -0.49) {
		tmp = t_2 * t_3;
	} else if (y_46_re <= 0.066) {
		tmp = exp(-t_1) * t_3;
	} else if (y_46_re <= 7e+100) {
		tmp = t_3 * exp(((y_46_re * log(sqrt((x_46_im * x_46_im)))) - t_1));
	} else {
		tmp = t_2 * sin(-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 = Float64(y_46_im * atan(x_46_im, x_46_re))
	t_2 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re
	t_3 = sin(t_0)
	tmp = 0.0
	if (y_46_re <= -0.49)
		tmp = Float64(t_2 * t_3);
	elseif (y_46_re <= 0.066)
		tmp = Float64(exp(Float64(-t_1)) * t_3);
	elseif (y_46_re <= 7e+100)
		tmp = Float64(t_3 * exp(Float64(Float64(y_46_re * log(sqrt(Float64(x_46_im * x_46_im)))) - t_1)));
	else
		tmp = Float64(t_2 * sin(Float64(-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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[y$46$re, -0.49], N[(t$95$2 * t$95$3), $MachinePrecision], If[LessEqual[y$46$re, 0.066], N[(N[Exp[(-t$95$1)], $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[y$46$re, 7e+100], N[(t$95$3 * N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(x$46$im * x$46$im), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sin[(-t$95$0)], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y.re \leq 0.066:\\
\;\;\;\;e^{-t\_1} \cdot t\_3\\

\mathbf{elif}\;y.re \leq 7 \cdot 10^{+100}:\\
\;\;\;\;t\_3 \cdot e^{y.re \cdot \log \left(\sqrt{x.im \cdot x.im}\right) - t\_1}\\

\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \sin \left(-t\_0\right)\\


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

    1. Initial program 32.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(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y.im around 0

      \[\leadsto \color{blue}{\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}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\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. lower-*.f64N/A

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

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

        \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
      9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
      10. lower-*.f6484.0

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

      \[\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.48999999999999999 < y.re < 0.066000000000000003

    1. Initial program 40.9%

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

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

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

        \[\leadsto e^{\color{blue}{\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^{\color{blue}{\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) \]
      3. lower-*.f64N/A

        \[\leadsto e^{\mathsf{neg}\left(\color{blue}{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) \]
      4. lower-atan2.f6455.1

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

      \[\leadsto e^{\color{blue}{-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 0.066000000000000003 < y.re < 6.99999999999999953e100

    1. Initial program 45.5%

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

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

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

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

      \[\leadsto e^{\log \left(\sqrt{\color{blue}{{x.im}^{2}}}\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) \]
    7. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto e^{\log \left(\sqrt{\color{blue}{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-*.f6464.1

        \[\leadsto e^{\log \left(\sqrt{\color{blue}{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) \]
    8. Applied rewrites64.1%

      \[\leadsto e^{\log \left(\sqrt{\color{blue}{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) \]

    if 6.99999999999999953e100 < y.re

    1. Initial program 38.7%

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

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

        \[\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. lower-*.f64N/A

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

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

        \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
      9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
      10. lower-*.f6451.8

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

      \[\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}} \]
    6. Step-by-step derivation
      1. Applied rewrites25.9%

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

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

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

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

      Alternative 7: 57.8% accurate, 1.2× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\ t_2 := \sin t\_0\\ \mathbf{if}\;y.re \leq -0.49:\\ \;\;\;\;t\_1 \cdot t\_2\\ \mathbf{elif}\;y.re \leq 1600000000:\\ \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_2\\ \mathbf{elif}\;y.re \leq 7.6 \cdot 10^{+95}:\\ \;\;\;\;t\_1 \cdot \sin \left({\left({t\_0}^{2}\right)}^{0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \sin \left(-t\_0\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 (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))
              (t_2 (sin t_0)))
         (if (<= y.re -0.49)
           (* t_1 t_2)
           (if (<= y.re 1600000000.0)
             (* (exp (- (* y.im (atan2 x.im x.re)))) t_2)
             (if (<= y.re 7.6e+95)
               (* t_1 (sin (pow (pow t_0 2.0) 0.5)))
               (* t_1 (sin (- 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 = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
      	double t_2 = sin(t_0);
      	double tmp;
      	if (y_46_re <= -0.49) {
      		tmp = t_1 * t_2;
      	} else if (y_46_re <= 1600000000.0) {
      		tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * t_2;
      	} else if (y_46_re <= 7.6e+95) {
      		tmp = t_1 * sin(pow(pow(t_0, 2.0), 0.5));
      	} else {
      		tmp = t_1 * sin(-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 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re
      	t_2 = sin(t_0)
      	tmp = 0.0
      	if (y_46_re <= -0.49)
      		tmp = Float64(t_1 * t_2);
      	elseif (y_46_re <= 1600000000.0)
      		tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * t_2);
      	elseif (y_46_re <= 7.6e+95)
      		tmp = Float64(t_1 * sin(((t_0 ^ 2.0) ^ 0.5)));
      	else
      		tmp = Float64(t_1 * sin(Float64(-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[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[y$46$re, -0.49], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 1600000000.0], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 7.6e+95], N[(t$95$1 * N[Sin[N[Power[N[Power[t$95$0, 2.0], $MachinePrecision], 0.5], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[(-t$95$0)], $MachinePrecision]), $MachinePrecision]]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
      t_1 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
      t_2 := \sin t\_0\\
      \mathbf{if}\;y.re \leq -0.49:\\
      \;\;\;\;t\_1 \cdot t\_2\\
      
      \mathbf{elif}\;y.re \leq 1600000000:\\
      \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_2\\
      
      \mathbf{elif}\;y.re \leq 7.6 \cdot 10^{+95}:\\
      \;\;\;\;t\_1 \cdot \sin \left({\left({t\_0}^{2}\right)}^{0.5}\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1 \cdot \sin \left(-t\_0\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if y.re < -0.48999999999999999

        1. Initial program 32.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(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
        2. Add Preprocessing
        3. Taylor expanded in y.im around 0

          \[\leadsto \color{blue}{\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}} \]
        4. Step-by-step derivation
          1. lower-*.f64N/A

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

            \[\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. lower-*.f64N/A

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

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

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
          9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
          10. lower-*.f6484.0

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

          \[\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.48999999999999999 < y.re < 1.6e9

        1. Initial program 40.6%

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

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

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

            \[\leadsto e^{\color{blue}{\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^{\color{blue}{\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) \]
          3. lower-*.f64N/A

            \[\leadsto e^{\mathsf{neg}\left(\color{blue}{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) \]
          4. lower-atan2.f6454.7

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

          \[\leadsto e^{\color{blue}{-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.6e9 < y.re < 7.5999999999999999e95

        1. Initial program 50.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(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
        2. Add Preprocessing
        3. Taylor expanded in y.im around 0

          \[\leadsto \color{blue}{\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}} \]
        4. Step-by-step derivation
          1. lower-*.f64N/A

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

            \[\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. lower-*.f64N/A

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

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

            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
          9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
          10. lower-*.f6455.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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
        5. Applied rewrites55.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}} \]
        6. Step-by-step derivation
          1. Applied rewrites65.2%

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

          if 7.5999999999999999e95 < y.re

          1. Initial program 37.5%

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

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

              \[\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. lower-*.f64N/A

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

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

              \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
            9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
            10. lower-*.f6450.1

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

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

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

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

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

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

            Alternative 8: 57.6% accurate, 1.6× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\ t_2 := \sin t\_0\\ \mathbf{if}\;y.re \leq -0.49:\\ \;\;\;\;t\_1 \cdot t\_2\\ \mathbf{elif}\;y.re \leq 6 \cdot 10^{+67}:\\ \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \sin \left(-t\_0\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 (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))
                    (t_2 (sin t_0)))
               (if (<= y.re -0.49)
                 (* t_1 t_2)
                 (if (<= y.re 6e+67)
                   (* (exp (- (* y.im (atan2 x.im x.re)))) t_2)
                   (* t_1 (sin (- 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 = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
            	double t_2 = sin(t_0);
            	double tmp;
            	if (y_46_re <= -0.49) {
            		tmp = t_1 * t_2;
            	} else if (y_46_re <= 6e+67) {
            		tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * t_2;
            	} else {
            		tmp = t_1 * sin(-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 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re
            	t_2 = sin(t_0)
            	tmp = 0.0
            	if (y_46_re <= -0.49)
            		tmp = Float64(t_1 * t_2);
            	elseif (y_46_re <= 6e+67)
            		tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * t_2);
            	else
            		tmp = Float64(t_1 * sin(Float64(-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[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[y$46$re, -0.49], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 6e+67], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * t$95$2), $MachinePrecision], N[(t$95$1 * N[Sin[(-t$95$0)], $MachinePrecision]), $MachinePrecision]]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
            t_1 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
            t_2 := \sin t\_0\\
            \mathbf{if}\;y.re \leq -0.49:\\
            \;\;\;\;t\_1 \cdot t\_2\\
            
            \mathbf{elif}\;y.re \leq 6 \cdot 10^{+67}:\\
            \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_2\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1 \cdot \sin \left(-t\_0\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if y.re < -0.48999999999999999

              1. Initial program 32.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(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
              2. Add Preprocessing
              3. Taylor expanded in y.im around 0

                \[\leadsto \color{blue}{\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}} \]
              4. Step-by-step derivation
                1. lower-*.f64N/A

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

                  \[\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. lower-*.f64N/A

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

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

                  \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                10. lower-*.f6484.0

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

                \[\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.48999999999999999 < y.re < 6.0000000000000002e67

              1. Initial program 41.1%

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

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

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

                  \[\leadsto e^{\color{blue}{\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^{\color{blue}{\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) \]
                3. lower-*.f64N/A

                  \[\leadsto e^{\mathsf{neg}\left(\color{blue}{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) \]
                4. lower-atan2.f6452.4

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

                \[\leadsto e^{\color{blue}{-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 6.0000000000000002e67 < y.re

              1. Initial program 41.0%

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

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

                  \[\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. lower-*.f64N/A

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

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

                  \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                10. lower-*.f6454.0

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

                \[\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}} \]
              6. Step-by-step derivation
                1. Applied rewrites36.0%

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

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

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

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

                Alternative 9: 42.4% accurate, 1.9× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \sin t\_0\\ \mathbf{if}\;y.re \leq -225000000:\\ \;\;\;\;t\_1 \cdot {\left(x.im + \frac{\left(x.re \cdot x.re\right) \cdot 0.5}{x.im}\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-32}:\\ \;\;\;\;{\left({t\_0}^{4}\right)}^{0.25}\\ \mathbf{elif}\;y.re \leq 1.75 \cdot 10^{+69}:\\ \;\;\;\;t\_1 \cdot {\left(-x.im\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot \sin \left(-t\_0\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)))
                   (if (<= y.re -225000000.0)
                     (* t_1 (pow (+ x.im (/ (* (* x.re x.re) 0.5) x.im)) y.re))
                     (if (<= y.re 4.3e-32)
                       (pow (pow t_0 4.0) 0.25)
                       (if (<= y.re 1.75e+69)
                         (* t_1 (pow (- x.im) y.re))
                         (* (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re) (sin (- 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 tmp;
                	if (y_46_re <= -225000000.0) {
                		tmp = t_1 * pow((x_46_im + (((x_46_re * x_46_re) * 0.5) / x_46_im)), y_46_re);
                	} else if (y_46_re <= 4.3e-32) {
                		tmp = pow(pow(t_0, 4.0), 0.25);
                	} else if (y_46_re <= 1.75e+69) {
                		tmp = t_1 * pow(-x_46_im, y_46_re);
                	} else {
                		tmp = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re) * sin(-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)
                	tmp = 0.0
                	if (y_46_re <= -225000000.0)
                		tmp = Float64(t_1 * (Float64(x_46_im + Float64(Float64(Float64(x_46_re * x_46_re) * 0.5) / x_46_im)) ^ y_46_re));
                	elseif (y_46_re <= 4.3e-32)
                		tmp = (t_0 ^ 4.0) ^ 0.25;
                	elseif (y_46_re <= 1.75e+69)
                		tmp = Float64(t_1 * (Float64(-x_46_im) ^ y_46_re));
                	else
                		tmp = Float64((sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re) * sin(Float64(-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]}, If[LessEqual[y$46$re, -225000000.0], N[(t$95$1 * N[Power[N[(x$46$im + N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] * 0.5), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4.3e-32], N[Power[N[Power[t$95$0, 4.0], $MachinePrecision], 0.25], $MachinePrecision], If[LessEqual[y$46$re, 1.75e+69], N[(t$95$1 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], N[(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] * N[Sin[(-t$95$0)], $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\\
                \mathbf{if}\;y.re \leq -225000000:\\
                \;\;\;\;t\_1 \cdot {\left(x.im + \frac{\left(x.re \cdot x.re\right) \cdot 0.5}{x.im}\right)}^{y.re}\\
                
                \mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-32}:\\
                \;\;\;\;{\left({t\_0}^{4}\right)}^{0.25}\\
                
                \mathbf{elif}\;y.re \leq 1.75 \cdot 10^{+69}:\\
                \;\;\;\;t\_1 \cdot {\left(-x.im\right)}^{y.re}\\
                
                \mathbf{else}:\\
                \;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot \sin \left(-t\_0\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 4 regimes
                2. if y.re < -2.25e8

                  1. Initial program 30.6%

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

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

                      \[\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. lower-*.f64N/A

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

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

                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                    9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                    10. lower-*.f6483.7

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

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

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

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

                    if -2.25e8 < y.re < 4.2999999999999999e-32

                    1. Initial program 41.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. Add Preprocessing
                    3. 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}} \]
                    4. Step-by-step derivation
                      1. lower-*.f64N/A

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

                        \[\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. lower-*.f64N/A

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

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

                        \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                      9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                      10. lower-*.f6418.7

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

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

                      \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                    7. Step-by-step derivation
                      1. Applied rewrites24.8%

                        \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                      2. Step-by-step derivation
                        1. Applied rewrites30.7%

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

                        if 4.2999999999999999e-32 < y.re < 1.74999999999999994e69

                        1. Initial program 39.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 \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. Add Preprocessing
                        3. 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}} \]
                        4. Step-by-step derivation
                          1. lower-*.f64N/A

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

                            \[\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. lower-*.f64N/A

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

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

                            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                          9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                          10. lower-*.f6435.8

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

                          \[\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}} \]
                        6. Taylor expanded in x.im around -inf

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

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

                          if 1.74999999999999994e69 < y.re

                          1. Initial program 41.0%

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

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

                              \[\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. lower-*.f64N/A

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

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

                              \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                            9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                            10. lower-*.f6454.0

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

                            \[\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}} \]
                          6. Step-by-step derivation
                            1. Applied rewrites36.0%

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

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

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

                              \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -225000000:\\ \;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(x.im + \frac{\left(x.re \cdot x.re\right) \cdot 0.5}{x.im}\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-32}:\\ \;\;\;\;{\left({\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{4}\right)}^{0.25}\\ \mathbf{elif}\;y.re \leq 1.75 \cdot 10^{+69}:\\ \;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(-x.im\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot \sin \left(-y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \end{array} \]
                            6. Add Preprocessing

                            Alternative 10: 43.3% accurate, 1.9× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\ t_2 := \sin t\_0\\ \mathbf{if}\;y.re \leq -225000000:\\ \;\;\;\;t\_1 \cdot t\_2\\ \mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-32}:\\ \;\;\;\;{\left({t\_0}^{4}\right)}^{0.25}\\ \mathbf{elif}\;y.re \leq 1.75 \cdot 10^{+69}:\\ \;\;\;\;t\_2 \cdot {\left(-x.im\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \sin \left(-t\_0\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 (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))
                                    (t_2 (sin t_0)))
                               (if (<= y.re -225000000.0)
                                 (* t_1 t_2)
                                 (if (<= y.re 4.3e-32)
                                   (pow (pow t_0 4.0) 0.25)
                                   (if (<= y.re 1.75e+69)
                                     (* t_2 (pow (- x.im) y.re))
                                     (* t_1 (sin (- 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 = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
                            	double t_2 = sin(t_0);
                            	double tmp;
                            	if (y_46_re <= -225000000.0) {
                            		tmp = t_1 * t_2;
                            	} else if (y_46_re <= 4.3e-32) {
                            		tmp = pow(pow(t_0, 4.0), 0.25);
                            	} else if (y_46_re <= 1.75e+69) {
                            		tmp = t_2 * pow(-x_46_im, y_46_re);
                            	} else {
                            		tmp = t_1 * sin(-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 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re
                            	t_2 = sin(t_0)
                            	tmp = 0.0
                            	if (y_46_re <= -225000000.0)
                            		tmp = Float64(t_1 * t_2);
                            	elseif (y_46_re <= 4.3e-32)
                            		tmp = (t_0 ^ 4.0) ^ 0.25;
                            	elseif (y_46_re <= 1.75e+69)
                            		tmp = Float64(t_2 * (Float64(-x_46_im) ^ y_46_re));
                            	else
                            		tmp = Float64(t_1 * sin(Float64(-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[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[y$46$re, -225000000.0], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 4.3e-32], N[Power[N[Power[t$95$0, 4.0], $MachinePrecision], 0.25], $MachinePrecision], If[LessEqual[y$46$re, 1.75e+69], N[(t$95$2 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[(-t$95$0)], $MachinePrecision]), $MachinePrecision]]]]]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
                            t_1 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
                            t_2 := \sin t\_0\\
                            \mathbf{if}\;y.re \leq -225000000:\\
                            \;\;\;\;t\_1 \cdot t\_2\\
                            
                            \mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-32}:\\
                            \;\;\;\;{\left({t\_0}^{4}\right)}^{0.25}\\
                            
                            \mathbf{elif}\;y.re \leq 1.75 \cdot 10^{+69}:\\
                            \;\;\;\;t\_2 \cdot {\left(-x.im\right)}^{y.re}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;t\_1 \cdot \sin \left(-t\_0\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 4 regimes
                            2. if y.re < -2.25e8

                              1. Initial program 30.6%

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

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

                                  \[\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. lower-*.f64N/A

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

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

                                  \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                                9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                                10. lower-*.f6483.7

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

                                \[\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 -2.25e8 < y.re < 4.2999999999999999e-32

                              1. Initial program 41.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. Add Preprocessing
                              3. 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}} \]
                              4. Step-by-step derivation
                                1. lower-*.f64N/A

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

                                  \[\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. lower-*.f64N/A

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

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

                                  \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                                9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                                10. lower-*.f6418.7

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

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

                                \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                              7. Step-by-step derivation
                                1. Applied rewrites24.8%

                                  \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                                2. Step-by-step derivation
                                  1. Applied rewrites30.7%

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

                                  if 4.2999999999999999e-32 < y.re < 1.74999999999999994e69

                                  1. Initial program 39.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 \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. Add Preprocessing
                                  3. 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}} \]
                                  4. Step-by-step derivation
                                    1. lower-*.f64N/A

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

                                      \[\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. lower-*.f64N/A

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

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

                                      \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                                    9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                                    10. lower-*.f6435.8

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

                                    \[\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}} \]
                                  6. Taylor expanded in x.im around -inf

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

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

                                    if 1.74999999999999994e69 < y.re

                                    1. Initial program 41.0%

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

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

                                        \[\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. lower-*.f64N/A

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

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

                                        \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                                      9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                                      10. lower-*.f6454.0

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

                                      \[\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}} \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites36.0%

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

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

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

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -225000000:\\ \;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-32}:\\ \;\;\;\;{\left({\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{4}\right)}^{0.25}\\ \mathbf{elif}\;y.re \leq 1.75 \cdot 10^{+69}:\\ \;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(-x.im\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot \sin \left(-y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \end{array} \]
                                      6. Add Preprocessing

                                      Alternative 11: 45.9% accurate, 1.9× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot \sin t\_0\\ \mathbf{if}\;y.re \leq -225000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq 8.5 \cdot 10^{-133}:\\ \;\;\;\;{\left({t\_0}^{4}\right)}^{0.25}\\ \mathbf{elif}\;y.re \leq 2.9 \cdot 10^{-18}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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 (* (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re) (sin t_0))))
                                         (if (<= y.re -225000000.0)
                                           t_1
                                           (if (<= y.re 8.5e-133)
                                             (pow (pow t_0 4.0) 0.25)
                                             (if (<= y.re 2.9e-18) 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 = y_46_re * atan2(x_46_im, x_46_re);
                                      	double t_1 = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re) * sin(t_0);
                                      	double tmp;
                                      	if (y_46_re <= -225000000.0) {
                                      		tmp = t_1;
                                      	} else if (y_46_re <= 8.5e-133) {
                                      		tmp = pow(pow(t_0, 4.0), 0.25);
                                      	} else if (y_46_re <= 2.9e-18) {
                                      		tmp = t_0;
                                      	} else {
                                      		tmp = t_1;
                                      	}
                                      	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 = Float64((sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re) * sin(t_0))
                                      	tmp = 0.0
                                      	if (y_46_re <= -225000000.0)
                                      		tmp = t_1;
                                      	elseif (y_46_re <= 8.5e-133)
                                      		tmp = (t_0 ^ 4.0) ^ 0.25;
                                      	elseif (y_46_re <= 2.9e-18)
                                      		tmp = 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(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] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -225000000.0], t$95$1, If[LessEqual[y$46$re, 8.5e-133], N[Power[N[Power[t$95$0, 4.0], $MachinePrecision], 0.25], $MachinePrecision], If[LessEqual[y$46$re, 2.9e-18], t$95$0, t$95$1]]]]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
                                      t_1 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot \sin t\_0\\
                                      \mathbf{if}\;y.re \leq -225000000:\\
                                      \;\;\;\;t\_1\\
                                      
                                      \mathbf{elif}\;y.re \leq 8.5 \cdot 10^{-133}:\\
                                      \;\;\;\;{\left({t\_0}^{4}\right)}^{0.25}\\
                                      
                                      \mathbf{elif}\;y.re \leq 2.9 \cdot 10^{-18}:\\
                                      \;\;\;\;t\_0\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;t\_1\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 3 regimes
                                      2. if y.re < -2.25e8 or 2.9e-18 < y.re

                                        1. Initial program 36.7%

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

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

                                            \[\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. lower-*.f64N/A

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

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

                                            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                                          9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                                          10. lower-*.f6464.4

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

                                          \[\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 -2.25e8 < y.re < 8.49999999999999957e-133

                                        1. Initial program 41.5%

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

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

                                            \[\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. lower-*.f64N/A

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

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

                                            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                                          9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                                          10. lower-*.f6418.8

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

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

                                          \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                                        7. Step-by-step derivation
                                          1. Applied rewrites21.3%

                                            \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                                          2. Step-by-step derivation
                                            1. Applied rewrites31.6%

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

                                            if 8.49999999999999957e-133 < y.re < 2.9e-18

                                            1. Initial program 39.9%

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

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

                                                \[\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. lower-*.f64N/A

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

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

                                                \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                                              9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                                              10. lower-*.f6416.8

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

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

                                              \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites46.1%

                                                \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                                            8. Recombined 3 regimes into one program.
                                            9. Final simplification47.1%

                                              \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -225000000:\\ \;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{elif}\;y.re \leq 8.5 \cdot 10^{-133}:\\ \;\;\;\;{\left({\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{4}\right)}^{0.25}\\ \mathbf{elif}\;y.re \leq 2.9 \cdot 10^{-18}:\\ \;\;\;\;y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \end{array} \]
                                            10. Add Preprocessing

                                            Alternative 12: 45.9% accurate, 2.1× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot t\_0\\ \mathbf{if}\;y.re \leq -1.45 \cdot 10^{-16}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq 8.5 \cdot 10^{-133}:\\ \;\;\;\;{\left({t\_0}^{4}\right)}^{0.25}\\ \mathbf{elif}\;y.re \leq 2.9 \cdot 10^{-18}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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 (* (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re) t_0)))
                                               (if (<= y.re -1.45e-16)
                                                 t_1
                                                 (if (<= y.re 8.5e-133)
                                                   (pow (pow t_0 4.0) 0.25)
                                                   (if (<= y.re 2.9e-18) 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 = y_46_re * atan2(x_46_im, x_46_re);
                                            	double t_1 = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re) * t_0;
                                            	double tmp;
                                            	if (y_46_re <= -1.45e-16) {
                                            		tmp = t_1;
                                            	} else if (y_46_re <= 8.5e-133) {
                                            		tmp = pow(pow(t_0, 4.0), 0.25);
                                            	} else if (y_46_re <= 2.9e-18) {
                                            		tmp = t_0;
                                            	} else {
                                            		tmp = t_1;
                                            	}
                                            	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 = Float64((sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re) * t_0)
                                            	tmp = 0.0
                                            	if (y_46_re <= -1.45e-16)
                                            		tmp = t_1;
                                            	elseif (y_46_re <= 8.5e-133)
                                            		tmp = (t_0 ^ 4.0) ^ 0.25;
                                            	elseif (y_46_re <= 2.9e-18)
                                            		tmp = 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(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] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -1.45e-16], t$95$1, If[LessEqual[y$46$re, 8.5e-133], N[Power[N[Power[t$95$0, 4.0], $MachinePrecision], 0.25], $MachinePrecision], If[LessEqual[y$46$re, 2.9e-18], t$95$0, t$95$1]]]]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
                                            t_1 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot t\_0\\
                                            \mathbf{if}\;y.re \leq -1.45 \cdot 10^{-16}:\\
                                            \;\;\;\;t\_1\\
                                            
                                            \mathbf{elif}\;y.re \leq 8.5 \cdot 10^{-133}:\\
                                            \;\;\;\;{\left({t\_0}^{4}\right)}^{0.25}\\
                                            
                                            \mathbf{elif}\;y.re \leq 2.9 \cdot 10^{-18}:\\
                                            \;\;\;\;t\_0\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;t\_1\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 3 regimes
                                            2. if y.re < -1.4499999999999999e-16 or 2.9e-18 < y.re

                                              1. Initial program 36.3%

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

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

                                                  \[\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. lower-*.f64N/A

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

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

                                                  \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                                                9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                                                10. lower-*.f6463.1

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

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

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

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

                                                if -1.4499999999999999e-16 < y.re < 8.49999999999999957e-133

                                                1. Initial program 42.1%

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

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

                                                    \[\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. lower-*.f64N/A

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

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

                                                    \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                                                  9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                                                  10. lower-*.f6418.5

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

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

                                                  \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                                                7. Step-by-step derivation
                                                  1. Applied rewrites21.9%

                                                    \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                                                  2. Step-by-step derivation
                                                    1. Applied rewrites31.8%

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

                                                    if 8.49999999999999957e-133 < y.re < 2.9e-18

                                                    1. Initial program 39.9%

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

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

                                                        \[\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. lower-*.f64N/A

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

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

                                                        \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                                                      9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                                                      10. lower-*.f6416.8

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

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

                                                      \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                                                    7. Step-by-step derivation
                                                      1. Applied rewrites46.1%

                                                        \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                                                    8. Recombined 3 regimes into one program.
                                                    9. Final simplification45.5%

                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -1.45 \cdot 10^{-16}:\\ \;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{elif}\;y.re \leq 8.5 \cdot 10^{-133}:\\ \;\;\;\;{\left({\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{4}\right)}^{0.25}\\ \mathbf{elif}\;y.re \leq 2.9 \cdot 10^{-18}:\\ \;\;\;\;y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \end{array} \]
                                                    10. Add Preprocessing

                                                    Alternative 13: 46.4% accurate, 2.6× speedup?

                                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot t\_0\\ \mathbf{if}\;y.re \leq -0.0041:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq -8.8 \cdot 10^{-249}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 1.8 \cdot 10^{-144}:\\ \;\;\;\;\sqrt{{t\_0}^{2}}\\ \mathbf{elif}\;y.re \leq 2.9 \cdot 10^{-18}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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 (* (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re) t_0)))
                                                       (if (<= y.re -0.0041)
                                                         t_1
                                                         (if (<= y.re -8.8e-249)
                                                           t_0
                                                           (if (<= y.re 1.8e-144)
                                                             (sqrt (pow t_0 2.0))
                                                             (if (<= y.re 2.9e-18) 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 = y_46_re * atan2(x_46_im, x_46_re);
                                                    	double t_1 = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re) * t_0;
                                                    	double tmp;
                                                    	if (y_46_re <= -0.0041) {
                                                    		tmp = t_1;
                                                    	} else if (y_46_re <= -8.8e-249) {
                                                    		tmp = t_0;
                                                    	} else if (y_46_re <= 1.8e-144) {
                                                    		tmp = sqrt(pow(t_0, 2.0));
                                                    	} else if (y_46_re <= 2.9e-18) {
                                                    		tmp = t_0;
                                                    	} else {
                                                    		tmp = t_1;
                                                    	}
                                                    	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 = Float64((sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re) * t_0)
                                                    	tmp = 0.0
                                                    	if (y_46_re <= -0.0041)
                                                    		tmp = t_1;
                                                    	elseif (y_46_re <= -8.8e-249)
                                                    		tmp = t_0;
                                                    	elseif (y_46_re <= 1.8e-144)
                                                    		tmp = sqrt((t_0 ^ 2.0));
                                                    	elseif (y_46_re <= 2.9e-18)
                                                    		tmp = 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(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] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -0.0041], t$95$1, If[LessEqual[y$46$re, -8.8e-249], t$95$0, If[LessEqual[y$46$re, 1.8e-144], N[Sqrt[N[Power[t$95$0, 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 2.9e-18], t$95$0, t$95$1]]]]]]
                                                    
                                                    \begin{array}{l}
                                                    
                                                    \\
                                                    \begin{array}{l}
                                                    t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
                                                    t_1 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot t\_0\\
                                                    \mathbf{if}\;y.re \leq -0.0041:\\
                                                    \;\;\;\;t\_1\\
                                                    
                                                    \mathbf{elif}\;y.re \leq -8.8 \cdot 10^{-249}:\\
                                                    \;\;\;\;t\_0\\
                                                    
                                                    \mathbf{elif}\;y.re \leq 1.8 \cdot 10^{-144}:\\
                                                    \;\;\;\;\sqrt{{t\_0}^{2}}\\
                                                    
                                                    \mathbf{elif}\;y.re \leq 2.9 \cdot 10^{-18}:\\
                                                    \;\;\;\;t\_0\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;t\_1\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 3 regimes
                                                    2. if y.re < -0.00410000000000000035 or 2.9e-18 < y.re

                                                      1. Initial program 37.3%

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

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

                                                          \[\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. lower-*.f64N/A

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

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

                                                          \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                                                        9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                                                        10. lower-*.f6464.8

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

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

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

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

                                                        if -0.00410000000000000035 < y.re < -8.8e-249 or 1.8e-144 < y.re < 2.9e-18

                                                        1. Initial program 36.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(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
                                                        2. Add Preprocessing
                                                        3. Taylor expanded in y.im around 0

                                                          \[\leadsto \color{blue}{\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}} \]
                                                        4. Step-by-step derivation
                                                          1. lower-*.f64N/A

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

                                                            \[\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. lower-*.f64N/A

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

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

                                                            \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                                                          9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                                                          10. lower-*.f6417.7

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

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

                                                          \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                                                        7. Step-by-step derivation
                                                          1. Applied rewrites34.1%

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

                                                          if -8.8e-249 < y.re < 1.8e-144

                                                          1. Initial program 50.9%

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

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

                                                              \[\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. lower-*.f64N/A

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

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

                                                              \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                                                            9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                                                            10. lower-*.f6418.4

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

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

                                                            \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                                                          7. Step-by-step derivation
                                                            1. Applied rewrites9.0%

                                                              \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                                                            2. Step-by-step derivation
                                                              1. Applied rewrites34.3%

                                                                \[\leadsto \sqrt{{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{2}} \]
                                                            3. Recombined 3 regimes into one program.
                                                            4. Final simplification45.7%

                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -0.0041:\\ \;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{elif}\;y.re \leq -8.8 \cdot 10^{-249}:\\ \;\;\;\;y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{elif}\;y.re \leq 1.8 \cdot 10^{-144}:\\ \;\;\;\;\sqrt{{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{2}}\\ \mathbf{elif}\;y.re \leq 2.9 \cdot 10^{-18}:\\ \;\;\;\;y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \end{array} \]
                                                            5. Add Preprocessing

                                                            Alternative 14: 38.2% accurate, 2.9× speedup?

                                                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := t\_0 \cdot {x.im}^{y.re}\\ \mathbf{if}\;y.re \leq -450000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq -8.8 \cdot 10^{-249}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 1.8 \cdot 10^{-144}:\\ \;\;\;\;\sqrt{{t\_0}^{2}}\\ \mathbf{elif}\;y.re \leq 65000000:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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 (* t_0 (pow x.im y.re))))
                                                               (if (<= y.re -450000000.0)
                                                                 t_1
                                                                 (if (<= y.re -8.8e-249)
                                                                   t_0
                                                                   (if (<= y.re 1.8e-144)
                                                                     (sqrt (pow t_0 2.0))
                                                                     (if (<= y.re 65000000.0) 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 = y_46_re * atan2(x_46_im, x_46_re);
                                                            	double t_1 = t_0 * pow(x_46_im, y_46_re);
                                                            	double tmp;
                                                            	if (y_46_re <= -450000000.0) {
                                                            		tmp = t_1;
                                                            	} else if (y_46_re <= -8.8e-249) {
                                                            		tmp = t_0;
                                                            	} else if (y_46_re <= 1.8e-144) {
                                                            		tmp = sqrt(pow(t_0, 2.0));
                                                            	} else if (y_46_re <= 65000000.0) {
                                                            		tmp = t_0;
                                                            	} else {
                                                            		tmp = t_1;
                                                            	}
                                                            	return tmp;
                                                            }
                                                            
                                                            real(8) function code(x_46re, x_46im, y_46re, y_46im)
                                                                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 = y_46re * atan2(x_46im, x_46re)
                                                                t_1 = t_0 * (x_46im ** y_46re)
                                                                if (y_46re <= (-450000000.0d0)) then
                                                                    tmp = t_1
                                                                else if (y_46re <= (-8.8d-249)) then
                                                                    tmp = t_0
                                                                else if (y_46re <= 1.8d-144) then
                                                                    tmp = sqrt((t_0 ** 2.0d0))
                                                                else if (y_46re <= 65000000.0d0) then
                                                                    tmp = 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 = y_46_re * Math.atan2(x_46_im, x_46_re);
                                                            	double t_1 = t_0 * Math.pow(x_46_im, y_46_re);
                                                            	double tmp;
                                                            	if (y_46_re <= -450000000.0) {
                                                            		tmp = t_1;
                                                            	} else if (y_46_re <= -8.8e-249) {
                                                            		tmp = t_0;
                                                            	} else if (y_46_re <= 1.8e-144) {
                                                            		tmp = Math.sqrt(Math.pow(t_0, 2.0));
                                                            	} else if (y_46_re <= 65000000.0) {
                                                            		tmp = t_0;
                                                            	} else {
                                                            		tmp = t_1;
                                                            	}
                                                            	return tmp;
                                                            }
                                                            
                                                            def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                                            	t_0 = y_46_re * math.atan2(x_46_im, x_46_re)
                                                            	t_1 = t_0 * math.pow(x_46_im, y_46_re)
                                                            	tmp = 0
                                                            	if y_46_re <= -450000000.0:
                                                            		tmp = t_1
                                                            	elif y_46_re <= -8.8e-249:
                                                            		tmp = t_0
                                                            	elif y_46_re <= 1.8e-144:
                                                            		tmp = math.sqrt(math.pow(t_0, 2.0))
                                                            	elif y_46_re <= 65000000.0:
                                                            		tmp = t_0
                                                            	else:
                                                            		tmp = t_1
                                                            	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 = Float64(t_0 * (x_46_im ^ y_46_re))
                                                            	tmp = 0.0
                                                            	if (y_46_re <= -450000000.0)
                                                            		tmp = t_1;
                                                            	elseif (y_46_re <= -8.8e-249)
                                                            		tmp = t_0;
                                                            	elseif (y_46_re <= 1.8e-144)
                                                            		tmp = sqrt((t_0 ^ 2.0));
                                                            	elseif (y_46_re <= 65000000.0)
                                                            		tmp = 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 = y_46_re * atan2(x_46_im, x_46_re);
                                                            	t_1 = t_0 * (x_46_im ^ y_46_re);
                                                            	tmp = 0.0;
                                                            	if (y_46_re <= -450000000.0)
                                                            		tmp = t_1;
                                                            	elseif (y_46_re <= -8.8e-249)
                                                            		tmp = t_0;
                                                            	elseif (y_46_re <= 1.8e-144)
                                                            		tmp = sqrt((t_0 ^ 2.0));
                                                            	elseif (y_46_re <= 65000000.0)
                                                            		tmp = 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -450000000.0], t$95$1, If[LessEqual[y$46$re, -8.8e-249], t$95$0, If[LessEqual[y$46$re, 1.8e-144], N[Sqrt[N[Power[t$95$0, 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 65000000.0], t$95$0, t$95$1]]]]]]
                                                            
                                                            \begin{array}{l}
                                                            
                                                            \\
                                                            \begin{array}{l}
                                                            t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
                                                            t_1 := t\_0 \cdot {x.im}^{y.re}\\
                                                            \mathbf{if}\;y.re \leq -450000000:\\
                                                            \;\;\;\;t\_1\\
                                                            
                                                            \mathbf{elif}\;y.re \leq -8.8 \cdot 10^{-249}:\\
                                                            \;\;\;\;t\_0\\
                                                            
                                                            \mathbf{elif}\;y.re \leq 1.8 \cdot 10^{-144}:\\
                                                            \;\;\;\;\sqrt{{t\_0}^{2}}\\
                                                            
                                                            \mathbf{elif}\;y.re \leq 65000000:\\
                                                            \;\;\;\;t\_0\\
                                                            
                                                            \mathbf{else}:\\
                                                            \;\;\;\;t\_1\\
                                                            
                                                            
                                                            \end{array}
                                                            \end{array}
                                                            
                                                            Derivation
                                                            1. Split input into 3 regimes
                                                            2. if y.re < -4.5e8 or 6.5e7 < y.re

                                                              1. Initial program 36.6%

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

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

                                                                  \[\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. lower-*.f64N/A

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

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

                                                                  \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                                                                9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                                                                10. lower-*.f6467.4

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

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

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

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

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

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

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

                                                                    if -4.5e8 < y.re < -8.8e-249 or 1.8e-144 < y.re < 6.5e7

                                                                    1. Initial program 36.7%

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

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

                                                                        \[\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. lower-*.f64N/A

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

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

                                                                        \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                                                                      9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                                                                      10. lower-*.f6419.1

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

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

                                                                      \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                                                                    7. Step-by-step derivation
                                                                      1. Applied rewrites32.1%

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

                                                                      if -8.8e-249 < y.re < 1.8e-144

                                                                      1. Initial program 50.9%

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

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

                                                                          \[\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. lower-*.f64N/A

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

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

                                                                          \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                                                                        9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                                                                        10. lower-*.f6418.4

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

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

                                                                        \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                                                                      7. Step-by-step derivation
                                                                        1. Applied rewrites9.0%

                                                                          \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                                                                        2. Step-by-step derivation
                                                                          1. Applied rewrites34.3%

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

                                                                        Alternative 15: 36.4% accurate, 3.0× speedup?

                                                                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := t\_0 \cdot {x.im}^{y.re}\\ \mathbf{if}\;y.re \leq -450000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq 65000000:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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 (* t_0 (pow x.im y.re))))
                                                                           (if (<= y.re -450000000.0) t_1 (if (<= y.re 65000000.0) 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 = y_46_re * atan2(x_46_im, x_46_re);
                                                                        	double t_1 = t_0 * pow(x_46_im, y_46_re);
                                                                        	double tmp;
                                                                        	if (y_46_re <= -450000000.0) {
                                                                        		tmp = t_1;
                                                                        	} else if (y_46_re <= 65000000.0) {
                                                                        		tmp = t_0;
                                                                        	} else {
                                                                        		tmp = t_1;
                                                                        	}
                                                                        	return tmp;
                                                                        }
                                                                        
                                                                        real(8) function code(x_46re, x_46im, y_46re, y_46im)
                                                                            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 = y_46re * atan2(x_46im, x_46re)
                                                                            t_1 = t_0 * (x_46im ** y_46re)
                                                                            if (y_46re <= (-450000000.0d0)) then
                                                                                tmp = t_1
                                                                            else if (y_46re <= 65000000.0d0) then
                                                                                tmp = 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 = y_46_re * Math.atan2(x_46_im, x_46_re);
                                                                        	double t_1 = t_0 * Math.pow(x_46_im, y_46_re);
                                                                        	double tmp;
                                                                        	if (y_46_re <= -450000000.0) {
                                                                        		tmp = t_1;
                                                                        	} else if (y_46_re <= 65000000.0) {
                                                                        		tmp = t_0;
                                                                        	} else {
                                                                        		tmp = t_1;
                                                                        	}
                                                                        	return tmp;
                                                                        }
                                                                        
                                                                        def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                                                        	t_0 = y_46_re * math.atan2(x_46_im, x_46_re)
                                                                        	t_1 = t_0 * math.pow(x_46_im, y_46_re)
                                                                        	tmp = 0
                                                                        	if y_46_re <= -450000000.0:
                                                                        		tmp = t_1
                                                                        	elif y_46_re <= 65000000.0:
                                                                        		tmp = t_0
                                                                        	else:
                                                                        		tmp = t_1
                                                                        	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 = Float64(t_0 * (x_46_im ^ y_46_re))
                                                                        	tmp = 0.0
                                                                        	if (y_46_re <= -450000000.0)
                                                                        		tmp = t_1;
                                                                        	elseif (y_46_re <= 65000000.0)
                                                                        		tmp = 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 = y_46_re * atan2(x_46_im, x_46_re);
                                                                        	t_1 = t_0 * (x_46_im ^ y_46_re);
                                                                        	tmp = 0.0;
                                                                        	if (y_46_re <= -450000000.0)
                                                                        		tmp = t_1;
                                                                        	elseif (y_46_re <= 65000000.0)
                                                                        		tmp = 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -450000000.0], t$95$1, If[LessEqual[y$46$re, 65000000.0], t$95$0, t$95$1]]]]
                                                                        
                                                                        \begin{array}{l}
                                                                        
                                                                        \\
                                                                        \begin{array}{l}
                                                                        t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
                                                                        t_1 := t\_0 \cdot {x.im}^{y.re}\\
                                                                        \mathbf{if}\;y.re \leq -450000000:\\
                                                                        \;\;\;\;t\_1\\
                                                                        
                                                                        \mathbf{elif}\;y.re \leq 65000000:\\
                                                                        \;\;\;\;t\_0\\
                                                                        
                                                                        \mathbf{else}:\\
                                                                        \;\;\;\;t\_1\\
                                                                        
                                                                        
                                                                        \end{array}
                                                                        \end{array}
                                                                        
                                                                        Derivation
                                                                        1. Split input into 2 regimes
                                                                        2. if y.re < -4.5e8 or 6.5e7 < y.re

                                                                          1. Initial program 36.6%

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

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

                                                                              \[\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. lower-*.f64N/A

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

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

                                                                              \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                                                                            9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                                                                            10. lower-*.f6467.4

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

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

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

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

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

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

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

                                                                                if -4.5e8 < y.re < 6.5e7

                                                                                1. Initial program 41.0%

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

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

                                                                                    \[\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. lower-*.f64N/A

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

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

                                                                                    \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                                                                                  9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                                                                                  10. lower-*.f6418.9

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

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

                                                                                  \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                                                                                7. Step-by-step derivation
                                                                                  1. Applied rewrites25.1%

                                                                                    \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                                                                                8. Recombined 2 regimes into one program.
                                                                                9. Add Preprocessing

                                                                                Alternative 16: 13.8% accurate, 6.4× speedup?

                                                                                \[\begin{array}{l} \\ y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} \end{array} \]
                                                                                (FPCore (x.re x.im y.re y.im) :precision binary64 (* y.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 * atan2(x_46_im, x_46_re);
                                                                                }
                                                                                
                                                                                real(8) function code(x_46re, x_46im, y_46re, y_46im)
                                                                                    real(8), intent (in) :: x_46re
                                                                                    real(8), intent (in) :: x_46im
                                                                                    real(8), intent (in) :: y_46re
                                                                                    real(8), intent (in) :: y_46im
                                                                                    code = y_46re * atan2(x_46im, x_46re)
                                                                                end function
                                                                                
                                                                                public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                                                                                	return y_46_re * Math.atan2(x_46_im, x_46_re);
                                                                                }
                                                                                
                                                                                def code(x_46_re, x_46_im, y_46_re, y_46_im):
                                                                                	return y_46_re * math.atan2(x_46_im, x_46_re)
                                                                                
                                                                                function code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                	return Float64(y_46_re * atan(x_46_im, x_46_re))
                                                                                end
                                                                                
                                                                                function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
                                                                                	tmp = y_46_re * atan2(x_46_im, x_46_re);
                                                                                end
                                                                                
                                                                                code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]
                                                                                
                                                                                \begin{array}{l}
                                                                                
                                                                                \\
                                                                                y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}
                                                                                \end{array}
                                                                                
                                                                                Derivation
                                                                                1. Initial program 39.3%

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

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

                                                                                    \[\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. lower-*.f64N/A

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

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

                                                                                    \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{\color{blue}{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{\color{blue}{\mathsf{fma}\left(x.im, x.im, {x.re}^{2}\right)}}\right)}^{y.re} \]
                                                                                  9. unpow2N/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, \color{blue}{x.re \cdot x.re}\right)}\right)}^{y.re} \]
                                                                                  10. lower-*.f6438.0

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

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

                                                                                  \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                                                                                7. Step-by-step derivation
                                                                                  1. Applied rewrites17.6%

                                                                                    \[\leadsto y.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}} \]
                                                                                  2. Add Preprocessing

                                                                                  Reproduce

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