powComplex, imaginary part

Percentage Accurate: 41.6% → 66.7%
Time: 19.9s
Alternatives: 19
Speedup: 2.8×

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 19 alternatives:

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

Initial Program: 41.6% 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.7% 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.re}\right)\\ \mathbf{if}\;x.re \leq -3.8 \cdot 10^{-42}:\\ \;\;\;\;e^{-\mathsf{fma}\left(y.re, t\_2, t\_0\right)} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, t\_2 \cdot \left(-y.im\right)\right)\right)\\ \mathbf{elif}\;x.re \leq 2.6 \cdot 10^{-65}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot \sin t\_1\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log x.re - t\_0} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.re, 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.re))))
   (if (<= x.re -3.8e-42)
     (*
      (exp (- (fma y.re t_2 t_0)))
      (sin (fma y.re (atan2 x.im x.re) (* t_2 (- y.im)))))
     (if (<= x.re 2.6e-65)
       (*
        (exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
        (sin t_1))
       (*
        (exp (- (* y.re (log x.re)) t_0))
        (sin (fma y.im (log x.re) t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = 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_re));
	double tmp;
	if (x_46_re <= -3.8e-42) {
		tmp = exp(-fma(y_46_re, t_2, t_0)) * sin(fma(y_46_re, atan2(x_46_im, x_46_re), (t_2 * -y_46_im)));
	} else if (x_46_re <= 2.6e-65) {
		tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * sin(t_1);
	} else {
		tmp = exp(((y_46_re * log(x_46_re)) - t_0)) * sin(fma(y_46_im, log(x_46_re), 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_re))
	tmp = 0.0
	if (x_46_re <= -3.8e-42)
		tmp = Float64(exp(Float64(-fma(y_46_re, t_2, t_0))) * sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(t_2 * Float64(-y_46_im)))));
	elseif (x_46_re <= 2.6e-65)
		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)) * sin(t_1));
	else
		tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0)) * sin(fma(y_46_im, log(x_46_re), 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$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -3.8e-42], N[(N[Exp[(-N[(y$46$re * t$95$2 + t$95$0), $MachinePrecision])], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(t$95$2 * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 2.6e-65], 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] * N[Sin[t$95$1], $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] + 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.re}\right)\\
\mathbf{if}\;x.re \leq -3.8 \cdot 10^{-42}:\\
\;\;\;\;e^{-\mathsf{fma}\left(y.re, t\_2, t\_0\right)} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, t\_2 \cdot \left(-y.im\right)\right)\right)\\

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

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


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

    1. Initial program 33.3%

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

      \[\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 -3.80000000000000017e-42 < x.re < 2.6000000000000001e-65

    1. Initial program 51.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.f6468.9

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

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

    if 2.6000000000000001e-65 < x.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 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.f6475.8

        \[\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. Simplified75.8%

      \[\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 simplification73.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.re \leq -3.8 \cdot 10^{-42}:\\ \;\;\;\;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)\\ \mathbf{elif}\;x.re \leq 2.6 \cdot 10^{-65}:\\ \;\;\;\;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 2: 64.4% 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 -9.6 \cdot 10^{-11}:\\ \;\;\;\;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{elif}\;x.im \leq 1.3 \cdot 10^{-181}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot \sin t\_1\\ \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 -9.6e-11)
     (* (exp (- (fma y.re t_2 t_0))) (sin (fma t_2 (- y.im) t_1)))
     (if (<= x.im 1.3e-181)
       (*
        (exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
        (sin 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 <= -9.6e-11) {
		tmp = exp(-fma(y_46_re, t_2, t_0)) * sin(fma(t_2, -y_46_im, t_1));
	} else if (x_46_im <= 1.3e-181) {
		tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * sin(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 <= -9.6e-11)
		tmp = Float64(exp(Float64(-fma(y_46_re, t_2, t_0))) * sin(fma(t_2, Float64(-y_46_im), t_1)));
	elseif (x_46_im <= 1.3e-181)
		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)) * sin(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, -9.6e-11], 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], If[LessEqual[x$46$im, 1.3e-181], 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] * N[Sin[t$95$1], $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 -9.6 \cdot 10^{-11}:\\
\;\;\;\;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{elif}\;x.im \leq 1.3 \cdot 10^{-181}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot \sin t\_1\\

\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 3 regimes
  2. if x.im < -9.6000000000000005e-11

    1. Initial program 32.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 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. Simplified82.0%

      \[\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 -9.6000000000000005e-11 < x.im < 1.29999999999999999e-181

    1. Initial program 48.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 e^{\log \left(\sqrt{x.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.f6456.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. Simplified56.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)} \]

    if 1.29999999999999999e-181 < x.im

    1. Initial program 41.1%

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

        \[\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. Simplified75.6%

      \[\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 3 regimes into one program.
  4. Final simplification70.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.im \leq -9.6 \cdot 10^{-11}:\\ \;\;\;\;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{elif}\;x.im \leq 1.3 \cdot 10^{-181}:\\ \;\;\;\;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.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 3: 58.7% accurate, 1.0× 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 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_1}\\ \mathbf{if}\;x.re \leq -4.2 \cdot 10^{+153}:\\ \;\;\;\;t\_0 \cdot {\left(\sqrt{x.re \cdot x.re}\right)}^{y.re}\\ \mathbf{elif}\;x.re \leq -7.6 \cdot 10^{-31}:\\ \;\;\;\;t\_2 \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}\;x.re \leq 2.6 \cdot 10^{-65}:\\ \;\;\;\;t\_2 \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)))
        (t_2
         (exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1))))
   (if (<= x.re -4.2e+153)
     (* t_0 (pow (sqrt (* x.re x.re)) y.re))
     (if (<= x.re -7.6e-31)
       (* t_2 (sin (* y.im (log (sqrt (fma x.im x.im (* x.re x.re)))))))
       (if (<= x.re 2.6e-65)
         (* t_2 (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 t_2 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1));
	double tmp;
	if (x_46_re <= -4.2e+153) {
		tmp = t_0 * pow(sqrt((x_46_re * x_46_re)), y_46_re);
	} else if (x_46_re <= -7.6e-31) {
		tmp = t_2 * sin((y_46_im * log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))))));
	} else if (x_46_re <= 2.6e-65) {
		tmp = t_2 * 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))
	t_2 = 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))
	tmp = 0.0
	if (x_46_re <= -4.2e+153)
		tmp = Float64(t_0 * (sqrt(Float64(x_46_re * x_46_re)) ^ y_46_re));
	elseif (x_46_re <= -7.6e-31)
		tmp = Float64(t_2 * sin(Float64(y_46_im * log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)))))));
	elseif (x_46_re <= 2.6e-65)
		tmp = Float64(t_2 * 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]}, Block[{t$95$2 = 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]}, If[LessEqual[x$46$re, -4.2e+153], N[(t$95$0 * N[Power[N[Sqrt[N[(x$46$re * x$46$re), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, -7.6e-31], N[(t$95$2 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 2.6e-65], N[(t$95$2 * 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}\\
t_2 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_1}\\
\mathbf{if}\;x.re \leq -4.2 \cdot 10^{+153}:\\
\;\;\;\;t\_0 \cdot {\left(\sqrt{x.re \cdot x.re}\right)}^{y.re}\\

\mathbf{elif}\;x.re \leq -7.6 \cdot 10^{-31}:\\
\;\;\;\;t\_2 \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}\;x.re \leq 2.6 \cdot 10^{-65}:\\
\;\;\;\;t\_2 \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 4 regimes
  2. if x.re < -4.20000000000000033e153

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

        \[\leadsto \color{blue}{\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} \]
      2. lower-atan2.f6452.0

        \[\leadsto \left(y.re \cdot \color{blue}{\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} \]
    8. Simplified52.0%

      \[\leadsto \color{blue}{\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} \]
    9. Taylor expanded in x.im around 0

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

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

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

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

    if -4.20000000000000033e153 < x.re < -7.5999999999999999e-31

    1. Initial program 81.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 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-*.f6478.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.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, \color{blue}{x.re \cdot x.re}\right)}\right)\right) \]
    5. Simplified78.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.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\right)} \]

    if -7.5999999999999999e-31 < x.re < 2.6000000000000001e-65

    1. Initial program 50.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 e^{\log \left(\sqrt{x.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.f6468.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.re \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right) \]
    5. Simplified68.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.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]

    if 2.6000000000000001e-65 < x.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 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.f6475.8

        \[\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. Simplified75.8%

      \[\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 4 regimes into one program.
  4. Final simplification68.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.re \leq -4.2 \cdot 10^{+153}:\\ \;\;\;\;\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{x.re \cdot x.re}\right)}^{y.re}\\ \mathbf{elif}\;x.re \leq -7.6 \cdot 10^{-31}:\\ \;\;\;\;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}\;x.re \leq 2.6 \cdot 10^{-65}:\\ \;\;\;\;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 4: 61.0% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{if}\;y.re \leq -2.2 \cdot 10^{-5}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq 2 \cdot 10^{-20}:\\ \;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{-t\_0}\right)\\ \mathbf{else}:\\ \;\;\;\;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
         (*
          (exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
          (sin (* y.re (atan2 x.im x.re))))))
   (if (<= y.re -2.2e-5)
     t_1
     (if (<= y.re 2e-20) (* y.re (* (atan2 x.im x.re) (exp (- 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 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * sin((y_46_re * atan2(x_46_im, x_46_re)));
	double tmp;
	if (y_46_re <= -2.2e-5) {
		tmp = t_1;
	} else if (y_46_re <= 2e-20) {
		tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp(-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_46im * atan2(x_46im, x_46re)
    t_1 = exp(((y_46re * log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))) - t_0)) * sin((y_46re * atan2(x_46im, x_46re)))
    if (y_46re <= (-2.2d-5)) then
        tmp = t_1
    else if (y_46re <= 2d-20) then
        tmp = y_46re * (atan2(x_46im, x_46re) * exp(-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_im * Math.atan2(x_46_im, x_46_re);
	double t_1 = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
	double tmp;
	if (y_46_re <= -2.2e-5) {
		tmp = t_1;
	} else if (y_46_re <= 2e-20) {
		tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp(-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_im * math.atan2(x_46_im, x_46_re)
	t_1 = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * math.sin((y_46_re * math.atan2(x_46_im, x_46_re)))
	tmp = 0
	if y_46_re <= -2.2e-5:
		tmp = t_1
	elif y_46_re <= 2e-20:
		tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp(-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_im * atan(x_46_im, x_46_re))
	t_1 = 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)) * sin(Float64(y_46_re * atan(x_46_im, x_46_re))))
	tmp = 0.0
	if (y_46_re <= -2.2e-5)
		tmp = t_1;
	elseif (y_46_re <= 2e-20)
		tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(-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_im * atan2(x_46_im, x_46_re);
	t_1 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * sin((y_46_re * atan2(x_46_im, x_46_re)));
	tmp = 0.0;
	if (y_46_re <= -2.2e-5)
		tmp = t_1;
	elseif (y_46_re <= 2e-20)
		tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp(-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$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.2e-5], t$95$1, If[LessEqual[y$46$re, 2e-20], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[(-t$95$0)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y.re < -2.1999999999999999e-5 or 1.99999999999999989e-20 < y.re

    1. Initial program 39.4%

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

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

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

    if -2.1999999999999999e-5 < y.re < 1.99999999999999989e-20

    1. Initial program 44.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y.re \cdot \left(e^{\left(\mathsf{neg}\left(y.im\right)\right) \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
      8. lower-atan2.f6455.4

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -2.2 \cdot 10^{-5}:\\ \;\;\;\;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{elif}\;y.re \leq 2 \cdot 10^{-20}:\\ \;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{-y.im \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 5: 59.0% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{-6}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\


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

    1. Initial program 44.7%

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

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

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

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

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

        \[\leadsto \sin \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. lift-pow.f64N/A

        \[\leadsto \sin \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}} \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{{\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)} \]
      9. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\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) \]
      10. sqr-powN/A

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

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

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

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

    if -8.00000000000000065e-5 < y.re < 1.1999999999999999e-6

    1. Initial program 45.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y.re \cdot \left(e^{\left(\mathsf{neg}\left(y.im\right)\right) \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
      8. lower-atan2.f6455.7

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

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

    if 1.1999999999999999e-6 < y.re

    1. Initial program 30.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-*.f6457.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. Simplified57.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}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification62.7%

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

Alternative 6: 59.0% accurate, 2.0× speedup?

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

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

\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{-6}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\\

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


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

    1. Initial program 38.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}{\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-*.f6468.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. Simplified68.2%

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

    if -8.00000000000000065e-5 < y.re < 1.1999999999999999e-6

    1. Initial program 45.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y.re \cdot \left(e^{\left(\mathsf{neg}\left(y.im\right)\right) \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
      8. lower-atan2.f6455.7

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

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

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

Alternative 7: 56.1% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.00078:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)}\right)\\

\mathbf{elif}\;y.re \leq 1.9:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\\

\mathbf{else}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\


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

    1. Initial program 44.7%

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

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

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

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

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

        \[\leadsto \sin \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. lift-pow.f64N/A

        \[\leadsto \sin \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}} \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{{\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)} \]
      9. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\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) \]
      10. sqr-powN/A

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

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

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

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

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

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

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

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

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

    if -7.79999999999999986e-4 < y.re < 1.8999999999999999

    1. Initial program 46.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 e^{\log \left(\sqrt{x.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.f6439.4

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

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

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

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

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

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

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

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

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

        \[\leadsto y.re \cdot \left(e^{\left(\mathsf{neg}\left(y.im\right)\right) \cdot \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
      8. lower-atan2.f6455.6

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

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

    if 1.8999999999999999 < y.re

    1. Initial program 29.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -0.00078:\\ \;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)}\right)\\ \mathbf{elif}\;y.re \leq 1.9:\\ \;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 46.8% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -2.1 \cdot 10^{-5}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)}\right)\\

\mathbf{elif}\;y.re \leq 0.0078:\\
\;\;\;\;\frac{y.im}{\frac{y.im}{t\_0}}\\

\mathbf{else}:\\
\;\;\;\;\sin t\_0 \cdot {x.im}^{y.re}\\


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

    1. Initial program 44.7%

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

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

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

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

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

        \[\leadsto \sin \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. lift-pow.f64N/A

        \[\leadsto \sin \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}} \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{{\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)} \]
      9. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\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) \]
      10. sqr-powN/A

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

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

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

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

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

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

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

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

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

    if -2.09999999999999988e-5 < y.re < 0.0077999999999999996

    1. Initial program 46.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-*.f6426.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. Simplified26.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 \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

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

      \[\leadsto \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
    9. Step-by-step derivation
      1. lift-atan2.f64N/A

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

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

        \[\leadsto \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot 1} \]
      4. lft-mult-inverseN/A

        \[\leadsto \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \color{blue}{\left(\frac{1}{y.im} \cdot y.im\right)} \]
      5. associate-*l*N/A

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{y.im}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}}} \cdot y.im \]
      8. associate-*l/N/A

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

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

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

        \[\leadsto \frac{y.im}{\color{blue}{\frac{y.im}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}}} \]
    10. Applied egg-rr36.0%

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

    if 0.0077999999999999996 < y.re

    1. Initial program 29.9%

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

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

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

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

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

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

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

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

