powComplex, imaginary part

Percentage Accurate: 39.8% → 65.1%
Time: 18.9s
Alternatives: 12
Speedup: 3.0×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\ e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \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 12 alternatives:

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

Initial Program: 39.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\ e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
   (*
    (exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
    (sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
	return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
    real(8), intent (in) :: x_46re
    real(8), intent (in) :: x_46im
    real(8), intent (in) :: y_46re
    real(8), intent (in) :: y_46im
    real(8) :: t_0
    t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
    code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
	return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))
	return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))
	return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re))))
end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
	tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

Alternative 1: 65.1% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x.re \leq 1.5 \cdot 10^{-309}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(t\_3 \cdot t\_3\right)}^{\left(y.re \cdot 0.25\right)}\right)\\

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


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

    1. Initial program 35.5%

      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    2. Add Preprocessing
    3. Taylor expanded in x.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. *-lowering-*.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. exp-lowering-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. neg-lowering-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. accelerator-lowering-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. log-lowering-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. /-lowering-/.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. *-lowering-*.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. atan2-lowering-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. sin-lowering-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. Simplified73.9%

      \[\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)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \color{blue}{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \log \left(\frac{-1}{x.re}\right) \cdot \left(\mathsf{neg}\left(y.im\right)\right)\right) \cdot e^{\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)}} \]
    7. Applied egg-rr73.9%

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

    if -1.25000000000000003e-147 < x.re < 1.5e-309

    1. Initial program 29.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.re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.5e-309 < x.re

    1. Initial program 39.9%

      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    2. Add Preprocessing
    3. Taylor expanded in 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. *-lowering-*.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. exp-lowering-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. --lowering--.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. *-lowering-*.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. log-lowering-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. *-lowering-*.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. atan2-lowering-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. sin-lowering-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. accelerator-lowering-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. log-lowering-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. *-lowering-*.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. atan2-lowering-atan2.f6473.4

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.re \leq -1.25 \cdot 10^{-147}:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(-x.re\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot e^{-\mathsf{fma}\left(y.re, -\log \left(-x.re\right), y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{elif}\;x.re \leq 1.5 \cdot 10^{-309}:\\ \;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right) \cdot \mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(y.re \cdot 0.25\right)}\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: 43.6% accurate, 0.7× speedup?

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

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


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

    1. Initial program 64.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.re around 0

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

        \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(y.re \cdot \left(\frac{-1}{2} \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
      2. accelerator-lowering-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 \color{blue}{\mathsf{fma}\left(y.re, \frac{-1}{2} \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
    5. Simplified73.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y.re \cdot \left(\color{blue}{\left|\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}\right) \]
      4. fabs-lowering-fabs.f64N/A

        \[\leadsto y.re \cdot \left(\color{blue}{\left|\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}\right) \]
      5. atan2-lowering-atan2.f6440.1

        \[\leadsto y.re \cdot \left(\left|\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}\right) \]
    10. Applied egg-rr40.1%

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

    if -1.9999999999999999e-143 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re))))

    1. Initial program 33.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.re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 58.2% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\\
