powComplex, imaginary part

Percentage Accurate: 41.3% → 77.3%
Time: 22.1s
Alternatives: 16
Speedup: 3.7×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 41.3% 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: 77.3% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y.re \leq 3.1:\\
\;\;\;\;\frac{t\_4}{\frac{e^{t\_0}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\

\mathbf{elif}\;y.re \leq 5.5 \cdot 10^{+279}:\\
\;\;\;\;t\_5\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_3}{{t\_1}^{\left(\frac{y.re}{-2}\right)}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y.re < -1.4000000000000001e-12 or 3.10000000000000009 < y.re < 5.50000000000000038e279

    1. Initial program 43.7%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.re\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)\right), \mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right)\right), \left(y.im \cdot \left(\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right)\right) \]
      4. atan2-lowering-atan2.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.re\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)\right), \mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \left(y.im \cdot \left(\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.re\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)\right), \mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right), \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.re\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)\right), \mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right), \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right)\right) \]
      11. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.re\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)\right), \mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right), \cos \left(\color{blue}{y.re} \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.re\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)\right), \mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right), \cos \left(\color{blue}{y.re} \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right)\right) \]
      13. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.re\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)\right), \mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right), \mathsf{cos.f64}\left(\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.re\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)\right), \mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right)\right)\right) \]
      15. atan2-lowering-atan2.f6481.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.re\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right)\right), \mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right)\right)\right)\right) \]
    5. Simplified81.0%

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

    if -1.4000000000000001e-12 < y.re < 3.10000000000000009

    1. Initial program 39.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. Step-by-step derivation
      1. exp-diffN/A

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

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

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + y.im \cdot \left(\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
    6. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \left(\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      8. log-lowering-log.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right), \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right), \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right), \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      11. hypot-defineN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right), \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      12. hypot-lowering-hypot.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right), \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      13. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right), \mathsf{cos.f64}\left(\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      15. atan2-lowering-atan2.f6488.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
    7. Simplified88.2%

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

    if 5.50000000000000038e279 < y.re

    1. Initial program 30.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. Applied egg-rr60.0%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}, \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
    5. Step-by-step derivation
      1. mul-1-negN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      5. atan2-lowering-atan2.f6480.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
    6. Simplified80.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -1.4 \cdot 10^{-12}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + y.im \cdot \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\\ \mathbf{elif}\;y.re \leq 3.1:\\ \;\;\;\;\frac{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + y.im \cdot \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\ \mathbf{elif}\;y.re \leq 5.5 \cdot 10^{+279}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + y.im \cdot \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}{{\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{-2}\right)}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 76.0% accurate, 0.5× speedup?

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

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

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


\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)))) < +inf.0

    1. Initial program 80.8%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

Alternative 3: 74.2% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y.re < -3.30000000000000009e103 or 3.4e201 < y.re

    1. Initial program 40.5%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \left({\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right)\right) \]
      8. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right)\right) \]
      9. hypot-lowering-hypot.f6470.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right)\right) \]
    5. Simplified70.4%

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{hypot.f64}\left(x.im, x.re\right)}, y.re\right)\right) \]
      2. atan2-lowering-atan2.f6474.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, \color{blue}{x.re}\right), y.re\right)\right) \]
    8. Simplified74.4%

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

    if -3.30000000000000009e103 < y.re < 3.4e201

    1. Initial program 41.3%

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) + y.im \cdot \left(\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)}, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
    6. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \left(\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right) \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      8. log-lowering-log.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right), \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right), \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right), \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      11. hypot-defineN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right), \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      12. hypot-lowering-hypot.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right), \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      13. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right), \mathsf{cos.f64}\left(\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
      15. atan2-lowering-atan2.f6483.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{*.f64}\left(y.im, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.im\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.re, x.im\right), y.re\right)\right)\right) \]
    7. Simplified83.4%

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

Alternative 4: 74.9% accurate, 1.0× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\sin t\_0}{{\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{-2}\right)}}\\


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

    1. Initial program 43.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 \mathsf{*.f64}\left(\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \color{blue}{\left({\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\right)}\right) \]
      2. sin-lowering-sin.f64N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \left({\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right)\right) \]
      8. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right)\right) \]
      9. hypot-lowering-hypot.f6482.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right)\right) \]
    5. Simplified82.2%

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{hypot.f64}\left(x.im, x.re\right)}, y.re\right)\right) \]
      2. atan2-lowering-atan2.f6484.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, \color{blue}{x.re}\right), y.re\right)\right) \]
    8. Simplified84.8%

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

    if -3.30000000000000009e103 < y.re < 5.5e11

    1. Initial program 41.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. Step-by-step derivation
      1. exp-diffN/A

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

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

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

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

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

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

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

    if 5.5e11 < y.re

    1. Initial program 38.2%

      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    2. Add Preprocessing
    3. Applied egg-rr32.9%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}, \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
    5. Step-by-step derivation
      1. mul-1-negN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      5. atan2-lowering-atan2.f6460.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
    6. Simplified60.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -3.3 \cdot 10^{+103}:\\ \;\;\;\;\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq 550000000000:\\ \;\;\;\;\frac{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}{{\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{-2}\right)}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 63.1% accurate, 2.0× speedup?

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

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

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

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


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

    1. Initial program 48.4%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \left({\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right)\right) \]
      8. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right)\right) \]
      9. hypot-lowering-hypot.f6484.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right)\right) \]
    5. Simplified84.1%

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

    if -1.7500000000000001e-25 < y.re < 7.80000000000000037e68

    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. Step-by-step derivation
      1. exp-diffN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right) \]
      11. atan2-lowering-atan2.f6466.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right) \]
    7. Simplified66.3%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)}, \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right), \mathsf{exp.f64}\left(\color{blue}{\mathsf{*.f64}\left(y.im, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)}\right)\right) \]
      2. log-lowering-log.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \color{blue}{\mathsf{atan2.f64}\left(x.im, x.re\right)}\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right) \]
      5. hypot-defineN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{atan2.f64}\left(\color{blue}{x.im}, x.re\right)\right)\right)\right) \]
      6. hypot-lowering-hypot.f6472.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{atan2.f64}\left(\color{blue}{x.im}, x.re\right)\right)\right)\right) \]
    10. Simplified72.6%

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

    if 7.80000000000000037e68 < y.re

    1. Initial program 36.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. Applied egg-rr31.1%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}, \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
    5. Step-by-step derivation
      1. mul-1-negN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      5. atan2-lowering-atan2.f6464.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
    6. Simplified64.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -1.75 \cdot 10^{-25}:\\ \;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq 7.8 \cdot 10^{+68}:\\ \;\;\;\;\frac{y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}{{\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{-2}\right)}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 51.0% accurate, 2.0× speedup?

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

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