Alternative 9: 48.3% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)}\right)\\ \mathbf{if}\;y.re \leq -2.1 \cdot 10^{-5}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 2 \cdot 10^{-20}:\\ \;\;\;\;\frac{y.im}{\frac{y.im}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \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)
           (pow (fma x.re x.re (* x.im x.im)) (* y.re 0.5))))))
   (if (<= y.re -2.1e-5)
     t_0
     (if (<= y.re 2e-20) (/ y.im (/ y.im (* y.re (atan2 x.im 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) * pow(fma(x_46_re, x_46_re, (x_46_im * x_46_im)), (y_46_re * 0.5)));
	double tmp;
	if (y_46_re <= -2.1e-5) {
		tmp = t_0;
	} else if (y_46_re <= 2e-20) {
		tmp = y_46_im / (y_46_im / (y_46_re * atan2(x_46_im, x_46_re)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)) ^ Float64(y_46_re * 0.5))))
	tmp = 0.0
	if (y_46_re <= -2.1e-5)
		tmp = t_0;
	elseif (y_46_re <= 2e-20)
		tmp = Float64(y_46_im / Float64(y_46_im / Float64(y_46_re * atan(x_46_im, x_46_re))));
	else
		tmp = t_0;
	end
	return tmp
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.1e-5], t$95$0, If[LessEqual[y$46$re, 2e-20], N[(y$46$im / N[(y$46$im / N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

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

\mathbf{elif}\;y.re \leq 2 \cdot 10^{-20}:\\
\;\;\;\;\frac{y.im}{\frac{y.im}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y.re < -2.09999999999999988e-5 or 1.99999999999999989e-20 < y.re

    1. Initial program 39.4%

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

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

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

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

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

        \[\leadsto \sin \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. lift-pow.f64N/A

        \[\leadsto \sin \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}} \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{{\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)} \]
      9. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\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) \]
      10. sqr-powN/A

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

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

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

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

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

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

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

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

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

    if -2.09999999999999988e-5 < y.re < 1.99999999999999989e-20

    1. Initial program 44.4%

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

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

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

      \[\leadsto \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
    9. Step-by-step derivation
      1. lift-atan2.f64N/A

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

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

        \[\leadsto \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot 1} \]
      4. lft-mult-inverseN/A

        \[\leadsto \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \color{blue}{\left(\frac{1}{y.im} \cdot y.im\right)} \]
      5. associate-*l*N/A

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{y.im}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}}} \cdot y.im \]
      8. associate-*l/N/A

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

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

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

        \[\leadsto \frac{y.im}{\color{blue}{\frac{y.im}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}}} \]
    10. Applied egg-rr36.0%

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

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

