powComplex, imaginary part

Percentage Accurate: 40.9% → 65.1%
Time: 19.8s
Alternatives: 19
Speedup: 2.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 alternatives:

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

Initial Program: 40.9% accurate, 1.0× speedup?

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

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

Alternative 1: 65.1% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;x.im \leq 3.9 \cdot 10^{-201}:\\
\;\;\;\;t\_6 \cdot \mathsf{fma}\left(t\_4, \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right), t\_2\right)\\

\mathbf{elif}\;x.im \leq 6 \cdot 10^{-25}:\\
\;\;\;\;t\_6 \cdot \mathsf{fma}\left(y.im, t\_3 \cdot \log x.im, t\_2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x.im < -3.00000000000000018e-225

    1. Initial program 35.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.00000000000000018e-225 < x.im < 3.9000000000000003e-201

    1. Initial program 29.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.9000000000000003e-201 < x.im < 5.9999999999999995e-25

    1. Initial program 50.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.9999999999999995e-25 < x.im

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.im \leq -3 \cdot 10^{-225}:\\ \;\;\;\;e^{-\mathsf{fma}\left(y.re, \log \left(\frac{-1}{x.im}\right), y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot \left(\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) - \log \left(\frac{-1}{x.im}\right) \cdot \left(y.im \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\\ \mathbf{elif}\;x.im \leq 3.9 \cdot 10^{-201}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \mathsf{fma}\left(y.im \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right), \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right), \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\ \mathbf{elif}\;x.im \leq 6 \cdot 10^{-25}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \mathsf{fma}\left(y.im, \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \log x.im, \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log x.im - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \log x.im\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 64.4% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;x.im \leq 2.15 \cdot 10^{-271}:\\
\;\;\;\;y.im \cdot \left(e^{-t\_0} \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\\

\mathbf{elif}\;x.im \leq 6 \cdot 10^{-25}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot \mathsf{fma}\left(y.im, t\_3 \cdot \log x.im, t\_2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x.im < -4.9999999999999999e-224

    1. Initial program 41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999999e-224 < x.im < 2.15e-271

    1. Initial program 41.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.15e-271 < x.im < 5.9999999999999995e-25

    1. Initial program 51.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.9999999999999995e-25 < x.im

    1. Initial program 33.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-rr10.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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