\mathbf{elif}\;y.re \leq 1.92 \cdot 10^{-50}:\\
\;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\

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


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

    1. Initial program 52.8%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \left({\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right)\right) \]
      8. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right)\right) \]
      9. hypot-lowering-hypot.f6477.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right)\right) \]
    5. Simplified77.7%

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

    if -7.50000000000000002e-58 < y.re < 1.92e-50

    1. Initial program 35.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 \mathsf{*.f64}\left(\color{blue}{\left({\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\right)}, \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), y.re\right), \mathsf{sin.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)}\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\color{blue}{\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)}\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
      4. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right)}, \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
      5. hypot-lowering-hypot.f6422.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right)}, \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
    5. Simplified22.4%

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

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

        \[\leadsto \mathsf{sin.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
      3. log-lowering-log.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\left({x.im}^{2} + {x.re}^{2}\right)\right)\right)\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left({x.im}^{2}\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x.im \cdot x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left(x.re \cdot x.re\right)\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f6414.7%

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right)\right)\right)\right)\right) \]
    8. Simplified14.7%

      \[\leadsto \color{blue}{\sin \left(y.im \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)} \]
    9. Taylor expanded in y.im around 0

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

        \[\leadsto \mathsf{*.f64}\left(y.im, \color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}\right) \]
      2. log-lowering-log.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right) \]
      5. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right) \]
      6. hypot-lowering-hypot.f6441.2%

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right) \]
    11. Simplified41.2%

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

    if 1.92e-50 < y.re

    1. Initial program 38.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. Applied egg-rr33.3%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}, \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
    5. Step-by-step derivation
      1. mul-1-negN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      5. atan2-lowering-atan2.f6460.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
    6. Simplified60.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -7.5 \cdot 10^{-58}:\\ \;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq 1.92 \cdot 10^{-50}:\\ \;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}{{\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{-2}\right)}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 51.0% accurate, 2.6× speedup?

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

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

\mathbf{elif}\;y.re \leq 4.7 \cdot 10^{-51}:\\
\;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\

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


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

    1. Initial program 47.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. Applied egg-rr32.5%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}, \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
    5. Step-by-step derivation
      1. mul-1-negN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      5. atan2-lowering-atan2.f6461.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
    6. Simplified61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right), \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right) \]
      14. atan2-lowering-atan2.f6466.1%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right), \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right)\right) \]
    8. Applied egg-rr66.1%

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

    if -5.7999999999999996e-150 < y.re < 4.6999999999999997e-51

    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 \mathsf{*.f64}\left(\color{blue}{\left({\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\right)}, \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), y.re\right), \mathsf{sin.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)}\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\color{blue}{\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)}\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
      4. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right)}, \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
      5. hypot-lowering-hypot.f6424.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right)}, \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
    5. Simplified24.8%

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

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

        \[\leadsto \mathsf{sin.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
      3. log-lowering-log.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\left({x.im}^{2} + {x.re}^{2}\right)\right)\right)\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left({x.im}^{2}\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x.im \cdot x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left(x.re \cdot x.re\right)\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f6417.6%

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right)\right)\right)\right)\right) \]
    8. Simplified17.6%

      \[\leadsto \color{blue}{\sin \left(y.im \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)} \]
    9. Taylor expanded in y.im around 0

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

        \[\leadsto \mathsf{*.f64}\left(y.im, \color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}\right) \]
      2. log-lowering-log.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right) \]
      5. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right) \]
      6. hypot-lowering-hypot.f6443.7%

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right) \]
    11. Simplified43.7%

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

    if 4.6999999999999997e-51 < y.re

    1. Initial program 38.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. Applied egg-rr33.3%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}, \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
    5. Step-by-step derivation
      1. mul-1-negN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      5. atan2-lowering-atan2.f6460.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
    6. Simplified60.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -5.8 \cdot 10^{-150}:\\ \;\;\;\;\frac{1}{\frac{{\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{-2}\right)}}{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}}\\ \mathbf{elif}\;y.re \leq 4.7 \cdot 10^{-51}:\\ \;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}{{\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{-2}\right)}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 51.5% accurate, 2.6× speedup?

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

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