Alternative 10: 41.9% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{if}\;x.im \leq -3.5 \cdot 10^{-6}:\\ \;\;\;\;t\_0 \cdot {\left(-x.im\right)}^{y.re}\\ \mathbf{elif}\;x.im \leq 580000000:\\ \;\;\;\;t\_0 \cdot {\left(\sqrt{x.re \cdot x.re}\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot {\left(\sqrt{x.im \cdot x.im}\right)}^{y.re}\\ \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))))
   (if (<= x.im -3.5e-6)
     (* t_0 (pow (- x.im) y.re))
     (if (<= x.im 580000000.0)
       (* t_0 (pow (sqrt (* x.re x.re)) y.re))
       (* t_0 (pow (sqrt (* x.im x.im)) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = y_46_re * atan2(x_46_im, x_46_re);
	double tmp;
	if (x_46_im <= -3.5e-6) {
		tmp = t_0 * pow(-x_46_im, y_46_re);
	} else if (x_46_im <= 580000000.0) {
		tmp = t_0 * pow(sqrt((x_46_re * x_46_re)), y_46_re);
	} else {
		tmp = t_0 * pow(sqrt((x_46_im * x_46_im)), y_46_re);
	}
	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) :: tmp
    t_0 = y_46re * atan2(x_46im, x_46re)
    if (x_46im <= (-3.5d-6)) then
        tmp = t_0 * (-x_46im ** y_46re)
    else if (x_46im <= 580000000.0d0) then
        tmp = t_0 * (sqrt((x_46re * x_46re)) ** y_46re)
    else
        tmp = t_0 * (sqrt((x_46im * x_46im)) ** y_46re)
    end if
    code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
	double tmp;
	if (x_46_im <= -3.5e-6) {
		tmp = t_0 * Math.pow(-x_46_im, y_46_re);
	} else if (x_46_im <= 580000000.0) {
		tmp = t_0 * Math.pow(Math.sqrt((x_46_re * x_46_re)), y_46_re);
	} else {
		tmp = t_0 * Math.pow(Math.sqrt((x_46_im * x_46_im)), y_46_re);
	}
	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)
	tmp = 0
	if x_46_im <= -3.5e-6:
		tmp = t_0 * math.pow(-x_46_im, y_46_re)
	elif x_46_im <= 580000000.0:
		tmp = t_0 * math.pow(math.sqrt((x_46_re * x_46_re)), y_46_re)
	else:
		tmp = t_0 * math.pow(math.sqrt((x_46_im * x_46_im)), y_46_re)
	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))
	tmp = 0.0
	if (x_46_im <= -3.5e-6)
		tmp = Float64(t_0 * (Float64(-x_46_im) ^ y_46_re));
	elseif (x_46_im <= 580000000.0)
		tmp = Float64(t_0 * (sqrt(Float64(x_46_re * x_46_re)) ^ y_46_re));
	else
		tmp = Float64(t_0 * (sqrt(Float64(x_46_im * x_46_im)) ^ y_46_re));
	end
	return tmp