\mathbf{if}\;x.re \leq -4.6 \cdot 10^{-32}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\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 \cdot 10^{-310}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(t\_0 \cdot t\_0\right)}^{\left(y.re \cdot 0.25\right)}\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}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x.re < -4.6000000000000001e-32

    1. Initial program 34.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. *-lowering-*.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. exp-lowering-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. neg-lowering-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. accelerator-lowering-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. log-lowering-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. /-lowering-/.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. *-lowering-*.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. atan2-lowering-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. sin-lowering-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. Simplified74.5%

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

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

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

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

        \[\leadsto e^{\mathsf{neg}\left(\color{blue}{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(\mathsf{neg}\left(y.im\right)\right)\right)\right) \]
      4. atan2-lowering-atan2.f6457.8

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

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

    if -4.6000000000000001e-32 < x.re < -1.999999999999994e-310

    1. Initial program 34.1%

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

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

        \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(y.re \cdot \left(\frac{-1}{2} \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
      2. accelerator-lowering-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 \color{blue}{\mathsf{fma}\left(y.re, \frac{-1}{2} \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
    5. Simplified29.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < x.re

    1. Initial program 39.9%

      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    2. Add Preprocessing
    3. Taylor expanded in 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. *-lowering-*.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. exp-lowering-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. --lowering--.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. *-lowering-*.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. log-lowering-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. *-lowering-*.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. atan2-lowering-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. sin-lowering-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. accelerator-lowering-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. log-lowering-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. *-lowering-*.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. atan2-lowering-atan2.f6473.4

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.re \leq -4.6 \cdot 10^{-32}:\\ \;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\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 \cdot 10^{-310}:\\ \;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right) \cdot \mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(y.re \cdot 0.25\right)}\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: 58.8% accurate, 2.0× speedup?

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

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

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

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


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

    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.re around 0

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

        \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(y.re \cdot \left(\frac{-1}{2} \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
      2. accelerator-lowering-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 \color{blue}{\mathsf{fma}\left(y.re, \frac{-1}{2} \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
    5. Simplified33.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y.re \cdot \left(\color{blue}{\left|\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}\right) \]
      4. fabs-lowering-fabs.f64N/A

        \[\leadsto y.re \cdot \left(\color{blue}{\left|\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}\right) \]
      5. atan2-lowering-atan2.f6486.3

        \[\leadsto y.re \cdot \left(\left|\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}\right) \]
    10. Applied egg-rr86.3%

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

    if -1.8500000000000001 < y.re < 2.10000000000000009

    1. Initial program 39.3%

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

      \[\leadsto e^{\log \left(\sqrt{x.re \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. *-lowering-*.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. atan2-lowering-atan2.f6434.7

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

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

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

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

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

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

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

    if 2.10000000000000009 < y.re

    1. Initial program 28.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. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. atan2-lowering-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. pow-lowering-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. sqrt-lowering-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. accelerator-lowering-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. *-lowering-*.f6454.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. Simplified54.1%

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

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

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

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

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

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

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

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

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

      \[\leadsto \sin \left(y.re \cdot \color{blue}{{\left({\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)}^{0.5}}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \]
    8. Step-by-step derivation
      1. unpow1/2N/A

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

        \[\leadsto \sin \left(y.re \cdot \sqrt{\color{blue}{\tan^{-1}_* \frac{x.im}{x.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. rem-sqrt-squareN/A

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

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

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

      \[\leadsto \sin \left(y.re \cdot \color{blue}{\left|\tan^{-1}_* \frac{x.im}{x.re}\right|}\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 simplification63.3%

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

Alternative 5: 58.9% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot \left(\left|\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}\right)\\ \mathbf{if}\;y.re \leq -1.9:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 2.2:\\ \;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0
         (*
          y.re
          (*
           (fabs (atan2 x.im x.re))
           (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re)))))
   (if (<= y.re -1.9)
     t_0
     (if (<= y.re 2.2)
       (* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.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 = y_46_re * (fabs(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 <= -1.9) {
		tmp = t_0;
	} else if (y_46_re <= 2.2) {
		tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
	} 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(abs(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 <= -1.9)
		tmp = t_0;
	elseif (y_46_re <= 2.2)
		tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))));
	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[Abs[N[ArcTan[x$46$im / x$46$re], $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]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.9], t$95$0, If[LessEqual[y$46$re, 2.2], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y.re \cdot \left(\left|\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}\right)\\
\mathbf{if}\;y.re \leq -1.9:\\
\;\;\;\;t\_0\\

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

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


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

    1. Initial program 35.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.re around 0

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

        \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(y.re \cdot \left(\frac{-1}{2} \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
      2. accelerator-lowering-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 \color{blue}{\mathsf{fma}\left(y.re, \frac{-1}{2} \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
    5. Simplified33.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y.re \cdot \left(\color{blue}{\left|\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}\right) \]
      4. fabs-lowering-fabs.f64N/A

        \[\leadsto y.re \cdot \left(\color{blue}{\left|\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}\right) \]
      5. atan2-lowering-atan2.f6474.3

        \[\leadsto y.re \cdot \left(\left|\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}\right) \]
    10. Applied egg-rr74.3%

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

    if -1.8999999999999999 < y.re < 2.2000000000000002

    1. Initial program 39.3%

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

      \[\leadsto e^{\log \left(\sqrt{x.re \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. *-lowering-*.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. atan2-lowering-atan2.f6434.7

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

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

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

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

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

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

      \[\leadsto \color{blue}{y.re \cdot \left(e^{-y.im \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 simplification63.3%

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

Alternative 6: 42.4% accurate, 2.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x.im < -2.1999999999999999e79

    1. Initial program 16.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.re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.1999999999999999e79 < x.im < -1.10000000000000007e-200

    1. Initial program 57.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.re around 0

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

        \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(y.re \cdot \left(\frac{-1}{2} \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
      2. accelerator-lowering-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 \color{blue}{\mathsf{fma}\left(y.re, \frac{-1}{2} \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
    5. Simplified54.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y.re \cdot \left(\color{blue}{\left|\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}\right) \]
      4. fabs-lowering-fabs.f64N/A

        \[\leadsto y.re \cdot \left(\color{blue}{\left|\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}\right) \]
      5. atan2-lowering-atan2.f6443.8

        \[\leadsto y.re \cdot \left(\left|\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}\right) \]
    10. Applied egg-rr43.8%

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

    if -1.10000000000000007e-200 < x.im

    1. Initial program 35.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.re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 44.3% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -4.5 \cdot 10^{+120}:\\
\;\;\;\;\tan^{-1}_* \frac{x.im}{x.re} \cdot \frac{y.re}{{\left(\frac{-1}{x.im}\right)}^{y.re}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x.im < -4.49999999999999977e120

    1. Initial program 9.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.re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.49999999999999977e120 < x.im

    1. Initial program 42.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 44.3% accurate, 2.9× speedup?

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

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

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


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

    1. Initial program 9.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.re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e113 < x.im

    1. Initial program 42.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 40.8% accurate, 3.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -3.7 \cdot 10^{-25}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(-x.im\right)}^{y.re}\right)\\

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

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


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

    1. Initial program 25.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.re around 0

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

        \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(y.re \cdot \left(\frac{-1}{2} \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
      2. accelerator-lowering-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 \color{blue}{\mathsf{fma}\left(y.re, \frac{-1}{2} \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
    5. Simplified23.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.70000000000000009e-25 < x.im < 1.6000000000000001e-55

    1. Initial program 51.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.re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.6000000000000001e-55 < x.im

    1. Initial program 26.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.re around 0

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

        \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(y.re \cdot \left(\frac{-1}{2} \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
      2. accelerator-lowering-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 \color{blue}{\mathsf{fma}\left(y.re, \frac{-1}{2} \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
    5. Simplified25.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 36.5% accurate, 3.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.66 \cdot 10^{+19}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {x.re}^{y.re}\right)\\

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

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


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

    1. Initial program 43.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.re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.66e19 < y.re < 128000

    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. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. atan2-lowering-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. pow-lowering-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. sqrt-lowering-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. accelerator-lowering-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. *-lowering-*.f6424.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. Simplified24.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 x.re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(x.im + \left(x.re \cdot x.re\right) \cdot \mathsf{fma}\left(\frac{-1}{8}, \frac{x.re \cdot x.re}{x.im \cdot \left(x.im \cdot x.im\right)}, \frac{\color{blue}{\frac{1}{2}}}{x.im}\right)\right)}^{y.re} \]
      16. /-lowering-/.f649.4

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

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

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

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

      if 128000 < y.re

      1. Initial program 29.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.re around 0

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

          \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(y.re \cdot \left(\frac{-1}{2} \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
        2. accelerator-lowering-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 \color{blue}{\mathsf{fma}\left(y.re, \frac{-1}{2} \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
      5. Simplified32.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 11: 37.3% accurate, 3.0× speedup?

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

      1. Initial program 35.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.re around 0

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

          \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(y.re \cdot \left(\frac{-1}{2} \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + \sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
        2. accelerator-lowering-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 \color{blue}{\mathsf{fma}\left(y.re, \frac{-1}{2} \cdot \left(y.re \cdot \left(\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right)\right) + \cos \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}, \sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)} \]
      5. Simplified33.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -0.38 < y.re < 116000

      1. Initial program 38.7%

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

        \[\leadsto \color{blue}{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \]
      4. Step-by-step derivation
        1. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. atan2-lowering-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. pow-lowering-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. sqrt-lowering-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. accelerator-lowering-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. *-lowering-*.f6421.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. Simplified21.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 \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\color{blue}{\left(x.im + {x.re}^{2} \cdot \left(\frac{-1}{8} \cdot \frac{{x.re}^{2}}{{x.im}^{3}} + \frac{1}{2} \cdot \frac{1}{x.im}\right)\right)}}^{y.re} \]
      7. Step-by-step derivation
        1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 12: 13.0% 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 37.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. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. atan2-lowering-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. pow-lowering-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. sqrt-lowering-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. accelerator-lowering-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. *-lowering-*.f6443.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. Simplified43.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. *-lowering-*.f64N/A

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

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

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

      Reproduce

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