\mathbf{elif}\;y.re \leq 1.15 \cdot 10^{-80}:\\
\;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\

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


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

    1. Initial program 47.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. Applied egg-rr32.5%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}, \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
    5. Step-by-step derivation
      1. mul-1-negN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      5. atan2-lowering-atan2.f6461.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
    6. Simplified61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right), \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right) \]
      14. atan2-lowering-atan2.f6466.1%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right), \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right)\right) \]
    8. Applied egg-rr66.1%

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

    if -6.99999999999999994e-145 < y.re < 1.1499999999999999e-80

    1. Initial program 38.0%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left({\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\right)}, \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), y.re\right), \mathsf{sin.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)}\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\color{blue}{\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)}\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
      4. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right)}, \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
      5. hypot-lowering-hypot.f6426.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right)}, \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
    5. Simplified26.1%

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

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

        \[\leadsto \mathsf{sin.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
      3. log-lowering-log.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\left({x.im}^{2} + {x.re}^{2}\right)\right)\right)\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left({x.im}^{2}\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x.im \cdot x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left(x.re \cdot x.re\right)\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f6418.3%

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right)\right)\right)\right)\right) \]
    8. Simplified18.3%

      \[\leadsto \color{blue}{\sin \left(y.im \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)} \]
    9. Taylor expanded in y.im around 0

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

        \[\leadsto \mathsf{*.f64}\left(y.im, \color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}\right) \]
      2. log-lowering-log.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right) \]
      5. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right) \]
      6. hypot-lowering-hypot.f6446.4%

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right) \]
    11. Simplified46.4%

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

    if 1.1499999999999999e-80 < y.re

    1. Initial program 37.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 \mathsf{*.f64}\left(\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \color{blue}{\left({\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\right)}\right) \]
      2. sin-lowering-sin.f64N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \left({\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right)\right) \]
      8. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right)\right) \]
      9. hypot-lowering-hypot.f6454.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right)\right) \]
    5. Simplified54.5%

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{hypot.f64}\left(x.im, x.re\right)}, y.re\right)\right) \]
      2. atan2-lowering-atan2.f6455.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, \color{blue}{x.re}\right), y.re\right)\right) \]
    8. Simplified55.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -7 \cdot 10^{-145}:\\ \;\;\;\;\frac{1}{\frac{{\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{-2}\right)}}{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}}\\ \mathbf{elif}\;y.re \leq 1.15 \cdot 10^{-80}:\\ \;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 51.5% accurate, 2.6× speedup?

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

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

\mathbf{elif}\;y.re \leq 1.9 \cdot 10^{-81}:\\
\;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\

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


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

    1. Initial program 47.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 \mathsf{*.f64}\left(\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \color{blue}{\left({\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\right)}\right) \]
      2. sin-lowering-sin.f64N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \left({\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right)\right) \]
      8. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right)\right) \]
      9. hypot-lowering-hypot.f6465.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right)\right) \]
    5. Simplified65.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right), \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right) \]
      15. atan2-lowering-atan2.f6466.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right), \mathsf{/.f64}\left(y.re, 2\right)\right), \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right) \]
    7. Applied egg-rr66.1%

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

    if -3.39999999999999996e-147 < y.re < 1.8999999999999999e-81

    1. Initial program 38.0%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left({\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\right)}, \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), y.re\right), \mathsf{sin.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)}\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\color{blue}{\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)}\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
      4. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right)}, \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
      5. hypot-lowering-hypot.f6426.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right)}, \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
    5. Simplified26.1%

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

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

        \[\leadsto \mathsf{sin.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
      3. log-lowering-log.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\left({x.im}^{2} + {x.re}^{2}\right)\right)\right)\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left({x.im}^{2}\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x.im \cdot x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left(x.re \cdot x.re\right)\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f6418.3%

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right)\right)\right)\right)\right) \]
    8. Simplified18.3%

      \[\leadsto \color{blue}{\sin \left(y.im \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)} \]
    9. Taylor expanded in y.im around 0

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

        \[\leadsto \mathsf{*.f64}\left(y.im, \color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}\right) \]
      2. log-lowering-log.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right) \]
      5. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right) \]
      6. hypot-lowering-hypot.f6446.4%

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right) \]
    11. Simplified46.4%

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

    if 1.8999999999999999e-81 < y.re

    1. Initial program 37.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 \mathsf{*.f64}\left(\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \color{blue}{\left({\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\right)}\right) \]
      2. sin-lowering-sin.f64N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \left({\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right)\right) \]
      8. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right)\right) \]
      9. hypot-lowering-hypot.f6454.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right)\right) \]
    5. Simplified54.5%

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{hypot.f64}\left(x.im, x.re\right)}, y.re\right)\right) \]
      2. atan2-lowering-atan2.f6455.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, \color{blue}{x.re}\right), y.re\right)\right) \]
    8. Simplified55.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -3.4 \cdot 10^{-147}:\\ \;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}\\ \mathbf{elif}\;y.re \leq 1.9 \cdot 10^{-81}:\\ \;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 51.6% accurate, 2.6× speedup?

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

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