end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = y_46_re * atan2(x_46_im, x_46_re);
	tmp = 0.0;
	if (x_46_im <= -3.5e-6)
		tmp = t_0 * (-x_46_im ^ y_46_re);
	elseif (x_46_im <= 580000000.0)
		tmp = t_0 * (sqrt((x_46_re * x_46_re)) ^ y_46_re);
	else
		tmp = t_0 * (sqrt((x_46_im * x_46_im)) ^ y_46_re);
	end
	tmp_2 = tmp;
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -3.5e-6], N[(t$95$0 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 580000000.0], N[(t$95$0 * N[Power[N[Sqrt[N[(x$46$re * x$46$re), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[N[Sqrt[N[(x$46$im * x$46$im), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.im \leq -3.5 \cdot 10^{-6}:\\
\;\;\;\;t\_0 \cdot {\left(-x.im\right)}^{y.re}\\

\mathbf{elif}\;x.im \leq 580000000:\\
\;\;\;\;t\_0 \cdot {\left(\sqrt{x.re \cdot x.re}\right)}^{y.re}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x.im < -3.49999999999999995e-6

    1. Initial program 32.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-*.f6449.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. Simplified49.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 \color{blue}{\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} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\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} \]
      2. lower-atan2.f6446.6

        \[\leadsto \left(y.re \cdot \color{blue}{\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} \]
    8. Simplified46.6%

      \[\leadsto \color{blue}{\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} \]
    9. Taylor expanded in x.im around -inf

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

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

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

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

    if -3.49999999999999995e-6 < x.im < 5.8e8

    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-*.f6446.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. Simplified46.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. Taylor expanded in y.re around 0

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

        \[\leadsto \color{blue}{\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} \]
      2. lower-atan2.f6446.0

        \[\leadsto \left(y.re \cdot \color{blue}{\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} \]
    8. Simplified46.0%

      \[\leadsto \color{blue}{\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} \]
    9. Taylor expanded in x.im around 0

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

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

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

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

    if 5.8e8 < x.im

    1. Initial program 31.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-*.f6456.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. Simplified56.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 \color{blue}{\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} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\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} \]
      2. lower-atan2.f6454.7

        \[\leadsto \left(y.re \cdot \color{blue}{\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} \]
    8. Simplified54.7%

      \[\leadsto \color{blue}{\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} \]
    9. Taylor expanded in x.im around inf

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

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

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

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

Alternative 11: 41.8% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{if}\;x.re \leq -3.55 \cdot 10^{-40}:\\ \;\;\;\;t\_0 \cdot {\left(-x.re\right)}^{y.re}\\ \mathbf{elif}\;x.re \leq 2.9 \cdot 10^{-19}:\\ \;\;\;\;t\_0 \cdot {\left(\sqrt{x.im \cdot x.im}\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot {x.re}^{y.re}\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (* y.re (atan2 x.im x.re))))
   (if (<= x.re -3.55e-40)
     (* t_0 (pow (- x.re) y.re))
     (if (<= x.re 2.9e-19)
       (* t_0 (pow (sqrt (* x.im x.im)) y.re))
       (* t_0 (pow x.re y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = y_46_re * atan2(x_46_im, x_46_re);
	double tmp;
	if (x_46_re <= -3.55e-40) {
		tmp = t_0 * pow(-x_46_re, y_46_re);
	} else if (x_46_re <= 2.9e-19) {
		tmp = t_0 * pow(sqrt((x_46_im * x_46_im)), y_46_re);
	} else {
		tmp = t_0 * pow(x_46_re, y_46_re);
	}
	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) :: tmp
    t_0 = y_46re * atan2(x_46im, x_46re)
    if (x_46re <= (-3.55d-40)) then
        tmp = t_0 * (-x_46re ** y_46re)
    else if (x_46re <= 2.9d-19) then
        tmp = t_0 * (sqrt((x_46im * x_46im)) ** y_46re)
    else
        tmp = t_0 * (x_46re ** y_46re)
    end if
    code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
	double tmp;
	if (x_46_re <= -3.55e-40) {
		tmp = t_0 * Math.pow(-x_46_re, y_46_re);
	} else if (x_46_re <= 2.9e-19) {
		tmp = t_0 * Math.pow(Math.sqrt((x_46_im * x_46_im)), y_46_re);
	} else {
		tmp = t_0 * Math.pow(x_46_re, y_46_re);
	}
	return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	t_0 = y_46_re * math.atan2(x_46_im, x_46_re)
	tmp = 0
	if x_46_re <= -3.55e-40:
		tmp = t_0 * math.pow(-x_46_re, y_46_re)
	elif x_46_re <= 2.9e-19:
		tmp = t_0 * math.pow(math.sqrt((x_46_im * x_46_im)), y_46_re)
	else:
		tmp = t_0 * math.pow(x_46_re, y_46_re)
	return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = Float64(y_46_re * atan(x_46_im, x_46_re))
	tmp = 0.0
	if (x_46_re <= -3.55e-40)
		tmp = Float64(t_0 * (Float64(-x_46_re) ^ y_46_re));
	elseif (x_46_re <= 2.9e-19)
		tmp = Float64(t_0 * (sqrt(Float64(x_46_im * x_46_im)) ^ y_46_re));
	else
		tmp = Float64(t_0 * (x_46_re ^ y_46_re));
	end
	return tmp
end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = y_46_re * atan2(x_46_im, x_46_re);
	tmp = 0.0;
	if (x_46_re <= -3.55e-40)
		tmp = t_0 * (-x_46_re ^ y_46_re);
	elseif (x_46_re <= 2.9e-19)
		tmp = t_0 * (sqrt((x_46_im * x_46_im)) ^ y_46_re);
	else
		tmp = t_0 * (x_46_re ^ y_46_re);
	end
	tmp_2 = tmp;
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -3.55e-40], N[(t$95$0 * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 2.9e-19], N[(t$95$0 * N[Power[N[Sqrt[N[(x$46$im * x$46$im), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq -3.55 \cdot 10^{-40}:\\
\;\;\;\;t\_0 \cdot {\left(-x.re\right)}^{y.re}\\

\mathbf{elif}\;x.re \leq 2.9 \cdot 10^{-19}:\\
\;\;\;\;t\_0 \cdot {\left(\sqrt{x.im \cdot x.im}\right)}^{y.re}\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\


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

    1. Initial program 33.3%

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

        \[\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. Simplified42.3%

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

        \[\leadsto \color{blue}{\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} \]
      2. lower-atan2.f6448.8

        \[\leadsto \left(y.re \cdot \color{blue}{\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} \]
    8. Simplified48.8%

      \[\leadsto \color{blue}{\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} \]
    9. Taylor expanded in x.re around -inf

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

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

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

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

    if -3.55000000000000012e-40 < x.re < 2.9e-19

    1. Initial program 50.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-*.f6455.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. Simplified55.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 \color{blue}{\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} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\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} \]
      2. lower-atan2.f6449.8

        \[\leadsto \left(y.re \cdot \color{blue}{\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} \]
    8. Simplified49.8%

      \[\leadsto \color{blue}{\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} \]
    9. Taylor expanded in x.im around inf

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

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

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

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

    if 2.9e-19 < x.re

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

        \[\leadsto \color{blue}{\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} \]
      2. lower-atan2.f6444.8

        \[\leadsto \left(y.re \cdot \color{blue}{\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} \]
    8. Simplified44.8%

      \[\leadsto \color{blue}{\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} \]
    9. Taylor expanded in x.im around 0

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

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

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

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

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

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

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

Alternative 12: 41.2% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{if}\;y.re \leq -4.4 \cdot 10^{-9}:\\ \;\;\;\;t\_0 \cdot {\left(-x.re\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq 1.15:\\ \;\;\;\;\frac{y.im}{\frac{y.im}{t\_0}}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot {x.im}^{y.re}\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (* y.re (atan2 x.im x.re))))
   (if (<= y.re -4.4e-9)
     (* t_0 (pow (- x.re) y.re))
     (if (<= y.re 1.15) (/ y.im (/ y.im t_0)) (* t_0 (pow x.im y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = y_46_re * atan2(x_46_im, x_46_re);
	double tmp;
	if (y_46_re <= -4.4e-9) {
		tmp = t_0 * pow(-x_46_re, y_46_re);
	} else if (y_46_re <= 1.15) {
		tmp = y_46_im / (y_46_im / t_0);
	} else {
		tmp = t_0 * pow(x_46_im, y_46_re);
	}
	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) :: tmp
    t_0 = y_46re * atan2(x_46im, x_46re)
    if (y_46re <= (-4.4d-9)) then
        tmp = t_0 * (-x_46re ** y_46re)
    else if (y_46re <= 1.15d0) then
        tmp = y_46im / (y_46im / t_0)
    else
        tmp = t_0 * (x_46im ** y_46re)
    end if
    code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
	double tmp;
	if (y_46_re <= -4.4e-9) {
		tmp = t_0 * Math.pow(-x_46_re, y_46_re);
	} else if (y_46_re <= 1.15) {
		tmp = y_46_im / (y_46_im / t_0);
	} else {
		tmp = t_0 * Math.pow(x_46_im, y_46_re);
	}
	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)
	tmp = 0
	if y_46_re <= -4.4e-9:
		tmp = t_0 * math.pow(-x_46_re, y_46_re)
	elif y_46_re <= 1.15:
		tmp = y_46_im / (y_46_im / t_0)
	else:
		tmp = t_0 * math.pow(x_46_im, y_46_re)
	return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = Float64(y_46_re * atan(x_46_im, x_46_re))
	tmp = 0.0
	if (y_46_re <= -4.4e-9)
		tmp = Float64(t_0 * (Float64(-x_46_re) ^ y_46_re));
	elseif (y_46_re <= 1.15)
		tmp = Float64(y_46_im / Float64(y_46_im / t_0));
	else
		tmp = Float64(t_0 * (x_46_im ^ y_46_re));
	end
	return tmp
end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = y_46_re * atan2(x_46_im, x_46_re);
	tmp = 0.0;
	if (y_46_re <= -4.4e-9)
		tmp = t_0 * (-x_46_re ^ y_46_re);
	elseif (y_46_re <= 1.15)
		tmp = y_46_im / (y_46_im / t_0);
	else
		tmp = t_0 * (x_46_im ^ y_46_re);
	end
	tmp_2 = tmp;
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -4.4e-9], N[(t$95$0 * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.15], N[(y$46$im / N[(y$46$im / t$95$0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -4.4 \cdot 10^{-9}:\\
\;\;\;\;t\_0 \cdot {\left(-x.re\right)}^{y.re}\\

\mathbf{elif}\;y.re \leq 1.15:\\
\;\;\;\;\frac{y.im}{\frac{y.im}{t\_0}}\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\


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

    1. Initial program 44.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-*.f6476.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. Simplified76.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 \color{blue}{\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} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\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} \]
      2. lower-atan2.f6475.6

        \[\leadsto \left(y.re \cdot \color{blue}{\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} \]
    8. Simplified75.6%

      \[\leadsto \color{blue}{\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} \]
    9. Taylor expanded in x.re around -inf

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

        \[\leadsto \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\color{blue}{\left(\mathsf{neg}\left(x.re\right)\right)}}^{y.re} \]
      2. lower-neg.f6455.9

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

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

    if -4.3999999999999997e-9 < y.re < 1.1499999999999999

    1. Initial program 46.7%

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

      \[\leadsto \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

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

      \[\leadsto \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
    9. Step-by-step derivation
      1. lift-atan2.f64N/A

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

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

        \[\leadsto \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot 1} \]
      4. lft-mult-inverseN/A

        \[\leadsto \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \color{blue}{\left(\frac{1}{y.im} \cdot y.im\right)} \]
      5. associate-*l*N/A

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{y.im}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}}} \cdot y.im \]
      8. associate-*l/N/A

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

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

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

        \[\leadsto \frac{y.im}{\color{blue}{\frac{y.im}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}}} \]
    10. Applied egg-rr36.0%

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

    if 1.1499999999999999 < y.re

    1. Initial program 29.9%

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

        \[\leadsto \color{blue}{\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} \]
      2. lower-atan2.f6453.8

        \[\leadsto \left(y.re \cdot \color{blue}{\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} \]
    8. Simplified53.8%

      \[\leadsto \color{blue}{\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} \]
    9. Taylor expanded in x.re around 0

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

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

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

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

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

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

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

Alternative 13: 41.2% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{if}\;y.re \leq -0.00043:\\ \;\;\;\;t\_0 \cdot {x.re}^{y.re}\\ \mathbf{elif}\;y.re \leq 1.15:\\ \;\;\;\;\frac{y.im}{\frac{y.im}{t\_0}}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot {x.im}^{y.re}\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (* y.re (atan2 x.im x.re))))
   (if (<= y.re -0.00043)
     (* t_0 (pow x.re y.re))
     (if (<= y.re 1.15) (/ y.im (/ y.im t_0)) (* t_0 (pow x.im y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = y_46_re * atan2(x_46_im, x_46_re);
	double tmp;
	if (y_46_re <= -0.00043) {
		tmp = t_0 * pow(x_46_re, y_46_re);
	} else if (y_46_re <= 1.15) {
		tmp = y_46_im / (y_46_im / t_0);
	} else {
		tmp = t_0 * pow(x_46_im, y_46_re);
	}
	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) :: tmp
    t_0 = y_46re * atan2(x_46im, x_46re)
    if (y_46re <= (-0.00043d0)) then
        tmp = t_0 * (x_46re ** y_46re)
    else if (y_46re <= 1.15d0) then
        tmp = y_46im / (y_46im / t_0)
    else
        tmp = t_0 * (x_46im ** y_46re)
    end if
    code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
	double tmp;
	if (y_46_re <= -0.00043) {
		tmp = t_0 * Math.pow(x_46_re, y_46_re);
	} else if (y_46_re <= 1.15) {
		tmp = y_46_im / (y_46_im / t_0);
	} else {
		tmp = t_0 * Math.pow(x_46_im, y_46_re);
	}
	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)
	tmp = 0
	if y_46_re <= -0.00043:
		tmp = t_0 * math.pow(x_46_re, y_46_re)
	elif y_46_re <= 1.15:
		tmp = y_46_im / (y_46_im / t_0)
	else:
		tmp = t_0 * math.pow(x_46_im, y_46_re)
	return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = Float64(y_46_re * atan(x_46_im, x_46_re))
	tmp = 0.0
	if (y_46_re <= -0.00043)
		tmp = Float64(t_0 * (x_46_re ^ y_46_re));
	elseif (y_46_re <= 1.15)
		tmp = Float64(y_46_im / Float64(y_46_im / t_0));
	else
		tmp = Float64(t_0 * (x_46_im ^ y_46_re));
	end
	return tmp
end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = y_46_re * atan2(x_46_im, x_46_re);
	tmp = 0.0;
	if (y_46_re <= -0.00043)
		tmp = t_0 * (x_46_re ^ y_46_re);
	elseif (y_46_re <= 1.15)
		tmp = y_46_im / (y_46_im / t_0);
	else
		tmp = t_0 * (x_46_im ^ y_46_re);
	end
	tmp_2 = tmp;
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.00043], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.15], N[(y$46$im / N[(y$46$im / t$95$0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -0.00043:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\

\mathbf{elif}\;y.re \leq 1.15:\\
\;\;\;\;\frac{y.im}{\frac{y.im}{t\_0}}\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\


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

    1. Initial program 44.7%

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

        \[\leadsto \color{blue}{\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} \]
      2. lower-atan2.f6476.5

        \[\leadsto \left(y.re \cdot \color{blue}{\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} \]
    8. Simplified76.5%

      \[\leadsto \color{blue}{\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} \]
    9. Taylor expanded in x.im around 0

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

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

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

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

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

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

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

    if -4.29999999999999989e-4 < y.re < 1.1499999999999999

    1. Initial program 46.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-*.f6426.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. Simplified26.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 \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

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

      \[\leadsto \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
    9. Step-by-step derivation
      1. lift-atan2.f64N/A

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

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

        \[\leadsto \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot 1} \]
      4. lft-mult-inverseN/A

        \[\leadsto \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \color{blue}{\left(\frac{1}{y.im} \cdot y.im\right)} \]
      5. associate-*l*N/A

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{y.im}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}}} \cdot y.im \]
      8. associate-*l/N/A

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

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

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

        \[\leadsto \frac{y.im}{\color{blue}{\frac{y.im}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}}} \]
    10. Applied egg-rr36.0%

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

    if 1.1499999999999999 < y.re

    1. Initial program 29.9%

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

        \[\leadsto \color{blue}{\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} \]
      2. lower-atan2.f6453.8

        \[\leadsto \left(y.re \cdot \color{blue}{\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} \]
    8. Simplified53.8%

      \[\leadsto \color{blue}{\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} \]
    9. Taylor expanded in x.re around 0

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

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

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

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

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

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

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

Alternative 14: 40.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 -85000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq 1.15:\\ \;\;\;\;\frac{y.im}{\frac{y.im}{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 -85000000000.0)
     t_1
     (if (<= y.re 1.15) (/ y.im (/ y.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_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 <= -85000000000.0) {
		tmp = t_1;
	} else if (y_46_re <= 1.15) {
		tmp = y_46_im / (y_46_im / 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 <= (-85000000000.0d0)) then
        tmp = t_1
    else if (y_46re <= 1.15d0) then
        tmp = y_46im / (y_46im / 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 <= -85000000000.0) {
		tmp = t_1;
	} else if (y_46_re <= 1.15) {
		tmp = y_46_im / (y_46_im / 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 <= -85000000000.0:
		tmp = t_1
	elif y_46_re <= 1.15:
		tmp = y_46_im / (y_46_im / 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 <= -85000000000.0)
		tmp = t_1;
	elseif (y_46_re <= 1.15)
		tmp = Float64(y_46_im / Float64(y_46_im / 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 <= -85000000000.0)
		tmp = t_1;
	elseif (y_46_re <= 1.15)
		tmp = y_46_im / (y_46_im / 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, -85000000000.0], t$95$1, If[LessEqual[y$46$re, 1.15], N[(y$46$im / N[(y$46$im / t$95$0), $MachinePrecision]), $MachinePrecision], 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 -85000000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y.re \leq 1.15:\\
\;\;\;\;\frac{y.im}{\frac{y.im}{t\_0}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y.re < -8.5e10 or 1.1499999999999999 < y.re

    1. Initial program 38.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-*.f6467.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. Simplified67.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 \color{blue}{\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} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\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} \]
      2. lower-atan2.f6465.6

        \[\leadsto \left(y.re \cdot \color{blue}{\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} \]
    8. Simplified65.6%

      \[\leadsto \color{blue}{\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} \]
    9. Taylor expanded in x.re around 0

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

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

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

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

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

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

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

    if -8.5e10 < y.re < 1.1499999999999999

    1. Initial program 45.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-*.f6427.6

        \[\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. Simplified27.6%

      \[\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 \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

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

      \[\leadsto \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
    9. Step-by-step derivation
      1. lift-atan2.f64N/A

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

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

        \[\leadsto \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot 1} \]
      4. lft-mult-inverseN/A

        \[\leadsto \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \color{blue}{\left(\frac{1}{y.im} \cdot y.im\right)} \]
      5. associate-*l*N/A

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{y.im}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}}} \cdot y.im \]
      8. associate-*l/N/A

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

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

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

        \[\leadsto \frac{y.im}{\color{blue}{\frac{y.im}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}}} \]
    10. Applied egg-rr35.0%

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

Alternative 15: 30.1% accurate, 4.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := y.re \cdot \frac{t\_0 \cdot \left(\left(x.im \cdot x.im\right) \cdot 0.5\right)}{x.re \cdot x.re}\\ \mathbf{if}\;y.re \leq -850000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq 0.00016:\\ \;\;\;\;\frac{y.im}{\frac{y.im}{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 (* y.re (/ (* t_0 (* (* x.im x.im) 0.5)) (* x.re x.re)))))
   (if (<= y.re -850000000.0)
     t_1
     (if (<= y.re 0.00016) (/ y.im (/ y.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_re * atan2(x_46_im, x_46_re);
	double t_1 = y_46_re * ((t_0 * ((x_46_im * x_46_im) * 0.5)) / (x_46_re * x_46_re));
	double tmp;
	if (y_46_re <= -850000000.0) {
		tmp = t_1;
	} else if (y_46_re <= 0.00016) {
		tmp = y_46_im / (y_46_im / 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 = y_46re * ((t_0 * ((x_46im * x_46im) * 0.5d0)) / (x_46re * x_46re))
    if (y_46re <= (-850000000.0d0)) then
        tmp = t_1
    else if (y_46re <= 0.00016d0) then
        tmp = y_46im / (y_46im / 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 = y_46_re * ((t_0 * ((x_46_im * x_46_im) * 0.5)) / (x_46_re * x_46_re));
	double tmp;
	if (y_46_re <= -850000000.0) {
		tmp = t_1;
	} else if (y_46_re <= 0.00016) {
		tmp = y_46_im / (y_46_im / 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 = y_46_re * ((t_0 * ((x_46_im * x_46_im) * 0.5)) / (x_46_re * x_46_re))
	tmp = 0
	if y_46_re <= -850000000.0:
		tmp = t_1
	elif y_46_re <= 0.00016:
		tmp = y_46_im / (y_46_im / 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(y_46_re * Float64(Float64(t_0 * Float64(Float64(x_46_im * x_46_im) * 0.5)) / Float64(x_46_re * x_46_re)))
	tmp = 0.0
	if (y_46_re <= -850000000.0)
		tmp = t_1;
	elseif (y_46_re <= 0.00016)
		tmp = Float64(y_46_im / Float64(y_46_im / 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 = y_46_re * ((t_0 * ((x_46_im * x_46_im) * 0.5)) / (x_46_re * x_46_re));
	tmp = 0.0;
	if (y_46_re <= -850000000.0)
		tmp = t_1;
	elseif (y_46_re <= 0.00016)
		tmp = y_46_im / (y_46_im / 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[(y$46$re * N[(N[(t$95$0 * N[(N[(x$46$im * x$46$im), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -850000000.0], t$95$1, If[LessEqual[y$46$re, 0.00016], N[(y$46$im / N[(y$46$im / t$95$0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;y.re \leq 0.00016:\\
\;\;\;\;\frac{y.im}{\frac{y.im}{t\_0}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y.re < -8.5e8 or 1.60000000000000013e-4 < y.re

    1. Initial program 37.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y.re \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{{x.im}^{2} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}{{x.re}^{2}}\right)} \]
    13. Step-by-step derivation
      1. associate-*r/N/A

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

        \[\leadsto y.re \cdot \color{blue}{\frac{\frac{1}{2} \cdot \left({x.im}^{2} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}{{x.re}^{2}}} \]
      3. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

    if -8.5e8 < y.re < 1.60000000000000013e-4

    1. Initial program 46.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-*.f6427.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. Simplified27.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 \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

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

      \[\leadsto \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
    9. Step-by-step derivation
      1. lift-atan2.f64N/A

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

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

        \[\leadsto \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot 1} \]
      4. lft-mult-inverseN/A

        \[\leadsto \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \color{blue}{\left(\frac{1}{y.im} \cdot y.im\right)} \]
      5. associate-*l*N/A

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{y.im}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}}} \cdot y.im \]
      8. associate-*l/N/A

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

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

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

        \[\leadsto \frac{y.im}{\color{blue}{\frac{y.im}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}}} \]
    10. Applied egg-rr35.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -850000000:\\ \;\;\;\;y.re \cdot \frac{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \left(\left(x.im \cdot x.im\right) \cdot 0.5\right)}{x.re \cdot x.re}\\ \mathbf{elif}\;y.re \leq 0.00016:\\ \;\;\;\;\frac{y.im}{\frac{y.im}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\\ \mathbf{else}:\\ \;\;\;\;y.re \cdot \frac{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \left(\left(x.im \cdot x.im\right) \cdot 0.5\right)}{x.re \cdot x.re}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 20.6% accurate, 5.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq 5.2 \cdot 10^{+137}:\\ \;\;\;\;y.im \cdot \frac{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.im}\\ \mathbf{else}:\\ \;\;\;\;\left(y.re \cdot y.im\right) \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (if (<= y.re 5.2e+137)
   (* y.im (/ (* y.re (atan2 x.im x.re)) y.im))
   (* (* y.re y.im) (/ (atan2 x.im x.re) y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double tmp;
	if (y_46_re <= 5.2e+137) {
		tmp = y_46_im * ((y_46_re * atan2(x_46_im, x_46_re)) / y_46_im);
	} else {
		tmp = (y_46_re * y_46_im) * (atan2(x_46_im, x_46_re) / y_46_im);
	}
	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) :: tmp
    if (y_46re <= 5.2d+137) then
        tmp = y_46im * ((y_46re * atan2(x_46im, x_46re)) / y_46im)
    else
        tmp = (y_46re * y_46im) * (atan2(x_46im, x_46re) / y_46im)
    end if
    code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double tmp;
	if (y_46_re <= 5.2e+137) {
		tmp = y_46_im * ((y_46_re * Math.atan2(x_46_im, x_46_re)) / y_46_im);
	} else {
		tmp = (y_46_re * y_46_im) * (Math.atan2(x_46_im, x_46_re) / y_46_im);
	}
	return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	tmp = 0
	if y_46_re <= 5.2e+137:
		tmp = y_46_im * ((y_46_re * math.atan2(x_46_im, x_46_re)) / y_46_im)
	else:
		tmp = (y_46_re * y_46_im) * (math.atan2(x_46_im, x_46_re) / y_46_im)
	return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	tmp = 0.0
	if (y_46_re <= 5.2e+137)
		tmp = Float64(y_46_im * Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) / y_46_im));
	else
		tmp = Float64(Float64(y_46_re * y_46_im) * Float64(atan(x_46_im, x_46_re) / y_46_im));
	end
	return tmp
end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
	tmp = 0.0;
	if (y_46_re <= 5.2e+137)
		tmp = y_46_im * ((y_46_re * atan2(x_46_im, x_46_re)) / y_46_im);
	else
		tmp = (y_46_re * y_46_im) * (atan2(x_46_im, x_46_re) / y_46_im);
	end
	tmp_2 = tmp;
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 5.2e+137], N[(y$46$im * N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision], N[(N[(y$46$re * y$46$im), $MachinePrecision] * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 5.2 \cdot 10^{+137}:\\
\;\;\;\;y.im \cdot \frac{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.im}\\

\mathbf{else}:\\
\;\;\;\;\left(y.re \cdot y.im\right) \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y.re < 5.1999999999999998e137

    1. Initial program 43.3%

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

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

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

      \[\leadsto \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
    9. Step-by-step derivation
      1. lift-atan2.f64N/A

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

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

        \[\leadsto \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot 1} \]
      4. lft-mult-inverseN/A

        \[\leadsto \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \color{blue}{\left(\frac{1}{y.im} \cdot y.im\right)} \]
      5. associate-*l*N/A

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

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

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

        \[\leadsto \color{blue}{\frac{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.im} \cdot y.im} \]
    10. Applied egg-rr22.7%

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

    if 5.1999999999999998e137 < y.re

    1. Initial program 29.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.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. Simplified54.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 \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

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

      \[\leadsto \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
    9. Step-by-step derivation
      1. lift-atan2.f64N/A

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

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

        \[\leadsto \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot 1} \]
      4. lft-mult-inverseN/A

        \[\leadsto \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \color{blue}{\left(\frac{1}{y.im} \cdot y.im\right)} \]
      5. associate-*l*N/A

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

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

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

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

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

        \[\leadsto y.im \cdot \frac{\color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}}{y.im} \]
      11. associate-/l*N/A

        \[\leadsto y.im \cdot \color{blue}{\left(y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)} \]
      12. associate-*r*N/A

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq 5.2 \cdot 10^{+137}:\\ \;\;\;\;y.im \cdot \frac{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.im}\\ \mathbf{else}:\\ \;\;\;\;\left(y.re \cdot y.im\right) \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 16.2% accurate, 5.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\\ \mathbf{if}\;y.re \leq 4.6 \cdot 10^{+108}:\\ \;\;\;\;y.re \cdot \left(y.im \cdot t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y.re \cdot y.im\right) \cdot t\_0\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (/ (atan2 x.im x.re) y.im)))
   (if (<= y.re 4.6e+108) (* y.re (* y.im t_0)) (* (* y.re y.im) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = atan2(x_46_im, x_46_re) / y_46_im;
	double tmp;
	if (y_46_re <= 4.6e+108) {
		tmp = y_46_re * (y_46_im * t_0);
	} else {
		tmp = (y_46_re * y_46_im) * t_0;
	}
	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) :: tmp
    t_0 = atan2(x_46im, x_46re) / y_46im
    if (y_46re <= 4.6d+108) then
        tmp = y_46re * (y_46im * t_0)
    else
        tmp = (y_46re * y_46im) * t_0
    end if
    code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = Math.atan2(x_46_im, x_46_re) / y_46_im;
	double tmp;
	if (y_46_re <= 4.6e+108) {
		tmp = y_46_re * (y_46_im * t_0);
	} else {
		tmp = (y_46_re * y_46_im) * t_0;
	}
	return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	t_0 = math.atan2(x_46_im, x_46_re) / y_46_im
	tmp = 0
	if y_46_re <= 4.6e+108:
		tmp = y_46_re * (y_46_im * t_0)
	else:
		tmp = (y_46_re * y_46_im) * t_0
	return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = Float64(atan(x_46_im, x_46_re) / y_46_im)
	tmp = 0.0
	if (y_46_re <= 4.6e+108)
		tmp = Float64(y_46_re * Float64(y_46_im * t_0));
	else
		tmp = Float64(Float64(y_46_re * y_46_im) * t_0);
	end
	return tmp
end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = atan2(x_46_im, x_46_re) / y_46_im;
	tmp = 0.0;
	if (y_46_re <= 4.6e+108)
		tmp = y_46_re * (y_46_im * t_0);
	else
		tmp = (y_46_re * y_46_im) * t_0;
	end
	tmp_2 = tmp;
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$re, 4.6e+108], N[(y$46$re * N[(y$46$im * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(y$46$re * y$46$im), $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y.re < 4.5999999999999998e108

    1. Initial program 43.7%

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

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

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

      \[\leadsto \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
    9. Step-by-step derivation
      1. lift-atan2.f64N/A

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

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

        \[\leadsto \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot 1} \]
      4. lft-mult-inverseN/A

        \[\leadsto \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \color{blue}{\left(\frac{1}{y.im} \cdot y.im\right)} \]
      5. associate-*l*N/A

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

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

        \[\leadsto \frac{\color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}}{y.im} \cdot y.im \]
      8. associate-/l*N/A

        \[\leadsto \color{blue}{\left(y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)} \cdot y.im \]
      9. associate-*l*N/A

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

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

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

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

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

    if 4.5999999999999998e108 < y.re

    1. Initial program 28.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-*.f6452.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. Simplified52.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 \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

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

      \[\leadsto \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
    9. Step-by-step derivation
      1. lift-atan2.f64N/A

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

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

        \[\leadsto \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot 1} \]
      4. lft-mult-inverseN/A

        \[\leadsto \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \color{blue}{\left(\frac{1}{y.im} \cdot y.im\right)} \]
      5. associate-*l*N/A

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

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

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

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

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

        \[\leadsto y.im \cdot \frac{\color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}}{y.im} \]
      11. associate-/l*N/A

        \[\leadsto y.im \cdot \color{blue}{\left(y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)} \]
      12. associate-*r*N/A

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

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

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

        \[\leadsto \left(y.im \cdot y.re\right) \cdot \color{blue}{\frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}} \]
    10. Applied egg-rr22.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq 4.6 \cdot 10^{+108}:\\ \;\;\;\;y.re \cdot \left(y.im \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y.re \cdot y.im\right) \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 14.8% accurate, 5.5× speedup?

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

\\
y.re \cdot \left(y.im \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)
\end{array}
Derivation
  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-*.f6449.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. Simplified49.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 \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
  7. Step-by-step derivation
    1. lower-*.f64N/A

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

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

    \[\leadsto \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
  9. Step-by-step derivation
    1. lift-atan2.f64N/A

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

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

      \[\leadsto \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot 1} \]
    4. lft-mult-inverseN/A

      \[\leadsto \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \color{blue}{\left(\frac{1}{y.im} \cdot y.im\right)} \]
    5. associate-*l*N/A

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

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

      \[\leadsto \frac{\color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}}{y.im} \cdot y.im \]
    8. associate-/l*N/A

      \[\leadsto \color{blue}{\left(y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)} \cdot y.im \]
    9. associate-*l*N/A

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

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

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

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

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

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

Alternative 19: 13.6% 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 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-*.f6449.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. Simplified49.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 \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}} \]
  7. Step-by-step derivation
    1. lower-*.f64N/A

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

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

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

Reproduce

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