\mathbf{elif}\;y.re \leq 2.7 \cdot 10^{-81}:\\
\;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\

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


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

    1. Initial program 47.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. Applied egg-rr32.5%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}, \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
    5. Step-by-step derivation
      1. mul-1-negN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      5. atan2-lowering-atan2.f6461.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
    6. Simplified61.6%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      3. atan2-lowering-atan2.f6464.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
    9. Simplified64.5%

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

    if -6.99999999999999994e-145 < y.re < 2.6999999999999999e-81

    1. Initial program 38.0%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left({\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\right)}, \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), y.re\right), \mathsf{sin.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)}\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\color{blue}{\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)}\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
      4. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right)}, \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
      5. hypot-lowering-hypot.f6426.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right)}, \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
    5. Simplified26.1%

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

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

        \[\leadsto \mathsf{sin.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
      3. log-lowering-log.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\left({x.im}^{2} + {x.re}^{2}\right)\right)\right)\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left({x.im}^{2}\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x.im \cdot x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left(x.re \cdot x.re\right)\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f6418.3%

        \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right)\right)\right)\right)\right) \]
    8. Simplified18.3%

      \[\leadsto \color{blue}{\sin \left(y.im \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)} \]
    9. Taylor expanded in y.im around 0

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

        \[\leadsto \mathsf{*.f64}\left(y.im, \color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}\right) \]
      2. log-lowering-log.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right) \]
      5. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right) \]
      6. hypot-lowering-hypot.f6446.4%

        \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right) \]
    11. Simplified46.4%

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

    if 2.6999999999999999e-81 < y.re

    1. Initial program 37.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 \mathsf{*.f64}\left(\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \color{blue}{\left({\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\right)}\right) \]
      2. sin-lowering-sin.f64N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \left({\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right)\right) \]
      8. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right)\right) \]
      9. hypot-lowering-hypot.f6454.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right)\right) \]
    5. Simplified54.5%

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{hypot.f64}\left(x.im, x.re\right)}, y.re\right)\right) \]
      2. atan2-lowering-atan2.f6455.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, \color{blue}{x.re}\right), y.re\right)\right) \]
    8. Simplified55.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -7 \cdot 10^{-145}:\\ \;\;\;\;\frac{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}{{\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{-2}\right)}}\\ \mathbf{elif}\;y.re \leq 2.7 \cdot 10^{-81}:\\ \;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 25.0% accurate, 3.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -3.5 \cdot 10^{-58}:\\ \;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{elif}\;y.re \leq 2.25 \cdot 10^{-46}:\\ \;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(1 + y.re \cdot \left(\log \left(x.re \cdot x.re + x.im \cdot x.im\right) \cdot 0.5\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (if (<= y.re -3.5e-58)
   (sin (* y.re (atan2 x.im x.re)))
   (if (<= y.re 2.25e-46)
     (* y.im (log (hypot x.im x.re)))
     (*
      y.re
      (*
       (atan2 x.im x.re)
       (+ 1.0 (* y.re (* (log (+ (* x.re x.re) (* x.im x.im))) 0.5))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double tmp;
	if (y_46_re <= -3.5e-58) {
		tmp = sin((y_46_re * atan2(x_46_im, x_46_re)));
	} else if (y_46_re <= 2.25e-46) {
		tmp = y_46_im * log(hypot(x_46_im, x_46_re));
	} else {
		tmp = y_46_re * (atan2(x_46_im, x_46_re) * (1.0 + (y_46_re * (log(((x_46_re * x_46_re) + (x_46_im * x_46_im))) * 0.5))));
	}
	return tmp;
}
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 <= -3.5e-58) {
		tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
	} else if (y_46_re <= 2.25e-46) {
		tmp = y_46_im * Math.log(Math.hypot(x_46_im, x_46_re));
	} else {
		tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * (1.0 + (y_46_re * (Math.log(((x_46_re * x_46_re) + (x_46_im * x_46_im))) * 0.5))));
	}
	return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	tmp = 0
	if y_46_re <= -3.5e-58:
		tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re)))
	elif y_46_re <= 2.25e-46:
		tmp = y_46_im * math.log(math.hypot(x_46_im, x_46_re))
	else:
		tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * (1.0 + (y_46_re * (math.log(((x_46_re * x_46_re) + (x_46_im * x_46_im))) * 0.5))))
	return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	tmp = 0.0
	if (y_46_re <= -3.5e-58)
		tmp = sin(Float64(y_46_re * atan(x_46_im, x_46_re)));
	elseif (y_46_re <= 2.25e-46)
		tmp = Float64(y_46_im * log(hypot(x_46_im, x_46_re)));
	else
		tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * Float64(1.0 + Float64(y_46_re * Float64(log(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))) * 0.5)))));
	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 <= -3.5e-58)
		tmp = sin((y_46_re * atan2(x_46_im, x_46_re)));
	elseif (y_46_re <= 2.25e-46)
		tmp = y_46_im * log(hypot(x_46_im, x_46_re));
	else
		tmp = y_46_re * (atan2(x_46_im, x_46_re) * (1.0 + (y_46_re * (log(((x_46_re * x_46_re) + (x_46_im * x_46_im))) * 0.5))));
	end
	tmp_2 = tmp;
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -3.5e-58], N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 2.25e-46], N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(1.0 + N[(y$46$re * N[(N[Log[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;y.re \leq 2.25 \cdot 10^{-46}:\\
\;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\

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


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

    1. Initial program 52.8%

      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    2. Add Preprocessing
    3. Applied egg-rr35.7%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}, \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
    5. Step-by-step derivation
      1. mul-1-negN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      5. atan2-lowering-atan2.f6469.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
    6. Simplified69.2%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{1}\right)\right) \]
    8. Step-by-step derivation
      1. Simplified15.8%

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

      if -3.4999999999999999e-58 < y.re < 2.25e-46

      1. Initial program 35.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 \mathsf{*.f64}\left(\color{blue}{\left({\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\right)}, \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
      4. Step-by-step derivation
        1. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), y.re\right), \mathsf{sin.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)}\right)\right) \]
        2. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\color{blue}{\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)}\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
        3. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
        4. hypot-defineN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right)}, \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
        5. hypot-lowering-hypot.f6422.4%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right)}, \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
      5. Simplified22.4%

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

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

          \[\leadsto \mathsf{sin.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
        3. log-lowering-log.f64N/A

          \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right) \]
        4. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\left({x.im}^{2} + {x.re}^{2}\right)\right)\right)\right)\right) \]
        5. +-lowering-+.f64N/A

          \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left({x.im}^{2}\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
        6. unpow2N/A

          \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x.im \cdot x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
        8. unpow2N/A

          \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left(x.re \cdot x.re\right)\right)\right)\right)\right)\right) \]
        9. *-lowering-*.f6414.7%

          \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right)\right)\right)\right)\right) \]
      8. Simplified14.7%

        \[\leadsto \color{blue}{\sin \left(y.im \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)} \]
      9. Taylor expanded in y.im around 0

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

          \[\leadsto \mathsf{*.f64}\left(y.im, \color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}\right) \]
        2. log-lowering-log.f64N/A

          \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
        3. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right) \]
        4. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right) \]
        5. hypot-defineN/A

          \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right) \]
        6. hypot-lowering-hypot.f6441.2%

          \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right) \]
      11. Simplified41.2%

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

      if 2.25e-46 < y.re

      1. Initial program 38.5%

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

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

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \left({\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re}\right)\right) \]
        5. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right)\right) \]
        6. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right)\right) \]
        7. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right)\right) \]
        8. hypot-defineN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right)\right) \]
        9. hypot-lowering-hypot.f6457.8%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right)\right) \]
      5. Simplified57.8%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{*.f64}\left(y.re, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right)\right)\right), \tan^{-1}_* \frac{x.im}{x.re}\right)\right), \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
        12. atan2-lowering-atan2.f64N/A

          \[\leadsto \mathsf{*.f64}\left(y.re, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right)\right)\right), \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
        13. atan2-lowering-atan2.f6425.3%

          \[\leadsto \mathsf{*.f64}\left(y.re, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right)\right)\right), \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{atan2.f64}\left(x.im, \color{blue}{x.re}\right)\right)\right) \]
      8. Simplified25.3%

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -3.5 \cdot 10^{-58}:\\ \;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{elif}\;y.re \leq 2.25 \cdot 10^{-46}:\\ \;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(1 + y.re \cdot \left(\log \left(x.re \cdot x.re + x.im \cdot x.im\right) \cdot 0.5\right)\right)\right)\\ \end{array} \]
    11. Add Preprocessing

    Alternative 12: 51.1% accurate, 3.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}{{\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{-2}\right)}}\\ \mathbf{if}\;y.re \leq -1.5 \cdot 10^{-146}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 4.7 \cdot 10^{-51}:\\ \;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\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 (atan2 x.im x.re))
              (pow (+ (* x.re x.re) (* x.im x.im)) (/ y.re -2.0)))))
       (if (<= y.re -1.5e-146)
         t_0
         (if (<= y.re 4.7e-51) (* y.im (log (hypot 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_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / -2.0));
    	double tmp;
    	if (y_46_re <= -1.5e-146) {
    		tmp = t_0;
    	} else if (y_46_re <= 4.7e-51) {
    		tmp = y_46_im * log(hypot(x_46_im, x_46_re));
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
    	double t_0 = (y_46_re * Math.atan2(x_46_im, x_46_re)) / Math.pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / -2.0));
    	double tmp;
    	if (y_46_re <= -1.5e-146) {
    		tmp = t_0;
    	} else if (y_46_re <= 4.7e-51) {
    		tmp = y_46_im * Math.log(Math.hypot(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_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / -2.0))
    	tmp = 0
    	if y_46_re <= -1.5e-146:
    		tmp = t_0
    	elif y_46_re <= 4.7e-51:
    		tmp = y_46_im * math.log(math.hypot(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(Float64(y_46_re * atan(x_46_im, x_46_re)) / (Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)) ^ Float64(y_46_re / -2.0)))
    	tmp = 0.0
    	if (y_46_re <= -1.5e-146)
    		tmp = t_0;
    	elseif (y_46_re <= 4.7e-51)
    		tmp = Float64(y_46_im * log(hypot(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_re * x_46_re) + (x_46_im * x_46_im)) ^ (y_46_re / -2.0));
    	tmp = 0.0;
    	if (y_46_re <= -1.5e-146)
    		tmp = t_0;
    	elseif (y_46_re <= 4.7e-51)
    		tmp = y_46_im * log(hypot(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[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] / N[Power[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re / -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.5e-146], t$95$0, If[LessEqual[y$46$re, 4.7e-51], N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}{{\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{-2}\right)}}\\
    \mathbf{if}\;y.re \leq -1.5 \cdot 10^{-146}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;y.re \leq 4.7 \cdot 10^{-51}:\\
    \;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y.re < -1.50000000000000009e-146 or 4.6999999999999997e-51 < y.re

      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. Applied egg-rr32.9%

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

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}, \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      5. Step-by-step derivation
        1. mul-1-negN/A

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
        5. atan2-lowering-atan2.f6461.0%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      6. Simplified61.0%

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
        3. atan2-lowering-atan2.f6462.0%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      9. Simplified62.0%

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

      if -1.50000000000000009e-146 < y.re < 4.6999999999999997e-51

      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 \mathsf{*.f64}\left(\color{blue}{\left({\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\right)}, \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
      4. Step-by-step derivation
        1. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), y.re\right), \mathsf{sin.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)}\right)\right) \]
        2. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\color{blue}{\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)}\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
        3. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
        4. hypot-defineN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right)}, \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
        5. hypot-lowering-hypot.f6424.8%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right)}, \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
      5. Simplified24.8%

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

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

          \[\leadsto \mathsf{sin.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
        3. log-lowering-log.f64N/A

          \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right) \]
        4. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\left({x.im}^{2} + {x.re}^{2}\right)\right)\right)\right)\right) \]
        5. +-lowering-+.f64N/A

          \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left({x.im}^{2}\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
        6. unpow2N/A

          \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x.im \cdot x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
        8. unpow2N/A

          \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left(x.re \cdot x.re\right)\right)\right)\right)\right)\right) \]
        9. *-lowering-*.f6417.6%

          \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right)\right)\right)\right)\right) \]
      8. Simplified17.6%

        \[\leadsto \color{blue}{\sin \left(y.im \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)} \]
      9. Taylor expanded in y.im around 0

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

          \[\leadsto \mathsf{*.f64}\left(y.im, \color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}\right) \]
        2. log-lowering-log.f64N/A

          \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
        3. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right) \]
        4. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right) \]
        5. hypot-defineN/A

          \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right) \]
        6. hypot-lowering-hypot.f6443.7%

          \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right) \]
      11. Simplified43.7%

        \[\leadsto \color{blue}{y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification54.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -1.5 \cdot 10^{-146}:\\ \;\;\;\;\frac{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}{{\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{-2}\right)}}\\ \mathbf{elif}\;y.re \leq 4.7 \cdot 10^{-51}:\\ \;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}{{\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{-2}\right)}}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 13: 18.8% accurate, 4.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -9.5 \cdot 10^{-58}:\\ \;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{else}:\\ \;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ \end{array} \end{array} \]
    (FPCore (x.re x.im y.re y.im)
     :precision binary64
     (if (<= y.re -9.5e-58)
       (sin (* y.re (atan2 x.im x.re)))
       (* y.im (log (hypot x.im x.re)))))
    double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
    	double tmp;
    	if (y_46_re <= -9.5e-58) {
    		tmp = sin((y_46_re * atan2(x_46_im, x_46_re)));
    	} else {
    		tmp = y_46_im * log(hypot(x_46_im, x_46_re));
    	}
    	return tmp;
    }
    
    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 <= -9.5e-58) {
    		tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
    	} else {
    		tmp = y_46_im * Math.log(Math.hypot(x_46_im, x_46_re));
    	}
    	return tmp;
    }
    
    def code(x_46_re, x_46_im, y_46_re, y_46_im):
    	tmp = 0
    	if y_46_re <= -9.5e-58:
    		tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re)))
    	else:
    		tmp = y_46_im * math.log(math.hypot(x_46_im, x_46_re))
    	return tmp
    
    function code(x_46_re, x_46_im, y_46_re, y_46_im)
    	tmp = 0.0
    	if (y_46_re <= -9.5e-58)
    		tmp = sin(Float64(y_46_re * atan(x_46_im, x_46_re)));
    	else
    		tmp = Float64(y_46_im * log(hypot(x_46_im, x_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 <= -9.5e-58)
    		tmp = sin((y_46_re * atan2(x_46_im, x_46_re)));
    	else
    		tmp = y_46_im * log(hypot(x_46_im, x_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, -9.5e-58], N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y.re \leq -9.5 \cdot 10^{-58}:\\
    \;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y.re < -9.4999999999999994e-58

      1. Initial program 52.8%

        \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
      2. Add Preprocessing
      3. Applied egg-rr35.7%

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

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}, \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      5. Step-by-step derivation
        1. mul-1-negN/A

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
        5. atan2-lowering-atan2.f6469.2%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right), \mathsf{/.f64}\left(y.re, -2\right)\right)\right)\right) \]
      6. Simplified69.2%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{1}\right)\right) \]
      8. Step-by-step derivation
        1. Simplified15.8%

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

        if -9.4999999999999994e-58 < y.re

        1. Initial program 36.6%

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

          \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left({\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\right)}, \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
        4. Step-by-step derivation
          1. pow-lowering-pow.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), y.re\right), \mathsf{sin.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)}\right)\right) \]
          2. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\color{blue}{\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)}\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
          3. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
          4. hypot-defineN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right)}, \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
          5. hypot-lowering-hypot.f6428.1%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right)}, \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
        5. Simplified28.1%

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

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

            \[\leadsto \mathsf{sin.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
          3. log-lowering-log.f64N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right) \]
          4. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\left({x.im}^{2} + {x.re}^{2}\right)\right)\right)\right)\right) \]
          5. +-lowering-+.f64N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left({x.im}^{2}\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
          6. unpow2N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x.im \cdot x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
          8. unpow2N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left(x.re \cdot x.re\right)\right)\right)\right)\right)\right) \]
          9. *-lowering-*.f649.3%

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right)\right)\right)\right)\right) \]
        8. Simplified9.3%

          \[\leadsto \color{blue}{\sin \left(y.im \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)} \]
        9. Taylor expanded in y.im around 0

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

            \[\leadsto \mathsf{*.f64}\left(y.im, \color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}\right) \]
          2. log-lowering-log.f64N/A

            \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
          3. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right) \]
          4. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right) \]
          5. hypot-defineN/A

            \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right) \]
          6. hypot-lowering-hypot.f6425.2%

            \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right) \]
        11. Simplified25.2%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -9.5 \cdot 10^{-58}:\\ \;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{else}:\\ \;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ \end{array} \]
      11. Add Preprocessing

      Alternative 14: 18.7% accurate, 4.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -3.3 \cdot 10^{-58}:\\ \;\;\;\;y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{else}:\\ \;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ \end{array} \end{array} \]
      (FPCore (x.re x.im y.re y.im)
       :precision binary64
       (if (<= y.re -3.3e-58)
         (* y.re (atan2 x.im x.re))
         (* y.im (log (hypot x.im x.re)))))
      double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
      	double tmp;
      	if (y_46_re <= -3.3e-58) {
      		tmp = y_46_re * atan2(x_46_im, x_46_re);
      	} else {
      		tmp = y_46_im * log(hypot(x_46_im, x_46_re));
      	}
      	return tmp;
      }
      
      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 <= -3.3e-58) {
      		tmp = y_46_re * Math.atan2(x_46_im, x_46_re);
      	} else {
      		tmp = y_46_im * Math.log(Math.hypot(x_46_im, x_46_re));
      	}
      	return tmp;
      }
      
      def code(x_46_re, x_46_im, y_46_re, y_46_im):
      	tmp = 0
      	if y_46_re <= -3.3e-58:
      		tmp = y_46_re * math.atan2(x_46_im, x_46_re)
      	else:
      		tmp = y_46_im * math.log(math.hypot(x_46_im, x_46_re))
      	return tmp
      
      function code(x_46_re, x_46_im, y_46_re, y_46_im)
      	tmp = 0.0
      	if (y_46_re <= -3.3e-58)
      		tmp = Float64(y_46_re * atan(x_46_im, x_46_re));
      	else
      		tmp = Float64(y_46_im * log(hypot(x_46_im, x_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 <= -3.3e-58)
      		tmp = y_46_re * atan2(x_46_im, x_46_re);
      	else
      		tmp = y_46_im * log(hypot(x_46_im, x_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, -3.3e-58], N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y.re \leq -3.3 \cdot 10^{-58}:\\
      \;\;\;\;y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
      
      \mathbf{else}:\\
      \;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y.re < -3.30000000000000026e-58

        1. Initial program 52.8%

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

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \left({\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re}\right)\right) \]
          5. pow-lowering-pow.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right)\right) \]
          6. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right)\right) \]
          7. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right)\right) \]
          8. hypot-defineN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right)\right) \]
          9. hypot-lowering-hypot.f6477.7%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right)\right) \]
        5. Simplified77.7%

          \[\leadsto \color{blue}{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, 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 \mathsf{*.f64}\left(y.re, \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right) \]
          2. atan2-lowering-atan2.f6415.5%

            \[\leadsto \mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, \color{blue}{x.re}\right)\right) \]
        8. Simplified15.5%

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

        if -3.30000000000000026e-58 < y.re

        1. Initial program 36.6%

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

          \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left({\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\right)}, \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
        4. Step-by-step derivation
          1. pow-lowering-pow.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), y.re\right), \mathsf{sin.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)}\right)\right) \]
          2. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\color{blue}{\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)}\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
          3. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
          4. hypot-defineN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right)}, \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
          5. hypot-lowering-hypot.f6428.1%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right)}, \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
        5. Simplified28.1%

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

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

            \[\leadsto \mathsf{sin.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
          3. log-lowering-log.f64N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right) \]
          4. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\left({x.im}^{2} + {x.re}^{2}\right)\right)\right)\right)\right) \]
          5. +-lowering-+.f64N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left({x.im}^{2}\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
          6. unpow2N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x.im \cdot x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
          8. unpow2N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left(x.re \cdot x.re\right)\right)\right)\right)\right)\right) \]
          9. *-lowering-*.f649.3%

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right)\right)\right)\right)\right) \]
        8. Simplified9.3%

          \[\leadsto \color{blue}{\sin \left(y.im \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)} \]
        9. Taylor expanded in y.im around 0

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

            \[\leadsto \mathsf{*.f64}\left(y.im, \color{blue}{\log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}\right) \]
          2. log-lowering-log.f64N/A

            \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
          3. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right)\right)\right) \]
          4. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)\right) \]
          5. hypot-defineN/A

            \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right) \]
          6. hypot-lowering-hypot.f6425.2%

            \[\leadsto \mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right)\right)\right) \]
        11. Simplified25.2%

          \[\leadsto \color{blue}{y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 15: 13.4% accurate, 4.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x.im \leq 5 \cdot 10^{+26}:\\ \;\;\;\;y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{else}:\\ \;\;\;\;\sin \left(y.im \cdot \log x.im\right)\\ \end{array} \end{array} \]
      (FPCore (x.re x.im y.re y.im)
       :precision binary64
       (if (<= x.im 5e+26) (* y.re (atan2 x.im x.re)) (sin (* y.im (log x.im)))))
      double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
      	double tmp;
      	if (x_46_im <= 5e+26) {
      		tmp = y_46_re * atan2(x_46_im, x_46_re);
      	} else {
      		tmp = sin((y_46_im * log(x_46_im)));
      	}
      	return tmp;
      }
      
      real(8) function code(x_46re, x_46im, y_46re, y_46im)
          real(8), intent (in) :: x_46re
          real(8), intent (in) :: x_46im
          real(8), intent (in) :: y_46re
          real(8), intent (in) :: y_46im
          real(8) :: tmp
          if (x_46im <= 5d+26) then
              tmp = y_46re * atan2(x_46im, x_46re)
          else
              tmp = sin((y_46im * log(x_46im)))
          end if
          code = tmp
      end function
      
      public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
      	double tmp;
      	if (x_46_im <= 5e+26) {
      		tmp = y_46_re * Math.atan2(x_46_im, x_46_re);
      	} else {
      		tmp = Math.sin((y_46_im * Math.log(x_46_im)));
      	}
      	return tmp;
      }
      
      def code(x_46_re, x_46_im, y_46_re, y_46_im):
      	tmp = 0
      	if x_46_im <= 5e+26:
      		tmp = y_46_re * math.atan2(x_46_im, x_46_re)
      	else:
      		tmp = math.sin((y_46_im * math.log(x_46_im)))
      	return tmp
      
      function code(x_46_re, x_46_im, y_46_re, y_46_im)
      	tmp = 0.0
      	if (x_46_im <= 5e+26)
      		tmp = Float64(y_46_re * atan(x_46_im, x_46_re));
      	else
      		tmp = sin(Float64(y_46_im * log(x_46_im)));
      	end
      	return tmp
      end
      
      function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
      	tmp = 0.0;
      	if (x_46_im <= 5e+26)
      		tmp = y_46_re * atan2(x_46_im, x_46_re);
      	else
      		tmp = sin((y_46_im * log(x_46_im)));
      	end
      	tmp_2 = tmp;
      end
      
      code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, 5e+26], N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], N[Sin[N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x.im \leq 5 \cdot 10^{+26}:\\
      \;\;\;\;y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
      
      \mathbf{else}:\\
      \;\;\;\;\sin \left(y.im \cdot \log x.im\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x.im < 5.0000000000000001e26

        1. Initial program 47.1%

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

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \left({\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re}\right)\right) \]
          5. pow-lowering-pow.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right)\right) \]
          6. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right)\right) \]
          7. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right)\right) \]
          8. hypot-defineN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right)\right) \]
          9. hypot-lowering-hypot.f6447.6%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right)\right) \]
        5. Simplified47.6%

          \[\leadsto \color{blue}{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, 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 \mathsf{*.f64}\left(y.re, \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right) \]
          2. atan2-lowering-atan2.f6413.6%

            \[\leadsto \mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, \color{blue}{x.re}\right)\right) \]
        8. Simplified13.6%

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

        if 5.0000000000000001e26 < x.im

        1. Initial program 25.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 \mathsf{*.f64}\left(\color{blue}{\left({\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\right)}, \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
        4. Step-by-step derivation
          1. pow-lowering-pow.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), y.re\right), \mathsf{sin.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)}\right)\right) \]
          2. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\color{blue}{\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)}\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
          3. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right), \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
          4. hypot-defineN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right)}, \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
          5. hypot-lowering-hypot.f6417.1%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right), \mathsf{sin.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.re, x.re\right), \mathsf{*.f64}\left(x.im, x.im\right)\right)\right)\right), y.im\right)}, \mathsf{*.f64}\left(\mathsf{atan2.f64}\left(x.im, x.re\right), y.re\right)\right)\right)\right) \]
        5. Simplified17.1%

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

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

            \[\leadsto \mathsf{sin.f64}\left(\left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right) \]
          3. log-lowering-log.f64N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)\right)\right) \]
          4. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\left({x.im}^{2} + {x.re}^{2}\right)\right)\right)\right)\right) \]
          5. +-lowering-+.f64N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left({x.im}^{2}\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
          6. unpow2N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x.im \cdot x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left({x.re}^{2}\right)\right)\right)\right)\right)\right) \]
          8. unpow2N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \left(x.re \cdot x.re\right)\right)\right)\right)\right)\right) \]
          9. *-lowering-*.f645.1%

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x.im, x.im\right), \mathsf{*.f64}\left(x.re, x.re\right)\right)\right)\right)\right)\right) \]
        8. Simplified5.1%

          \[\leadsto \color{blue}{\sin \left(y.im \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)\right)} \]
        9. Taylor expanded in x.re around 0

          \[\leadsto \color{blue}{\sin \left(y.im \cdot \log x.im\right)} \]
        10. Step-by-step derivation
          1. sin-lowering-sin.f64N/A

            \[\leadsto \mathsf{sin.f64}\left(\left(y.im \cdot \log x.im\right)\right) \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \log x.im\right)\right) \]
          3. log-lowering-log.f6416.5%

            \[\leadsto \mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.im, \mathsf{log.f64}\left(x.im\right)\right)\right) \]
        11. Simplified16.5%

          \[\leadsto \color{blue}{\sin \left(y.im \cdot \log x.im\right)} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 16: 13.5% accurate, 8.0× speedup?

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

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

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

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \left({\left(\sqrt{{x.im}^{2} + \color{blue}{{x.re}^{2}}}\right)}^{y.re}\right)\right) \]
        5. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right), \color{blue}{y.re}\right)\right) \]
        6. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + {x.re}^{2}}\right), y.re\right)\right) \]
        7. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right), y.re\right)\right) \]
        8. hypot-defineN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re\right)\right) \]
        9. hypot-lowering-hypot.f6445.1%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, x.re\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{hypot.f64}\left(x.im, x.re\right), y.re\right)\right) \]
      5. Simplified45.1%

        \[\leadsto \color{blue}{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, 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 \mathsf{*.f64}\left(y.re, \color{blue}{\tan^{-1}_* \frac{x.im}{x.re}}\right) \]
        2. atan2-lowering-atan2.f6411.6%

          \[\leadsto \mathsf{*.f64}\left(y.re, \mathsf{atan2.f64}\left(x.im, \color{blue}{x.re}\right)\right) \]
      8. Simplified11.6%

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

      Reproduce

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