math.exp on complex, imaginary part

Percentage Accurate: 100.0% → 100.0%
Time: 18.3s
Alternatives: 20
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ e^{re} \cdot \sin im \end{array} \]
(FPCore (re im) :precision binary64 (* (exp re) (sin im)))
double code(double re, double im) {
	return exp(re) * sin(im);
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = exp(re) * sin(im)
end function
public static double code(double re, double im) {
	return Math.exp(re) * Math.sin(im);
}
def code(re, im):
	return math.exp(re) * math.sin(im)
function code(re, im)
	return Float64(exp(re) * sin(im))
end
function tmp = code(re, im)
	tmp = exp(re) * sin(im);
end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
e^{re} \cdot \sin im
\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 20 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: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ e^{re} \cdot \sin im \end{array} \]
(FPCore (re im) :precision binary64 (* (exp re) (sin im)))
double code(double re, double im) {
	return exp(re) * sin(im);
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = exp(re) * sin(im)
end function
public static double code(double re, double im) {
	return Math.exp(re) * Math.sin(im);
}
def code(re, im):
	return math.exp(re) * math.sin(im)
function code(re, im)
	return Float64(exp(re) * sin(im))
end
function tmp = code(re, im)
	tmp = exp(re) * sin(im);
end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
e^{re} \cdot \sin im
\end{array}

Alternative 1: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ e^{re} \cdot \sin im \end{array} \]
(FPCore (re im) :precision binary64 (* (exp re) (sin im)))
double code(double re, double im) {
	return exp(re) * sin(im);
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = exp(re) * sin(im)
end function
public static double code(double re, double im) {
	return Math.exp(re) * Math.sin(im);
}
def code(re, im):
	return math.exp(re) * math.sin(im)
function code(re, im)
	return Float64(exp(re) * sin(im))
end
function tmp = code(re, im)
	tmp = exp(re) * sin(im);
end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
e^{re} \cdot \sin im
\end{array}
Derivation
  1. Initial program 99.6%

    \[e^{re} \cdot \sin im \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 2: 89.2% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\\ t_1 := e^{re} \cdot \sin im\\ t_2 := e^{re} \cdot im\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot t\_0\right)\\ \mathbf{elif}\;t\_1 \leq -0.1:\\ \;\;\;\;\sin im\\ \mathbf{elif}\;t\_1 \leq 10^{-78}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 1:\\ \;\;\;\;\sin im \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (fma re (fma re 0.5 1.0) 1.0))
        (t_1 (* (exp re) (sin im)))
        (t_2 (* (exp re) im)))
   (if (<= t_1 (- INFINITY))
     (* im (* (fma im (* im -0.16666666666666666) 1.0) t_0))
     (if (<= t_1 -0.1)
       (sin im)
       (if (<= t_1 1e-78) t_2 (if (<= t_1 1.0) (* (sin im) t_0) t_2))))))
double code(double re, double im) {
	double t_0 = fma(re, fma(re, 0.5, 1.0), 1.0);
	double t_1 = exp(re) * sin(im);
	double t_2 = exp(re) * im;
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = im * (fma(im, (im * -0.16666666666666666), 1.0) * t_0);
	} else if (t_1 <= -0.1) {
		tmp = sin(im);
	} else if (t_1 <= 1e-78) {
		tmp = t_2;
	} else if (t_1 <= 1.0) {
		tmp = sin(im) * t_0;
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(re, im)
	t_0 = fma(re, fma(re, 0.5, 1.0), 1.0)
	t_1 = Float64(exp(re) * sin(im))
	t_2 = Float64(exp(re) * im)
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(im * Float64(fma(im, Float64(im * -0.16666666666666666), 1.0) * t_0));
	elseif (t_1 <= -0.1)
		tmp = sin(im);
	elseif (t_1 <= 1e-78)
		tmp = t_2;
	elseif (t_1 <= 1.0)
		tmp = Float64(sin(im) * t_0);
	else
		tmp = t_2;
	end
	return tmp
end
code[re_, im_] := Block[{t$95$0 = N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(im * N[(N[(im * N[(im * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -0.1], N[Sin[im], $MachinePrecision], If[LessEqual[t$95$1, 1e-78], t$95$2, If[LessEqual[t$95$1, 1.0], N[(N[Sin[im], $MachinePrecision] * t$95$0), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\\
t_1 := e^{re} \cdot \sin im\\
t_2 := e^{re} \cdot im\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot t\_0\right)\\

\mathbf{elif}\;t\_1 \leq -0.1:\\
\;\;\;\;\sin im\\

\mathbf{elif}\;t\_1 \leq 10^{-78}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;\sin im \cdot t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -inf.0

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Add Preprocessing
    3. Taylor expanded in re around 0

      \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)} \cdot \sin im \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right) + 1\right)} \cdot \sin im \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(re, 1 + \frac{1}{2} \cdot re, 1\right)} \cdot \sin im \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(re, \color{blue}{\frac{1}{2} \cdot re + 1}, 1\right) \cdot \sin im \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(re, \color{blue}{re \cdot \frac{1}{2}} + 1, 1\right) \cdot \sin im \]
      5. lower-fma.f6448.1

        \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, 0.5, 1\right)}, 1\right) \cdot \sin im \]
    5. Applied rewrites48.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)} \cdot \sin im \]
    6. Taylor expanded in im around 0

      \[\leadsto \color{blue}{im \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{im \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto im \cdot \left(1 + \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right) + \frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)\right)}\right) \]
      3. associate-+r+N/A

        \[\leadsto im \cdot \color{blue}{\left(\left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right) + \frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)\right)} \]
      4. associate-*r*N/A

        \[\leadsto im \cdot \left(\left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right) + \color{blue}{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)}\right) \]
      5. distribute-rgt1-inN/A

        \[\leadsto im \cdot \color{blue}{\left(\left(\frac{-1}{6} \cdot {im}^{2} + 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)} \]
      6. +-commutativeN/A

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

        \[\leadsto im \cdot \color{blue}{\left(\left(1 + \frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)} \]
      8. +-commutativeN/A

        \[\leadsto im \cdot \left(\color{blue}{\left(\frac{-1}{6} \cdot {im}^{2} + 1\right)} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto im \cdot \left(\left(\frac{-1}{6} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto im \cdot \left(\left(\color{blue}{\left(\frac{-1}{6} \cdot im\right) \cdot im} + 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto im \cdot \left(\left(\color{blue}{im \cdot \left(\frac{-1}{6} \cdot im\right)} + 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      12. lower-fma.f64N/A

        \[\leadsto im \cdot \left(\color{blue}{\mathsf{fma}\left(im, \frac{-1}{6} \cdot im, 1\right)} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto im \cdot \left(\mathsf{fma}\left(im, \color{blue}{im \cdot \frac{-1}{6}}, 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      14. lower-*.f64N/A

        \[\leadsto im \cdot \left(\mathsf{fma}\left(im, \color{blue}{im \cdot \frac{-1}{6}}, 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      15. +-commutativeN/A

        \[\leadsto im \cdot \left(\mathsf{fma}\left(im, im \cdot \frac{-1}{6}, 1\right) \cdot \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right) + 1\right)}\right) \]
    8. Applied rewrites52.0%

      \[\leadsto \color{blue}{im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\right)} \]

    if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.10000000000000001

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Add Preprocessing
    3. Taylor expanded in re around 0

      \[\leadsto \color{blue}{\sin im} \]
    4. Step-by-step derivation
      1. lower-sin.f6496.1

        \[\leadsto \color{blue}{\sin im} \]
    5. Applied rewrites96.1%

      \[\leadsto \color{blue}{\sin im} \]

    if -0.10000000000000001 < (*.f64 (exp.f64 re) (sin.f64 im)) < 9.99999999999999999e-79 or 1 < (*.f64 (exp.f64 re) (sin.f64 im))

    1. Initial program 99.4%

      \[e^{re} \cdot \sin im \]
    2. Add Preprocessing
    3. Taylor expanded in im around 0

      \[\leadsto \color{blue}{im \cdot e^{re}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      2. lower-exp.f6494.1

        \[\leadsto im \cdot \color{blue}{e^{re}} \]
    5. Applied rewrites94.1%

      \[\leadsto \color{blue}{im \cdot e^{re}} \]

    if 9.99999999999999999e-79 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Add Preprocessing
    3. Taylor expanded in re around 0

      \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)} \cdot \sin im \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right) + 1\right)} \cdot \sin im \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(re, 1 + \frac{1}{2} \cdot re, 1\right)} \cdot \sin im \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(re, \color{blue}{\frac{1}{2} \cdot re + 1}, 1\right) \cdot \sin im \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(re, \color{blue}{re \cdot \frac{1}{2}} + 1, 1\right) \cdot \sin im \]
      5. lower-fma.f64100.0

        \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, 0.5, 1\right)}, 1\right) \cdot \sin im \]
    5. Applied rewrites100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)} \cdot \sin im \]
  3. Recombined 4 regimes into one program.
  4. Final simplification89.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq -\infty:\\ \;\;\;\;im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\right)\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq -0.1:\\ \;\;\;\;\sin im\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq 10^{-78}:\\ \;\;\;\;e^{re} \cdot im\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq 1:\\ \;\;\;\;\sin im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\\ \mathbf{else}:\\ \;\;\;\;e^{re} \cdot im\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 89.1% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{re} \cdot \sin im\\ t_1 := e^{re} \cdot im\\ \mathbf{if}\;t\_0 \leq -\infty:\\ \;\;\;\;im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\right)\\ \mathbf{elif}\;t\_0 \leq -0.1:\\ \;\;\;\;\sin im\\ \mathbf{elif}\;t\_0 \leq 10^{-78}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 1:\\ \;\;\;\;\sin im \cdot \left(re + 1\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* (exp re) (sin im))) (t_1 (* (exp re) im)))
   (if (<= t_0 (- INFINITY))
     (*
      im
      (*
       (fma im (* im -0.16666666666666666) 1.0)
       (fma re (fma re 0.5 1.0) 1.0)))
     (if (<= t_0 -0.1)
       (sin im)
       (if (<= t_0 1e-78)
         t_1
         (if (<= t_0 1.0) (* (sin im) (+ re 1.0)) t_1))))))
double code(double re, double im) {
	double t_0 = exp(re) * sin(im);
	double t_1 = exp(re) * im;
	double tmp;
	if (t_0 <= -((double) INFINITY)) {
		tmp = im * (fma(im, (im * -0.16666666666666666), 1.0) * fma(re, fma(re, 0.5, 1.0), 1.0));
	} else if (t_0 <= -0.1) {
		tmp = sin(im);
	} else if (t_0 <= 1e-78) {
		tmp = t_1;
	} else if (t_0 <= 1.0) {
		tmp = sin(im) * (re + 1.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(re, im)
	t_0 = Float64(exp(re) * sin(im))
	t_1 = Float64(exp(re) * im)
	tmp = 0.0
	if (t_0 <= Float64(-Inf))
		tmp = Float64(im * Float64(fma(im, Float64(im * -0.16666666666666666), 1.0) * fma(re, fma(re, 0.5, 1.0), 1.0)));
	elseif (t_0 <= -0.1)
		tmp = sin(im);
	elseif (t_0 <= 1e-78)
		tmp = t_1;
	elseif (t_0 <= 1.0)
		tmp = Float64(sin(im) * Float64(re + 1.0));
	else
		tmp = t_1;
	end
	return tmp
end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(im * N[(N[(im * N[(im * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.1], N[Sin[im], $MachinePrecision], If[LessEqual[t$95$0, 1e-78], t$95$1, If[LessEqual[t$95$0, 1.0], N[(N[Sin[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
t_1 := e^{re} \cdot im\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\right)\\

\mathbf{elif}\;t\_0 \leq -0.1:\\
\;\;\;\;\sin im\\

\mathbf{elif}\;t\_0 \leq 10^{-78}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\sin im \cdot \left(re + 1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -inf.0

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Add Preprocessing
    3. Taylor expanded in re around 0

      \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)} \cdot \sin im \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right) + 1\right)} \cdot \sin im \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(re, 1 + \frac{1}{2} \cdot re, 1\right)} \cdot \sin im \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(re, \color{blue}{\frac{1}{2} \cdot re + 1}, 1\right) \cdot \sin im \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(re, \color{blue}{re \cdot \frac{1}{2}} + 1, 1\right) \cdot \sin im \]
      5. lower-fma.f6448.1

        \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, 0.5, 1\right)}, 1\right) \cdot \sin im \]
    5. Applied rewrites48.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)} \cdot \sin im \]
    6. Taylor expanded in im around 0

      \[\leadsto \color{blue}{im \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{im \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto im \cdot \left(1 + \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right) + \frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)\right)}\right) \]
      3. associate-+r+N/A

        \[\leadsto im \cdot \color{blue}{\left(\left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right) + \frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)\right)} \]
      4. associate-*r*N/A

        \[\leadsto im \cdot \left(\left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right) + \color{blue}{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)}\right) \]
      5. distribute-rgt1-inN/A

        \[\leadsto im \cdot \color{blue}{\left(\left(\frac{-1}{6} \cdot {im}^{2} + 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)} \]
      6. +-commutativeN/A

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

        \[\leadsto im \cdot \color{blue}{\left(\left(1 + \frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)} \]
      8. +-commutativeN/A

        \[\leadsto im \cdot \left(\color{blue}{\left(\frac{-1}{6} \cdot {im}^{2} + 1\right)} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto im \cdot \left(\left(\frac{-1}{6} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto im \cdot \left(\left(\color{blue}{\left(\frac{-1}{6} \cdot im\right) \cdot im} + 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto im \cdot \left(\left(\color{blue}{im \cdot \left(\frac{-1}{6} \cdot im\right)} + 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      12. lower-fma.f64N/A

        \[\leadsto im \cdot \left(\color{blue}{\mathsf{fma}\left(im, \frac{-1}{6} \cdot im, 1\right)} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto im \cdot \left(\mathsf{fma}\left(im, \color{blue}{im \cdot \frac{-1}{6}}, 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      14. lower-*.f64N/A

        \[\leadsto im \cdot \left(\mathsf{fma}\left(im, \color{blue}{im \cdot \frac{-1}{6}}, 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      15. +-commutativeN/A

        \[\leadsto im \cdot \left(\mathsf{fma}\left(im, im \cdot \frac{-1}{6}, 1\right) \cdot \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right) + 1\right)}\right) \]
    8. Applied rewrites52.0%

      \[\leadsto \color{blue}{im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\right)} \]

    if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.10000000000000001

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Add Preprocessing
    3. Taylor expanded in re around 0

      \[\leadsto \color{blue}{\sin im} \]
    4. Step-by-step derivation
      1. lower-sin.f6496.1

        \[\leadsto \color{blue}{\sin im} \]
    5. Applied rewrites96.1%

      \[\leadsto \color{blue}{\sin im} \]

    if -0.10000000000000001 < (*.f64 (exp.f64 re) (sin.f64 im)) < 9.99999999999999999e-79 or 1 < (*.f64 (exp.f64 re) (sin.f64 im))

    1. Initial program 99.4%

      \[e^{re} \cdot \sin im \]
    2. Add Preprocessing
    3. Taylor expanded in im around 0

      \[\leadsto \color{blue}{im \cdot e^{re}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      2. lower-exp.f6494.1

        \[\leadsto im \cdot \color{blue}{e^{re}} \]
    5. Applied rewrites94.1%

      \[\leadsto \color{blue}{im \cdot e^{re}} \]

    if 9.99999999999999999e-79 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Add Preprocessing
    3. Taylor expanded in re around 0

      \[\leadsto \color{blue}{\left(1 + re\right)} \cdot \sin im \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
      2. lower-+.f6499.3

        \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
    5. Applied rewrites99.3%

      \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
  3. Recombined 4 regimes into one program.
  4. Final simplification89.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq -\infty:\\ \;\;\;\;im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\right)\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq -0.1:\\ \;\;\;\;\sin im\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq 10^{-78}:\\ \;\;\;\;e^{re} \cdot im\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq 1:\\ \;\;\;\;\sin im \cdot \left(re + 1\right)\\ \mathbf{else}:\\ \;\;\;\;e^{re} \cdot im\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 89.0% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{re} \cdot \sin im\\ t_1 := e^{re} \cdot im\\ \mathbf{if}\;t\_0 \leq -\infty:\\ \;\;\;\;im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\right)\\ \mathbf{elif}\;t\_0 \leq -0.1:\\ \;\;\;\;\sin im\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-74}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 1:\\ \;\;\;\;\sin im\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* (exp re) (sin im))) (t_1 (* (exp re) im)))
   (if (<= t_0 (- INFINITY))
     (*
      im
      (*
       (fma im (* im -0.16666666666666666) 1.0)
       (fma re (fma re 0.5 1.0) 1.0)))
     (if (<= t_0 -0.1)
       (sin im)
       (if (<= t_0 2e-74) t_1 (if (<= t_0 1.0) (sin im) t_1))))))
double code(double re, double im) {
	double t_0 = exp(re) * sin(im);
	double t_1 = exp(re) * im;
	double tmp;
	if (t_0 <= -((double) INFINITY)) {
		tmp = im * (fma(im, (im * -0.16666666666666666), 1.0) * fma(re, fma(re, 0.5, 1.0), 1.0));
	} else if (t_0 <= -0.1) {
		tmp = sin(im);
	} else if (t_0 <= 2e-74) {
		tmp = t_1;
	} else if (t_0 <= 1.0) {
		tmp = sin(im);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(re, im)
	t_0 = Float64(exp(re) * sin(im))
	t_1 = Float64(exp(re) * im)
	tmp = 0.0
	if (t_0 <= Float64(-Inf))
		tmp = Float64(im * Float64(fma(im, Float64(im * -0.16666666666666666), 1.0) * fma(re, fma(re, 0.5, 1.0), 1.0)));
	elseif (t_0 <= -0.1)
		tmp = sin(im);
	elseif (t_0 <= 2e-74)
		tmp = t_1;
	elseif (t_0 <= 1.0)
		tmp = sin(im);
	else
		tmp = t_1;
	end
	return tmp
end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(im * N[(N[(im * N[(im * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.1], N[Sin[im], $MachinePrecision], If[LessEqual[t$95$0, 2e-74], t$95$1, If[LessEqual[t$95$0, 1.0], N[Sin[im], $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
t_1 := e^{re} \cdot im\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\right)\\

\mathbf{elif}\;t\_0 \leq -0.1:\\
\;\;\;\;\sin im\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-74}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\sin im\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -inf.0

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Add Preprocessing
    3. Taylor expanded in re around 0

      \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)} \cdot \sin im \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right) + 1\right)} \cdot \sin im \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(re, 1 + \frac{1}{2} \cdot re, 1\right)} \cdot \sin im \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(re, \color{blue}{\frac{1}{2} \cdot re + 1}, 1\right) \cdot \sin im \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(re, \color{blue}{re \cdot \frac{1}{2}} + 1, 1\right) \cdot \sin im \]
      5. lower-fma.f6448.1

        \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, 0.5, 1\right)}, 1\right) \cdot \sin im \]
    5. Applied rewrites48.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)} \cdot \sin im \]
    6. Taylor expanded in im around 0

      \[\leadsto \color{blue}{im \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{im \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto im \cdot \left(1 + \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right) + \frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)\right)}\right) \]
      3. associate-+r+N/A

        \[\leadsto im \cdot \color{blue}{\left(\left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right) + \frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)\right)} \]
      4. associate-*r*N/A

        \[\leadsto im \cdot \left(\left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right) + \color{blue}{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)}\right) \]
      5. distribute-rgt1-inN/A

        \[\leadsto im \cdot \color{blue}{\left(\left(\frac{-1}{6} \cdot {im}^{2} + 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)} \]
      6. +-commutativeN/A

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

        \[\leadsto im \cdot \color{blue}{\left(\left(1 + \frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)} \]
      8. +-commutativeN/A

        \[\leadsto im \cdot \left(\color{blue}{\left(\frac{-1}{6} \cdot {im}^{2} + 1\right)} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto im \cdot \left(\left(\frac{-1}{6} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto im \cdot \left(\left(\color{blue}{\left(\frac{-1}{6} \cdot im\right) \cdot im} + 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto im \cdot \left(\left(\color{blue}{im \cdot \left(\frac{-1}{6} \cdot im\right)} + 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      12. lower-fma.f64N/A

        \[\leadsto im \cdot \left(\color{blue}{\mathsf{fma}\left(im, \frac{-1}{6} \cdot im, 1\right)} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto im \cdot \left(\mathsf{fma}\left(im, \color{blue}{im \cdot \frac{-1}{6}}, 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      14. lower-*.f64N/A

        \[\leadsto im \cdot \left(\mathsf{fma}\left(im, \color{blue}{im \cdot \frac{-1}{6}}, 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      15. +-commutativeN/A

        \[\leadsto im \cdot \left(\mathsf{fma}\left(im, im \cdot \frac{-1}{6}, 1\right) \cdot \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right) + 1\right)}\right) \]
    8. Applied rewrites52.0%

      \[\leadsto \color{blue}{im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\right)} \]

    if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.10000000000000001 or 1.99999999999999992e-74 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Add Preprocessing
    3. Taylor expanded in re around 0

      \[\leadsto \color{blue}{\sin im} \]
    4. Step-by-step derivation
      1. lower-sin.f6496.5

        \[\leadsto \color{blue}{\sin im} \]
    5. Applied rewrites96.5%

      \[\leadsto \color{blue}{\sin im} \]

    if -0.10000000000000001 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1.99999999999999992e-74 or 1 < (*.f64 (exp.f64 re) (sin.f64 im))

    1. Initial program 99.4%

      \[e^{re} \cdot \sin im \]
    2. Add Preprocessing
    3. Taylor expanded in im around 0

      \[\leadsto \color{blue}{im \cdot e^{re}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      2. lower-exp.f6494.1

        \[\leadsto im \cdot \color{blue}{e^{re}} \]
    5. Applied rewrites94.1%

      \[\leadsto \color{blue}{im \cdot e^{re}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification88.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq -\infty:\\ \;\;\;\;im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\right)\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq -0.1:\\ \;\;\;\;\sin im\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq 2 \cdot 10^{-74}:\\ \;\;\;\;e^{re} \cdot im\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq 1:\\ \;\;\;\;\sin im\\ \mathbf{else}:\\ \;\;\;\;e^{re} \cdot im\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 59.4% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{re} \cdot \sin im\\ \mathbf{if}\;t\_0 \leq -\infty:\\ \;\;\;\;im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\right)\\ \mathbf{elif}\;t\_0 \leq -0.1:\\ \;\;\;\;\sin im\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;im \cdot \left(re \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\right)\\ \mathbf{elif}\;t\_0 \leq 1:\\ \;\;\;\;\sin im\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(re, \mathsf{fma}\left(re \cdot im, \frac{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), 0.004629629629629629, 0.125\right)}{0.25}, im\right), im\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* (exp re) (sin im))))
   (if (<= t_0 (- INFINITY))
     (*
      im
      (*
       (fma im (* im -0.16666666666666666) 1.0)
       (fma re (fma re 0.5 1.0) 1.0)))
     (if (<= t_0 -0.1)
       (sin im)
       (if (<= t_0 0.0)
         (* im (* re (* 0.008333333333333333 (* (* im im) (* im im)))))
         (if (<= t_0 1.0)
           (sin im)
           (fma
            re
            (fma
             (* re im)
             (/ (fma (* re (* re re)) 0.004629629629629629 0.125) 0.25)
             im)
            im)))))))
double code(double re, double im) {
	double t_0 = exp(re) * sin(im);
	double tmp;
	if (t_0 <= -((double) INFINITY)) {
		tmp = im * (fma(im, (im * -0.16666666666666666), 1.0) * fma(re, fma(re, 0.5, 1.0), 1.0));
	} else if (t_0 <= -0.1) {
		tmp = sin(im);
	} else if (t_0 <= 0.0) {
		tmp = im * (re * (0.008333333333333333 * ((im * im) * (im * im))));
	} else if (t_0 <= 1.0) {
		tmp = sin(im);
	} else {
		tmp = fma(re, fma((re * im), (fma((re * (re * re)), 0.004629629629629629, 0.125) / 0.25), im), im);
	}
	return tmp;
}
function code(re, im)
	t_0 = Float64(exp(re) * sin(im))
	tmp = 0.0
	if (t_0 <= Float64(-Inf))
		tmp = Float64(im * Float64(fma(im, Float64(im * -0.16666666666666666), 1.0) * fma(re, fma(re, 0.5, 1.0), 1.0)));
	elseif (t_0 <= -0.1)
		tmp = sin(im);
	elseif (t_0 <= 0.0)
		tmp = Float64(im * Float64(re * Float64(0.008333333333333333 * Float64(Float64(im * im) * Float64(im * im)))));
	elseif (t_0 <= 1.0)
		tmp = sin(im);
	else
		tmp = fma(re, fma(Float64(re * im), Float64(fma(Float64(re * Float64(re * re)), 0.004629629629629629, 0.125) / 0.25), im), im);
	end
	return tmp
end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(im * N[(N[(im * N[(im * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.1], N[Sin[im], $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(im * N[(re * N[(0.008333333333333333 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.0], N[Sin[im], $MachinePrecision], N[(re * N[(N[(re * im), $MachinePrecision] * N[(N[(N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] * 0.004629629629629629 + 0.125), $MachinePrecision] / 0.25), $MachinePrecision] + im), $MachinePrecision] + im), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := e^{re} \cdot \sin im\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\right)\\

\mathbf{elif}\;t\_0 \leq -0.1:\\
\;\;\;\;\sin im\\

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;im \cdot \left(re \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\right)\\

\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\sin im\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(re, \mathsf{fma}\left(re \cdot im, \frac{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), 0.004629629629629629, 0.125\right)}{0.25}, im\right), im\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -inf.0

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Add Preprocessing
    3. Taylor expanded in re around 0

      \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)} \cdot \sin im \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right) + 1\right)} \cdot \sin im \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(re, 1 + \frac{1}{2} \cdot re, 1\right)} \cdot \sin im \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(re, \color{blue}{\frac{1}{2} \cdot re + 1}, 1\right) \cdot \sin im \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(re, \color{blue}{re \cdot \frac{1}{2}} + 1, 1\right) \cdot \sin im \]
      5. lower-fma.f6448.1

        \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, 0.5, 1\right)}, 1\right) \cdot \sin im \]
    5. Applied rewrites48.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)} \cdot \sin im \]
    6. Taylor expanded in im around 0

      \[\leadsto \color{blue}{im \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{im \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto im \cdot \left(1 + \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right) + \frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)\right)}\right) \]
      3. associate-+r+N/A

        \[\leadsto im \cdot \color{blue}{\left(\left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right) + \frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)\right)} \]
      4. associate-*r*N/A

        \[\leadsto im \cdot \left(\left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right) + \color{blue}{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)}\right) \]
      5. distribute-rgt1-inN/A

        \[\leadsto im \cdot \color{blue}{\left(\left(\frac{-1}{6} \cdot {im}^{2} + 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)} \]
      6. +-commutativeN/A

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

        \[\leadsto im \cdot \color{blue}{\left(\left(1 + \frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)} \]
      8. +-commutativeN/A

        \[\leadsto im \cdot \left(\color{blue}{\left(\frac{-1}{6} \cdot {im}^{2} + 1\right)} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto im \cdot \left(\left(\frac{-1}{6} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto im \cdot \left(\left(\color{blue}{\left(\frac{-1}{6} \cdot im\right) \cdot im} + 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto im \cdot \left(\left(\color{blue}{im \cdot \left(\frac{-1}{6} \cdot im\right)} + 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      12. lower-fma.f64N/A

        \[\leadsto im \cdot \left(\color{blue}{\mathsf{fma}\left(im, \frac{-1}{6} \cdot im, 1\right)} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto im \cdot \left(\mathsf{fma}\left(im, \color{blue}{im \cdot \frac{-1}{6}}, 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      14. lower-*.f64N/A

        \[\leadsto im \cdot \left(\mathsf{fma}\left(im, \color{blue}{im \cdot \frac{-1}{6}}, 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
      15. +-commutativeN/A

        \[\leadsto im \cdot \left(\mathsf{fma}\left(im, im \cdot \frac{-1}{6}, 1\right) \cdot \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right) + 1\right)}\right) \]
    8. Applied rewrites52.0%

      \[\leadsto \color{blue}{im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\right)} \]

    if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.10000000000000001 or 0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Add Preprocessing
    3. Taylor expanded in re around 0

      \[\leadsto \color{blue}{\sin im} \]
    4. Step-by-step derivation
      1. lower-sin.f6496.5

        \[\leadsto \color{blue}{\sin im} \]
    5. Applied rewrites96.5%

      \[\leadsto \color{blue}{\sin im} \]

    if -0.10000000000000001 < (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Add Preprocessing
    3. Taylor expanded in re around 0

      \[\leadsto \color{blue}{\left(1 + re\right)} \cdot \sin im \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
      2. lower-+.f6439.6

        \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
    5. Applied rewrites39.6%

      \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
    6. Taylor expanded in im around 0

      \[\leadsto \color{blue}{im \cdot \left(1 + \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right)\right)} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto im \cdot \color{blue}{\left(\left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + 1\right)} \]
      2. distribute-lft-inN/A

        \[\leadsto \color{blue}{im \cdot \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + im \cdot 1} \]
      3. *-rgt-identityN/A

        \[\leadsto im \cdot \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + \color{blue}{im} \]
      4. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right), im\right)} \]
    8. Applied rewrites38.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(im, \mathsf{fma}\left(im \cdot \mathsf{fma}\left(im, re, im\right), \mathsf{fma}\left(im \cdot im, 0.008333333333333333, -0.16666666666666666\right), re\right), im\right)} \]
    9. Taylor expanded in re around inf

      \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)\right)} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto im \cdot \left(re \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) + 1\right)}\right) \]
      3. distribute-rgt-inN/A

        \[\leadsto im \cdot \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right) \cdot re + 1 \cdot re\right)} \]
      4. associate-*l*N/A

        \[\leadsto im \cdot \left(\color{blue}{{im}^{2} \cdot \left(\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re\right)} + 1 \cdot re\right) \]
      5. *-lft-identityN/A

        \[\leadsto im \cdot \left({im}^{2} \cdot \left(\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re\right) + \color{blue}{re}\right) \]
      6. lower-fma.f64N/A

        \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left({im}^{2}, \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re, re\right)} \]
      7. unpow2N/A

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

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

        \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re}, re\right) \]
      10. sub-negN/A

        \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\left(\frac{1}{120} \cdot {im}^{2} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right)} \cdot re, re\right) \]
      11. *-commutativeN/A

        \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{{im}^{2} \cdot \frac{1}{120}} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
      12. unpow2N/A

        \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{120} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
      13. associate-*l*N/A

        \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{im \cdot \left(im \cdot \frac{1}{120}\right)} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
      14. metadata-evalN/A

        \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(im \cdot \left(im \cdot \frac{1}{120}\right) + \color{blue}{\frac{-1}{6}}\right) \cdot re, re\right) \]
      15. lower-fma.f64N/A

        \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\mathsf{fma}\left(im, im \cdot \frac{1}{120}, \frac{-1}{6}\right)} \cdot re, re\right) \]
      16. lower-*.f643.9

        \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, \color{blue}{im \cdot 0.008333333333333333}, -0.16666666666666666\right) \cdot re, re\right) \]
    11. Applied rewrites3.9%

      \[\leadsto \color{blue}{im \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.008333333333333333, -0.16666666666666666\right) \cdot re, re\right)} \]
    12. Taylor expanded in im around inf

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

        \[\leadsto im \cdot \color{blue}{\left(\left(\frac{1}{120} \cdot {im}^{4}\right) \cdot re\right)} \]
      2. *-commutativeN/A

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

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

        \[\leadsto im \cdot \left(re \cdot \color{blue}{\left(\frac{1}{120} \cdot {im}^{4}\right)}\right) \]
      5. metadata-evalN/A

        \[\leadsto im \cdot \left(re \cdot \left(\frac{1}{120} \cdot {im}^{\color{blue}{\left(2 \cdot 2\right)}}\right)\right) \]
      6. pow-sqrN/A

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

        \[\leadsto im \cdot \left(re \cdot \left(\frac{1}{120} \cdot \color{blue}{\left({im}^{2} \cdot {im}^{2}\right)}\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto im \cdot \left(re \cdot \left(\frac{1}{120} \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot {im}^{2}\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto im \cdot \left(re \cdot \left(\frac{1}{120} \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right)\right)\right) \]
      11. lower-*.f6425.4

        \[\leadsto im \cdot \left(re \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right)\right)\right) \]
    14. Applied rewrites25.4%

      \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\right)} \]

    if 1 < (*.f64 (exp.f64 re) (sin.f64 im))

    1. Initial program 96.8%

      \[e^{re} \cdot \sin im \]
    2. Add Preprocessing
    3. Taylor expanded in im around 0

      \[\leadsto \color{blue}{im \cdot e^{re}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      2. lower-exp.f6473.5

        \[\leadsto im \cdot \color{blue}{e^{re}} \]
    5. Applied rewrites73.5%

      \[\leadsto \color{blue}{im \cdot e^{re}} \]
    6. Taylor expanded in re around 0

      \[\leadsto \color{blue}{im + re \cdot \left(im + re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right)\right)} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{re \cdot \left(im + re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right)\right) + im} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(re, im + re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right), im\right)} \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(re, \color{blue}{re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right) + im}, im\right) \]
      4. distribute-rgt-inN/A

        \[\leadsto \mathsf{fma}\left(re, \color{blue}{\left(\left(\frac{1}{6} \cdot \left(im \cdot re\right)\right) \cdot re + \left(\frac{1}{2} \cdot im\right) \cdot re\right)} + im, im\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(re, \left(\left(\frac{1}{6} \cdot \left(im \cdot re\right)\right) \cdot re + \color{blue}{\frac{1}{2} \cdot \left(im \cdot re\right)}\right) + im, im\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(re, \left(\color{blue}{\left(\left(im \cdot re\right) \cdot \frac{1}{6}\right)} \cdot re + \frac{1}{2} \cdot \left(im \cdot re\right)\right) + im, im\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(re, \left(\color{blue}{\left(im \cdot re\right) \cdot \left(\frac{1}{6} \cdot re\right)} + \frac{1}{2} \cdot \left(im \cdot re\right)\right) + im, im\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(re, \left(\left(im \cdot re\right) \cdot \left(\frac{1}{6} \cdot re\right) + \color{blue}{\left(im \cdot re\right) \cdot \frac{1}{2}}\right) + im, im\right) \]
      9. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(re, \color{blue}{\left(im \cdot re\right) \cdot \left(\frac{1}{6} \cdot re + \frac{1}{2}\right)} + im, im\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(re, \left(im \cdot re\right) \cdot \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot re\right)} + im, im\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(im \cdot re, \frac{1}{2} + \frac{1}{6} \cdot re, im\right)}, im\right) \]
      12. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(\color{blue}{im \cdot re}, \frac{1}{2} + \frac{1}{6} \cdot re, im\right), im\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \color{blue}{\frac{1}{6} \cdot re + \frac{1}{2}}, im\right), im\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \color{blue}{re \cdot \frac{1}{6}} + \frac{1}{2}, im\right), im\right) \]
      15. lower-fma.f6448.4

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \color{blue}{\mathsf{fma}\left(re, 0.16666666666666666, 0.5\right)}, im\right), im\right) \]
    8. Applied rewrites48.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), im\right), im\right)} \]
    9. Step-by-step derivation
      1. flip3-+N/A

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \color{blue}{\frac{{\left(re \cdot \frac{1}{6}\right)}^{3} + {\frac{1}{2}}^{3}}{\left(re \cdot \frac{1}{6}\right) \cdot \left(re \cdot \frac{1}{6}\right) + \left(\frac{1}{2} \cdot \frac{1}{2} - \left(re \cdot \frac{1}{6}\right) \cdot \frac{1}{2}\right)}}, im\right), im\right) \]
      2. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \color{blue}{\frac{{\left(re \cdot \frac{1}{6}\right)}^{3} + {\frac{1}{2}}^{3}}{\left(re \cdot \frac{1}{6}\right) \cdot \left(re \cdot \frac{1}{6}\right) + \left(\frac{1}{2} \cdot \frac{1}{2} - \left(re \cdot \frac{1}{6}\right) \cdot \frac{1}{2}\right)}}, im\right), im\right) \]
      3. unpow-prod-downN/A

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \frac{\color{blue}{{re}^{3} \cdot {\frac{1}{6}}^{3}} + {\frac{1}{2}}^{3}}{\left(re \cdot \frac{1}{6}\right) \cdot \left(re \cdot \frac{1}{6}\right) + \left(\frac{1}{2} \cdot \frac{1}{2} - \left(re \cdot \frac{1}{6}\right) \cdot \frac{1}{2}\right)}, im\right), im\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \frac{\color{blue}{\mathsf{fma}\left({re}^{3}, {\frac{1}{6}}^{3}, {\frac{1}{2}}^{3}\right)}}{\left(re \cdot \frac{1}{6}\right) \cdot \left(re \cdot \frac{1}{6}\right) + \left(\frac{1}{2} \cdot \frac{1}{2} - \left(re \cdot \frac{1}{6}\right) \cdot \frac{1}{2}\right)}, im\right), im\right) \]
      5. cube-multN/A

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

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \frac{\mathsf{fma}\left(\color{blue}{re \cdot \left(re \cdot re\right)}, {\frac{1}{6}}^{3}, {\frac{1}{2}}^{3}\right)}{\left(re \cdot \frac{1}{6}\right) \cdot \left(re \cdot \frac{1}{6}\right) + \left(\frac{1}{2} \cdot \frac{1}{2} - \left(re \cdot \frac{1}{6}\right) \cdot \frac{1}{2}\right)}, im\right), im\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \frac{\mathsf{fma}\left(re \cdot \color{blue}{\left(re \cdot re\right)}, {\frac{1}{6}}^{3}, {\frac{1}{2}}^{3}\right)}{\left(re \cdot \frac{1}{6}\right) \cdot \left(re \cdot \frac{1}{6}\right) + \left(\frac{1}{2} \cdot \frac{1}{2} - \left(re \cdot \frac{1}{6}\right) \cdot \frac{1}{2}\right)}, im\right), im\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \frac{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), \color{blue}{\frac{1}{216}}, {\frac{1}{2}}^{3}\right)}{\left(re \cdot \frac{1}{6}\right) \cdot \left(re \cdot \frac{1}{6}\right) + \left(\frac{1}{2} \cdot \frac{1}{2} - \left(re \cdot \frac{1}{6}\right) \cdot \frac{1}{2}\right)}, im\right), im\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \frac{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), \frac{1}{216}, \color{blue}{\frac{1}{8}}\right)}{\left(re \cdot \frac{1}{6}\right) \cdot \left(re \cdot \frac{1}{6}\right) + \left(\frac{1}{2} \cdot \frac{1}{2} - \left(re \cdot \frac{1}{6}\right) \cdot \frac{1}{2}\right)}, im\right), im\right) \]
      10. associate-+r-N/A

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \frac{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), \frac{1}{216}, \frac{1}{8}\right)}{\color{blue}{\left(\left(re \cdot \frac{1}{6}\right) \cdot \left(re \cdot \frac{1}{6}\right) + \frac{1}{2} \cdot \frac{1}{2}\right) - \left(re \cdot \frac{1}{6}\right) \cdot \frac{1}{2}}}, im\right), im\right) \]
      11. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \frac{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), \frac{1}{216}, \frac{1}{8}\right)}{\color{blue}{\left(\left(re \cdot \frac{1}{6}\right) \cdot \left(re \cdot \frac{1}{6}\right) + \frac{1}{2} \cdot \frac{1}{2}\right) - \left(re \cdot \frac{1}{6}\right) \cdot \frac{1}{2}}}, im\right), im\right) \]
      12. swap-sqrN/A

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \frac{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), \frac{1}{216}, \frac{1}{8}\right)}{\left(\color{blue}{\left(re \cdot re\right) \cdot \left(\frac{1}{6} \cdot \frac{1}{6}\right)} + \frac{1}{2} \cdot \frac{1}{2}\right) - \left(re \cdot \frac{1}{6}\right) \cdot \frac{1}{2}}, im\right), im\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \frac{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), \frac{1}{216}, \frac{1}{8}\right)}{\left(\left(re \cdot re\right) \cdot \color{blue}{\frac{1}{36}} + \frac{1}{2} \cdot \frac{1}{2}\right) - \left(re \cdot \frac{1}{6}\right) \cdot \frac{1}{2}}, im\right), im\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \frac{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), \frac{1}{216}, \frac{1}{8}\right)}{\left(\left(re \cdot re\right) \cdot \color{blue}{\left(\frac{-1}{6} \cdot \frac{-1}{6}\right)} + \frac{1}{2} \cdot \frac{1}{2}\right) - \left(re \cdot \frac{1}{6}\right) \cdot \frac{1}{2}}, im\right), im\right) \]
      15. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \frac{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), \frac{1}{216}, \frac{1}{8}\right)}{\color{blue}{\mathsf{fma}\left(re \cdot re, \frac{-1}{6} \cdot \frac{-1}{6}, \frac{1}{2} \cdot \frac{1}{2}\right)} - \left(re \cdot \frac{1}{6}\right) \cdot \frac{1}{2}}, im\right), im\right) \]
      16. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \frac{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), \frac{1}{216}, \frac{1}{8}\right)}{\mathsf{fma}\left(\color{blue}{re \cdot re}, \frac{-1}{6} \cdot \frac{-1}{6}, \frac{1}{2} \cdot \frac{1}{2}\right) - \left(re \cdot \frac{1}{6}\right) \cdot \frac{1}{2}}, im\right), im\right) \]
      17. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \frac{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), \frac{1}{216}, \frac{1}{8}\right)}{\mathsf{fma}\left(re \cdot re, \color{blue}{\frac{1}{36}}, \frac{1}{2} \cdot \frac{1}{2}\right) - \left(re \cdot \frac{1}{6}\right) \cdot \frac{1}{2}}, im\right), im\right) \]
      18. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \frac{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), \frac{1}{216}, \frac{1}{8}\right)}{\mathsf{fma}\left(re \cdot re, \frac{1}{36}, \color{blue}{\frac{1}{4}}\right) - \left(re \cdot \frac{1}{6}\right) \cdot \frac{1}{2}}, im\right), im\right) \]
      19. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \frac{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), \frac{1}{216}, \frac{1}{8}\right)}{\mathsf{fma}\left(re \cdot re, \frac{1}{36}, \frac{1}{4}\right) - \color{blue}{re \cdot \left(\frac{1}{6} \cdot \frac{1}{2}\right)}}, im\right), im\right) \]
      20. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \frac{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), \frac{1}{216}, \frac{1}{8}\right)}{\mathsf{fma}\left(re \cdot re, \frac{1}{36}, \frac{1}{4}\right) - \color{blue}{re \cdot \left(\frac{1}{6} \cdot \frac{1}{2}\right)}}, im\right), im\right) \]
      21. metadata-eval4.0

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \frac{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), 0.004629629629629629, 0.125\right)}{\mathsf{fma}\left(re \cdot re, 0.027777777777777776, 0.25\right) - re \cdot \color{blue}{0.08333333333333333}}, im\right), im\right) \]
    10. Applied rewrites4.0%

      \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \color{blue}{\frac{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), 0.004629629629629629, 0.125\right)}{\mathsf{fma}\left(re \cdot re, 0.027777777777777776, 0.25\right) - re \cdot 0.08333333333333333}}, im\right), im\right) \]
    11. Taylor expanded in re around 0

      \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \frac{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), \frac{1}{216}, \frac{1}{8}\right)}{\color{blue}{\frac{1}{4}}}, im\right), im\right) \]
    12. Step-by-step derivation
      1. Applied rewrites54.2%

        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \frac{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), 0.004629629629629629, 0.125\right)}{\color{blue}{0.25}}, im\right), im\right) \]
    13. Recombined 4 regimes into one program.
    14. Final simplification58.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq -\infty:\\ \;\;\;\;im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\right)\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq -0.1:\\ \;\;\;\;\sin im\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq 0:\\ \;\;\;\;im \cdot \left(re \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\right)\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq 1:\\ \;\;\;\;\sin im\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(re, \mathsf{fma}\left(re \cdot im, \frac{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), 0.004629629629629629, 0.125\right)}{0.25}, im\right), im\right)\\ \end{array} \]
    15. Add Preprocessing

    Alternative 6: 35.5% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{re} \cdot \sin im\\ \mathbf{if}\;t\_0 \leq -0.1:\\ \;\;\;\;im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\right)\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;im \cdot \left(re \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(im, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right) \cdot \left(re \cdot re\right), \mathsf{fma}\left(re, im, im\right)\right)\\ \end{array} \end{array} \]
    (FPCore (re im)
     :precision binary64
     (let* ((t_0 (* (exp re) (sin im))))
       (if (<= t_0 -0.1)
         (*
          im
          (*
           (fma im (* im -0.16666666666666666) 1.0)
           (fma re (fma re 0.5 1.0) 1.0)))
         (if (<= t_0 0.0)
           (* im (* re (* 0.008333333333333333 (* (* im im) (* im im)))))
           (fma
            im
            (* (fma re 0.16666666666666666 0.5) (* re re))
            (fma re im im))))))
    double code(double re, double im) {
    	double t_0 = exp(re) * sin(im);
    	double tmp;
    	if (t_0 <= -0.1) {
    		tmp = im * (fma(im, (im * -0.16666666666666666), 1.0) * fma(re, fma(re, 0.5, 1.0), 1.0));
    	} else if (t_0 <= 0.0) {
    		tmp = im * (re * (0.008333333333333333 * ((im * im) * (im * im))));
    	} else {
    		tmp = fma(im, (fma(re, 0.16666666666666666, 0.5) * (re * re)), fma(re, im, im));
    	}
    	return tmp;
    }
    
    function code(re, im)
    	t_0 = Float64(exp(re) * sin(im))
    	tmp = 0.0
    	if (t_0 <= -0.1)
    		tmp = Float64(im * Float64(fma(im, Float64(im * -0.16666666666666666), 1.0) * fma(re, fma(re, 0.5, 1.0), 1.0)));
    	elseif (t_0 <= 0.0)
    		tmp = Float64(im * Float64(re * Float64(0.008333333333333333 * Float64(Float64(im * im) * Float64(im * im)))));
    	else
    		tmp = fma(im, Float64(fma(re, 0.16666666666666666, 0.5) * Float64(re * re)), fma(re, im, im));
    	end
    	return tmp
    end
    
    code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.1], N[(im * N[(N[(im * N[(im * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(im * N[(re * N[(0.008333333333333333 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(re * im + im), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := e^{re} \cdot \sin im\\
    \mathbf{if}\;t\_0 \leq -0.1:\\
    \;\;\;\;im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\right)\\
    
    \mathbf{elif}\;t\_0 \leq 0:\\
    \;\;\;\;im \cdot \left(re \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(im, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right) \cdot \left(re \cdot re\right), \mathsf{fma}\left(re, im, im\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.10000000000000001

      1. Initial program 100.0%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in re around 0

        \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)} \cdot \sin im \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right) + 1\right)} \cdot \sin im \]
        2. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(re, 1 + \frac{1}{2} \cdot re, 1\right)} \cdot \sin im \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{\frac{1}{2} \cdot re + 1}, 1\right) \cdot \sin im \]
        4. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{re \cdot \frac{1}{2}} + 1, 1\right) \cdot \sin im \]
        5. lower-fma.f6469.3

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, 0.5, 1\right)}, 1\right) \cdot \sin im \]
      5. Applied rewrites69.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)} \cdot \sin im \]
      6. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)} \]
      7. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)} \]
        2. +-commutativeN/A

          \[\leadsto im \cdot \left(1 + \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right) + \frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)\right)}\right) \]
        3. associate-+r+N/A

          \[\leadsto im \cdot \color{blue}{\left(\left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right) + \frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)\right)} \]
        4. associate-*r*N/A

          \[\leadsto im \cdot \left(\left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right) + \color{blue}{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)}\right) \]
        5. distribute-rgt1-inN/A

          \[\leadsto im \cdot \color{blue}{\left(\left(\frac{-1}{6} \cdot {im}^{2} + 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)} \]
        6. +-commutativeN/A

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

          \[\leadsto im \cdot \color{blue}{\left(\left(1 + \frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right)} \]
        8. +-commutativeN/A

          \[\leadsto im \cdot \left(\color{blue}{\left(\frac{-1}{6} \cdot {im}^{2} + 1\right)} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
        9. unpow2N/A

          \[\leadsto im \cdot \left(\left(\frac{-1}{6} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
        10. associate-*r*N/A

          \[\leadsto im \cdot \left(\left(\color{blue}{\left(\frac{-1}{6} \cdot im\right) \cdot im} + 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto im \cdot \left(\left(\color{blue}{im \cdot \left(\frac{-1}{6} \cdot im\right)} + 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
        12. lower-fma.f64N/A

          \[\leadsto im \cdot \left(\color{blue}{\mathsf{fma}\left(im, \frac{-1}{6} \cdot im, 1\right)} \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
        13. *-commutativeN/A

          \[\leadsto im \cdot \left(\mathsf{fma}\left(im, \color{blue}{im \cdot \frac{-1}{6}}, 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
        14. lower-*.f64N/A

          \[\leadsto im \cdot \left(\mathsf{fma}\left(im, \color{blue}{im \cdot \frac{-1}{6}}, 1\right) \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)\right) \]
        15. +-commutativeN/A

          \[\leadsto im \cdot \left(\mathsf{fma}\left(im, im \cdot \frac{-1}{6}, 1\right) \cdot \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right) + 1\right)}\right) \]
      8. Applied rewrites31.9%

        \[\leadsto \color{blue}{im \cdot \left(\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\right)} \]

      if -0.10000000000000001 < (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0

      1. Initial program 100.0%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in re around 0

        \[\leadsto \color{blue}{\left(1 + re\right)} \cdot \sin im \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
        2. lower-+.f6439.6

          \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
      5. Applied rewrites39.6%

        \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
      6. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot \left(1 + \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right)\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(\left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + 1\right)} \]
        2. distribute-lft-inN/A

          \[\leadsto \color{blue}{im \cdot \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + im \cdot 1} \]
        3. *-rgt-identityN/A

          \[\leadsto im \cdot \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + \color{blue}{im} \]
        4. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(im, re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right), im\right)} \]
      8. Applied rewrites38.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, \mathsf{fma}\left(im \cdot \mathsf{fma}\left(im, re, im\right), \mathsf{fma}\left(im \cdot im, 0.008333333333333333, -0.16666666666666666\right), re\right), im\right)} \]
      9. Taylor expanded in re around inf

        \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)\right)} \]
      10. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)\right)} \]
        2. +-commutativeN/A

          \[\leadsto im \cdot \left(re \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) + 1\right)}\right) \]
        3. distribute-rgt-inN/A

          \[\leadsto im \cdot \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right) \cdot re + 1 \cdot re\right)} \]
        4. associate-*l*N/A

          \[\leadsto im \cdot \left(\color{blue}{{im}^{2} \cdot \left(\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re\right)} + 1 \cdot re\right) \]
        5. *-lft-identityN/A

          \[\leadsto im \cdot \left({im}^{2} \cdot \left(\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re\right) + \color{blue}{re}\right) \]
        6. lower-fma.f64N/A

          \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left({im}^{2}, \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re, re\right)} \]
        7. unpow2N/A

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

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

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re}, re\right) \]
        10. sub-negN/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\left(\frac{1}{120} \cdot {im}^{2} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right)} \cdot re, re\right) \]
        11. *-commutativeN/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{{im}^{2} \cdot \frac{1}{120}} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
        12. unpow2N/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{120} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
        13. associate-*l*N/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{im \cdot \left(im \cdot \frac{1}{120}\right)} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
        14. metadata-evalN/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(im \cdot \left(im \cdot \frac{1}{120}\right) + \color{blue}{\frac{-1}{6}}\right) \cdot re, re\right) \]
        15. lower-fma.f64N/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\mathsf{fma}\left(im, im \cdot \frac{1}{120}, \frac{-1}{6}\right)} \cdot re, re\right) \]
        16. lower-*.f643.9

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, \color{blue}{im \cdot 0.008333333333333333}, -0.16666666666666666\right) \cdot re, re\right) \]
      11. Applied rewrites3.9%

        \[\leadsto \color{blue}{im \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.008333333333333333, -0.16666666666666666\right) \cdot re, re\right)} \]
      12. Taylor expanded in im around inf

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

          \[\leadsto im \cdot \color{blue}{\left(\left(\frac{1}{120} \cdot {im}^{4}\right) \cdot re\right)} \]
        2. *-commutativeN/A

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

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

          \[\leadsto im \cdot \left(re \cdot \color{blue}{\left(\frac{1}{120} \cdot {im}^{4}\right)}\right) \]
        5. metadata-evalN/A

          \[\leadsto im \cdot \left(re \cdot \left(\frac{1}{120} \cdot {im}^{\color{blue}{\left(2 \cdot 2\right)}}\right)\right) \]
        6. pow-sqrN/A

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

          \[\leadsto im \cdot \left(re \cdot \left(\frac{1}{120} \cdot \color{blue}{\left({im}^{2} \cdot {im}^{2}\right)}\right)\right) \]
        8. unpow2N/A

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

          \[\leadsto im \cdot \left(re \cdot \left(\frac{1}{120} \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot {im}^{2}\right)\right)\right) \]
        10. unpow2N/A

          \[\leadsto im \cdot \left(re \cdot \left(\frac{1}{120} \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right)\right)\right) \]
        11. lower-*.f6425.4

          \[\leadsto im \cdot \left(re \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right)\right)\right) \]
      14. Applied rewrites25.4%

        \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\right)} \]

      if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im))

      1. Initial program 99.0%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot e^{re}} \]
        2. lower-exp.f6464.3

          \[\leadsto im \cdot \color{blue}{e^{re}} \]
      5. Applied rewrites64.3%

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      6. Taylor expanded in re around 0

        \[\leadsto \color{blue}{im + re \cdot \left(im + re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right)\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{re \cdot \left(im + re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right)\right) + im} \]
        2. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(re, im + re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right), im\right)} \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right) + im}, im\right) \]
        4. distribute-rgt-inN/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{\left(\left(\frac{1}{6} \cdot \left(im \cdot re\right)\right) \cdot re + \left(\frac{1}{2} \cdot im\right) \cdot re\right)} + im, im\right) \]
        5. associate-*r*N/A

          \[\leadsto \mathsf{fma}\left(re, \left(\left(\frac{1}{6} \cdot \left(im \cdot re\right)\right) \cdot re + \color{blue}{\frac{1}{2} \cdot \left(im \cdot re\right)}\right) + im, im\right) \]
        6. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \left(\color{blue}{\left(\left(im \cdot re\right) \cdot \frac{1}{6}\right)} \cdot re + \frac{1}{2} \cdot \left(im \cdot re\right)\right) + im, im\right) \]
        7. associate-*l*N/A

          \[\leadsto \mathsf{fma}\left(re, \left(\color{blue}{\left(im \cdot re\right) \cdot \left(\frac{1}{6} \cdot re\right)} + \frac{1}{2} \cdot \left(im \cdot re\right)\right) + im, im\right) \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \left(\left(im \cdot re\right) \cdot \left(\frac{1}{6} \cdot re\right) + \color{blue}{\left(im \cdot re\right) \cdot \frac{1}{2}}\right) + im, im\right) \]
        9. distribute-lft-outN/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{\left(im \cdot re\right) \cdot \left(\frac{1}{6} \cdot re + \frac{1}{2}\right)} + im, im\right) \]
        10. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \left(im \cdot re\right) \cdot \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot re\right)} + im, im\right) \]
        11. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(im \cdot re, \frac{1}{2} + \frac{1}{6} \cdot re, im\right)}, im\right) \]
        12. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(\color{blue}{im \cdot re}, \frac{1}{2} + \frac{1}{6} \cdot re, im\right), im\right) \]
        13. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \color{blue}{\frac{1}{6} \cdot re + \frac{1}{2}}, im\right), im\right) \]
        14. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \color{blue}{re \cdot \frac{1}{6}} + \frac{1}{2}, im\right), im\right) \]
        15. lower-fma.f6455.6

          \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \color{blue}{\mathsf{fma}\left(re, 0.16666666666666666, 0.5\right)}, im\right), im\right) \]
      8. Applied rewrites55.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), im\right), im\right)} \]
      9. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto re \cdot \left(\color{blue}{\left(im \cdot re\right)} \cdot \left(re \cdot \frac{1}{6} + \frac{1}{2}\right) + im\right) + im \]
        2. lift-fma.f64N/A

          \[\leadsto re \cdot \left(\left(im \cdot re\right) \cdot \color{blue}{\mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)} + im\right) + im \]
        3. lift-fma.f64N/A

          \[\leadsto re \cdot \color{blue}{\mathsf{fma}\left(im \cdot re, \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right), im\right)} + im \]
        4. lift-fma.f64N/A

          \[\leadsto re \cdot \color{blue}{\left(\left(im \cdot re\right) \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right) + im\right)} + im \]
        5. distribute-rgt-inN/A

          \[\leadsto \color{blue}{\left(\left(\left(im \cdot re\right) \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)\right) \cdot re + im \cdot re\right)} + im \]
        6. lift-*.f64N/A

          \[\leadsto \left(\left(\left(im \cdot re\right) \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)\right) \cdot re + \color{blue}{im \cdot re}\right) + im \]
        7. associate-+l+N/A

          \[\leadsto \color{blue}{\left(\left(im \cdot re\right) \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)\right) \cdot re + \left(im \cdot re + im\right)} \]
        8. lift-*.f64N/A

          \[\leadsto \left(\color{blue}{\left(im \cdot re\right)} \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)\right) \cdot re + \left(im \cdot re + im\right) \]
        9. associate-*l*N/A

          \[\leadsto \color{blue}{\left(im \cdot \left(re \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)\right)\right)} \cdot re + \left(im \cdot re + im\right) \]
        10. associate-*l*N/A

          \[\leadsto \color{blue}{im \cdot \left(\left(re \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)\right) \cdot re\right)} + \left(im \cdot re + im\right) \]
        11. lift-*.f64N/A

          \[\leadsto im \cdot \left(\left(re \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)\right) \cdot re\right) + \left(\color{blue}{im \cdot re} + im\right) \]
        12. lift-fma.f64N/A

          \[\leadsto im \cdot \left(\left(re \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)\right) \cdot re\right) + \color{blue}{\mathsf{fma}\left(im, re, im\right)} \]
        13. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(im, \left(re \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)\right) \cdot re, \mathsf{fma}\left(im, re, im\right)\right)} \]
      10. Applied rewrites57.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right) \cdot \left(re \cdot re\right), \mathsf{fma}\left(re, im, im\right)\right)} \]
    3. Recombined 3 regimes into one program.
    4. Add Preprocessing

    Alternative 7: 32.2% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{re} \cdot \sin im\\ \mathbf{if}\;t\_0 \leq -0.1:\\ \;\;\;\;\mathsf{fma}\left(im, \mathsf{fma}\left(im, im \cdot \mathsf{fma}\left(re, -0.16666666666666666, -0.16666666666666666\right), re\right), im\right)\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;im \cdot \left(re \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(im, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right) \cdot \left(re \cdot re\right), \mathsf{fma}\left(re, im, im\right)\right)\\ \end{array} \end{array} \]
    (FPCore (re im)
     :precision binary64
     (let* ((t_0 (* (exp re) (sin im))))
       (if (<= t_0 -0.1)
         (fma
          im
          (fma im (* im (fma re -0.16666666666666666 -0.16666666666666666)) re)
          im)
         (if (<= t_0 0.0)
           (* im (* re (* 0.008333333333333333 (* (* im im) (* im im)))))
           (fma
            im
            (* (fma re 0.16666666666666666 0.5) (* re re))
            (fma re im im))))))
    double code(double re, double im) {
    	double t_0 = exp(re) * sin(im);
    	double tmp;
    	if (t_0 <= -0.1) {
    		tmp = fma(im, fma(im, (im * fma(re, -0.16666666666666666, -0.16666666666666666)), re), im);
    	} else if (t_0 <= 0.0) {
    		tmp = im * (re * (0.008333333333333333 * ((im * im) * (im * im))));
    	} else {
    		tmp = fma(im, (fma(re, 0.16666666666666666, 0.5) * (re * re)), fma(re, im, im));
    	}
    	return tmp;
    }
    
    function code(re, im)
    	t_0 = Float64(exp(re) * sin(im))
    	tmp = 0.0
    	if (t_0 <= -0.1)
    		tmp = fma(im, fma(im, Float64(im * fma(re, -0.16666666666666666, -0.16666666666666666)), re), im);
    	elseif (t_0 <= 0.0)
    		tmp = Float64(im * Float64(re * Float64(0.008333333333333333 * Float64(Float64(im * im) * Float64(im * im)))));
    	else
    		tmp = fma(im, Float64(fma(re, 0.16666666666666666, 0.5) * Float64(re * re)), fma(re, im, im));
    	end
    	return tmp
    end
    
    code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.1], N[(im * N[(im * N[(im * N[(re * -0.16666666666666666 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + re), $MachinePrecision] + im), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(im * N[(re * N[(0.008333333333333333 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision] + N[(re * im + im), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := e^{re} \cdot \sin im\\
    \mathbf{if}\;t\_0 \leq -0.1:\\
    \;\;\;\;\mathsf{fma}\left(im, \mathsf{fma}\left(im, im \cdot \mathsf{fma}\left(re, -0.16666666666666666, -0.16666666666666666\right), re\right), im\right)\\
    
    \mathbf{elif}\;t\_0 \leq 0:\\
    \;\;\;\;im \cdot \left(re \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(im, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right) \cdot \left(re \cdot re\right), \mathsf{fma}\left(re, im, im\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.10000000000000001

      1. Initial program 100.0%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in re around 0

        \[\leadsto \color{blue}{\left(1 + re\right)} \cdot \sin im \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
        2. lower-+.f6443.0

          \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
      5. Applied rewrites43.0%

        \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
      6. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot \left(1 + \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right)\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(\left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + 1\right)} \]
        2. distribute-lft-inN/A

          \[\leadsto \color{blue}{im \cdot \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + im \cdot 1} \]
        3. *-rgt-identityN/A

          \[\leadsto im \cdot \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + \color{blue}{im} \]
        4. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(im, re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right), im\right)} \]
      8. Applied rewrites14.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, \mathsf{fma}\left(im \cdot \mathsf{fma}\left(im, re, im\right), \mathsf{fma}\left(im \cdot im, 0.008333333333333333, -0.16666666666666666\right), re\right), im\right)} \]
      9. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot \left(1 + \left(re + \frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right)} \]
      10. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(\left(re + \frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right) + 1\right)} \]
        2. distribute-lft-inN/A

          \[\leadsto \color{blue}{im \cdot \left(re + \frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right) + im \cdot 1} \]
        3. *-rgt-identityN/A

          \[\leadsto im \cdot \left(re + \frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right) + \color{blue}{im} \]
        4. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(im, re + \frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right), im\right)} \]
        5. +-commutativeN/A

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

          \[\leadsto \mathsf{fma}\left(im, \color{blue}{\left({im}^{2} \cdot \left(1 + re\right)\right) \cdot \frac{-1}{6}} + re, im\right) \]
        7. associate-*r*N/A

          \[\leadsto \mathsf{fma}\left(im, \color{blue}{{im}^{2} \cdot \left(\left(1 + re\right) \cdot \frac{-1}{6}\right)} + re, im\right) \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(im, {im}^{2} \cdot \color{blue}{\left(\frac{-1}{6} \cdot \left(1 + re\right)\right)} + re, im\right) \]
        9. unpow2N/A

          \[\leadsto \mathsf{fma}\left(im, \color{blue}{\left(im \cdot im\right)} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right)\right) + re, im\right) \]
        10. associate-*l*N/A

          \[\leadsto \mathsf{fma}\left(im, \color{blue}{im \cdot \left(im \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right)\right)\right)} + re, im\right) \]
        11. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(im, \color{blue}{\mathsf{fma}\left(im, im \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right)\right), re\right)}, im\right) \]
        12. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(im, \mathsf{fma}\left(im, \color{blue}{im \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right)\right)}, re\right), im\right) \]
        13. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(im, \mathsf{fma}\left(im, im \cdot \left(\frac{-1}{6} \cdot \color{blue}{\left(re + 1\right)}\right), re\right), im\right) \]
        14. distribute-rgt-inN/A

          \[\leadsto \mathsf{fma}\left(im, \mathsf{fma}\left(im, im \cdot \color{blue}{\left(re \cdot \frac{-1}{6} + 1 \cdot \frac{-1}{6}\right)}, re\right), im\right) \]
        15. metadata-evalN/A

          \[\leadsto \mathsf{fma}\left(im, \mathsf{fma}\left(im, im \cdot \left(re \cdot \frac{-1}{6} + \color{blue}{\frac{-1}{6}}\right), re\right), im\right) \]
        16. lower-fma.f6415.1

          \[\leadsto \mathsf{fma}\left(im, \mathsf{fma}\left(im, im \cdot \color{blue}{\mathsf{fma}\left(re, -0.16666666666666666, -0.16666666666666666\right)}, re\right), im\right) \]
      11. Applied rewrites15.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, \mathsf{fma}\left(im, im \cdot \mathsf{fma}\left(re, -0.16666666666666666, -0.16666666666666666\right), re\right), im\right)} \]

      if -0.10000000000000001 < (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0

      1. Initial program 100.0%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in re around 0

        \[\leadsto \color{blue}{\left(1 + re\right)} \cdot \sin im \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
        2. lower-+.f6439.6

          \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
      5. Applied rewrites39.6%

        \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
      6. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot \left(1 + \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right)\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(\left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + 1\right)} \]
        2. distribute-lft-inN/A

          \[\leadsto \color{blue}{im \cdot \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + im \cdot 1} \]
        3. *-rgt-identityN/A

          \[\leadsto im \cdot \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + \color{blue}{im} \]
        4. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(im, re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right), im\right)} \]
      8. Applied rewrites38.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, \mathsf{fma}\left(im \cdot \mathsf{fma}\left(im, re, im\right), \mathsf{fma}\left(im \cdot im, 0.008333333333333333, -0.16666666666666666\right), re\right), im\right)} \]
      9. Taylor expanded in re around inf

        \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)\right)} \]
      10. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)\right)} \]
        2. +-commutativeN/A

          \[\leadsto im \cdot \left(re \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) + 1\right)}\right) \]
        3. distribute-rgt-inN/A

          \[\leadsto im \cdot \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right) \cdot re + 1 \cdot re\right)} \]
        4. associate-*l*N/A

          \[\leadsto im \cdot \left(\color{blue}{{im}^{2} \cdot \left(\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re\right)} + 1 \cdot re\right) \]
        5. *-lft-identityN/A

          \[\leadsto im \cdot \left({im}^{2} \cdot \left(\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re\right) + \color{blue}{re}\right) \]
        6. lower-fma.f64N/A

          \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left({im}^{2}, \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re, re\right)} \]
        7. unpow2N/A

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

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

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re}, re\right) \]
        10. sub-negN/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\left(\frac{1}{120} \cdot {im}^{2} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right)} \cdot re, re\right) \]
        11. *-commutativeN/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{{im}^{2} \cdot \frac{1}{120}} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
        12. unpow2N/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{120} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
        13. associate-*l*N/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{im \cdot \left(im \cdot \frac{1}{120}\right)} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
        14. metadata-evalN/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(im \cdot \left(im \cdot \frac{1}{120}\right) + \color{blue}{\frac{-1}{6}}\right) \cdot re, re\right) \]
        15. lower-fma.f64N/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\mathsf{fma}\left(im, im \cdot \frac{1}{120}, \frac{-1}{6}\right)} \cdot re, re\right) \]
        16. lower-*.f643.9

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, \color{blue}{im \cdot 0.008333333333333333}, -0.16666666666666666\right) \cdot re, re\right) \]
      11. Applied rewrites3.9%

        \[\leadsto \color{blue}{im \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.008333333333333333, -0.16666666666666666\right) \cdot re, re\right)} \]
      12. Taylor expanded in im around inf

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

          \[\leadsto im \cdot \color{blue}{\left(\left(\frac{1}{120} \cdot {im}^{4}\right) \cdot re\right)} \]
        2. *-commutativeN/A

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

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

          \[\leadsto im \cdot \left(re \cdot \color{blue}{\left(\frac{1}{120} \cdot {im}^{4}\right)}\right) \]
        5. metadata-evalN/A

          \[\leadsto im \cdot \left(re \cdot \left(\frac{1}{120} \cdot {im}^{\color{blue}{\left(2 \cdot 2\right)}}\right)\right) \]
        6. pow-sqrN/A

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

          \[\leadsto im \cdot \left(re \cdot \left(\frac{1}{120} \cdot \color{blue}{\left({im}^{2} \cdot {im}^{2}\right)}\right)\right) \]
        8. unpow2N/A

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

          \[\leadsto im \cdot \left(re \cdot \left(\frac{1}{120} \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot {im}^{2}\right)\right)\right) \]
        10. unpow2N/A

          \[\leadsto im \cdot \left(re \cdot \left(\frac{1}{120} \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right)\right)\right) \]
        11. lower-*.f6425.4

          \[\leadsto im \cdot \left(re \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right)\right)\right) \]
      14. Applied rewrites25.4%

        \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)\right)} \]

      if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im))

      1. Initial program 99.0%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot e^{re}} \]
        2. lower-exp.f6464.3

          \[\leadsto im \cdot \color{blue}{e^{re}} \]
      5. Applied rewrites64.3%

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      6. Taylor expanded in re around 0

        \[\leadsto \color{blue}{im + re \cdot \left(im + re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right)\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{re \cdot \left(im + re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right)\right) + im} \]
        2. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(re, im + re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right), im\right)} \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right) + im}, im\right) \]
        4. distribute-rgt-inN/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{\left(\left(\frac{1}{6} \cdot \left(im \cdot re\right)\right) \cdot re + \left(\frac{1}{2} \cdot im\right) \cdot re\right)} + im, im\right) \]
        5. associate-*r*N/A

          \[\leadsto \mathsf{fma}\left(re, \left(\left(\frac{1}{6} \cdot \left(im \cdot re\right)\right) \cdot re + \color{blue}{\frac{1}{2} \cdot \left(im \cdot re\right)}\right) + im, im\right) \]
        6. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \left(\color{blue}{\left(\left(im \cdot re\right) \cdot \frac{1}{6}\right)} \cdot re + \frac{1}{2} \cdot \left(im \cdot re\right)\right) + im, im\right) \]
        7. associate-*l*N/A

          \[\leadsto \mathsf{fma}\left(re, \left(\color{blue}{\left(im \cdot re\right) \cdot \left(\frac{1}{6} \cdot re\right)} + \frac{1}{2} \cdot \left(im \cdot re\right)\right) + im, im\right) \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \left(\left(im \cdot re\right) \cdot \left(\frac{1}{6} \cdot re\right) + \color{blue}{\left(im \cdot re\right) \cdot \frac{1}{2}}\right) + im, im\right) \]
        9. distribute-lft-outN/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{\left(im \cdot re\right) \cdot \left(\frac{1}{6} \cdot re + \frac{1}{2}\right)} + im, im\right) \]
        10. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \left(im \cdot re\right) \cdot \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot re\right)} + im, im\right) \]
        11. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(im \cdot re, \frac{1}{2} + \frac{1}{6} \cdot re, im\right)}, im\right) \]
        12. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(\color{blue}{im \cdot re}, \frac{1}{2} + \frac{1}{6} \cdot re, im\right), im\right) \]
        13. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \color{blue}{\frac{1}{6} \cdot re + \frac{1}{2}}, im\right), im\right) \]
        14. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \color{blue}{re \cdot \frac{1}{6}} + \frac{1}{2}, im\right), im\right) \]
        15. lower-fma.f6455.6

          \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \color{blue}{\mathsf{fma}\left(re, 0.16666666666666666, 0.5\right)}, im\right), im\right) \]
      8. Applied rewrites55.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), im\right), im\right)} \]
      9. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto re \cdot \left(\color{blue}{\left(im \cdot re\right)} \cdot \left(re \cdot \frac{1}{6} + \frac{1}{2}\right) + im\right) + im \]
        2. lift-fma.f64N/A

          \[\leadsto re \cdot \left(\left(im \cdot re\right) \cdot \color{blue}{\mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)} + im\right) + im \]
        3. lift-fma.f64N/A

          \[\leadsto re \cdot \color{blue}{\mathsf{fma}\left(im \cdot re, \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right), im\right)} + im \]
        4. lift-fma.f64N/A

          \[\leadsto re \cdot \color{blue}{\left(\left(im \cdot re\right) \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right) + im\right)} + im \]
        5. distribute-rgt-inN/A

          \[\leadsto \color{blue}{\left(\left(\left(im \cdot re\right) \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)\right) \cdot re + im \cdot re\right)} + im \]
        6. lift-*.f64N/A

          \[\leadsto \left(\left(\left(im \cdot re\right) \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)\right) \cdot re + \color{blue}{im \cdot re}\right) + im \]
        7. associate-+l+N/A

          \[\leadsto \color{blue}{\left(\left(im \cdot re\right) \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)\right) \cdot re + \left(im \cdot re + im\right)} \]
        8. lift-*.f64N/A

          \[\leadsto \left(\color{blue}{\left(im \cdot re\right)} \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)\right) \cdot re + \left(im \cdot re + im\right) \]
        9. associate-*l*N/A

          \[\leadsto \color{blue}{\left(im \cdot \left(re \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)\right)\right)} \cdot re + \left(im \cdot re + im\right) \]
        10. associate-*l*N/A

          \[\leadsto \color{blue}{im \cdot \left(\left(re \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)\right) \cdot re\right)} + \left(im \cdot re + im\right) \]
        11. lift-*.f64N/A

          \[\leadsto im \cdot \left(\left(re \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)\right) \cdot re\right) + \left(\color{blue}{im \cdot re} + im\right) \]
        12. lift-fma.f64N/A

          \[\leadsto im \cdot \left(\left(re \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)\right) \cdot re\right) + \color{blue}{\mathsf{fma}\left(im, re, im\right)} \]
        13. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(im, \left(re \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)\right) \cdot re, \mathsf{fma}\left(im, re, im\right)\right)} \]
      10. Applied rewrites57.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right) \cdot \left(re \cdot re\right), \mathsf{fma}\left(re, im, im\right)\right)} \]
    3. Recombined 3 regimes into one program.
    4. Add Preprocessing

    Alternative 8: 35.3% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 5 \cdot 10^{-109}:\\ \;\;\;\;\mathsf{fma}\left(im, \mathsf{fma}\left(im, im \cdot \mathsf{fma}\left(re, -0.16666666666666666, -0.16666666666666666\right), re\right), im\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\ \end{array} \end{array} \]
    (FPCore (re im)
     :precision binary64
     (if (<= (* (exp re) (sin im)) 5e-109)
       (fma
        im
        (fma im (* im (fma re -0.16666666666666666 -0.16666666666666666)) re)
        im)
       (* im (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0))))
    double code(double re, double im) {
    	double tmp;
    	if ((exp(re) * sin(im)) <= 5e-109) {
    		tmp = fma(im, fma(im, (im * fma(re, -0.16666666666666666, -0.16666666666666666)), re), im);
    	} else {
    		tmp = im * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
    	}
    	return tmp;
    }
    
    function code(re, im)
    	tmp = 0.0
    	if (Float64(exp(re) * sin(im)) <= 5e-109)
    		tmp = fma(im, fma(im, Float64(im * fma(re, -0.16666666666666666, -0.16666666666666666)), re), im);
    	else
    		tmp = Float64(im * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0));
    	end
    	return tmp
    end
    
    code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 5e-109], N[(im * N[(im * N[(im * N[(re * -0.16666666666666666 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + re), $MachinePrecision] + im), $MachinePrecision], N[(im * N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;e^{re} \cdot \sin im \leq 5 \cdot 10^{-109}:\\
    \;\;\;\;\mathsf{fma}\left(im, \mathsf{fma}\left(im, im \cdot \mathsf{fma}\left(re, -0.16666666666666666, -0.16666666666666666\right), re\right), im\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (exp.f64 re) (sin.f64 im)) < 5.0000000000000002e-109

      1. Initial program 100.0%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in re around 0

        \[\leadsto \color{blue}{\left(1 + re\right)} \cdot \sin im \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
        2. lower-+.f6447.3

          \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
      5. Applied rewrites47.3%

        \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
      6. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot \left(1 + \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right)\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(\left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + 1\right)} \]
        2. distribute-lft-inN/A

          \[\leadsto \color{blue}{im \cdot \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + im \cdot 1} \]
        3. *-rgt-identityN/A

          \[\leadsto im \cdot \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + \color{blue}{im} \]
        4. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(im, re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right), im\right)} \]
      8. Applied rewrites36.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, \mathsf{fma}\left(im \cdot \mathsf{fma}\left(im, re, im\right), \mathsf{fma}\left(im \cdot im, 0.008333333333333333, -0.16666666666666666\right), re\right), im\right)} \]
      9. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot \left(1 + \left(re + \frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right)} \]
      10. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(\left(re + \frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right) + 1\right)} \]
        2. distribute-lft-inN/A

          \[\leadsto \color{blue}{im \cdot \left(re + \frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right) + im \cdot 1} \]
        3. *-rgt-identityN/A

          \[\leadsto im \cdot \left(re + \frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right) + \color{blue}{im} \]
        4. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(im, re + \frac{-1}{6} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right), im\right)} \]
        5. +-commutativeN/A

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

          \[\leadsto \mathsf{fma}\left(im, \color{blue}{\left({im}^{2} \cdot \left(1 + re\right)\right) \cdot \frac{-1}{6}} + re, im\right) \]
        7. associate-*r*N/A

          \[\leadsto \mathsf{fma}\left(im, \color{blue}{{im}^{2} \cdot \left(\left(1 + re\right) \cdot \frac{-1}{6}\right)} + re, im\right) \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(im, {im}^{2} \cdot \color{blue}{\left(\frac{-1}{6} \cdot \left(1 + re\right)\right)} + re, im\right) \]
        9. unpow2N/A

          \[\leadsto \mathsf{fma}\left(im, \color{blue}{\left(im \cdot im\right)} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right)\right) + re, im\right) \]
        10. associate-*l*N/A

          \[\leadsto \mathsf{fma}\left(im, \color{blue}{im \cdot \left(im \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right)\right)\right)} + re, im\right) \]
        11. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(im, \color{blue}{\mathsf{fma}\left(im, im \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right)\right), re\right)}, im\right) \]
        12. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(im, \mathsf{fma}\left(im, \color{blue}{im \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right)\right)}, re\right), im\right) \]
        13. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(im, \mathsf{fma}\left(im, im \cdot \left(\frac{-1}{6} \cdot \color{blue}{\left(re + 1\right)}\right), re\right), im\right) \]
        14. distribute-rgt-inN/A

          \[\leadsto \mathsf{fma}\left(im, \mathsf{fma}\left(im, im \cdot \color{blue}{\left(re \cdot \frac{-1}{6} + 1 \cdot \frac{-1}{6}\right)}, re\right), im\right) \]
        15. metadata-evalN/A

          \[\leadsto \mathsf{fma}\left(im, \mathsf{fma}\left(im, im \cdot \left(re \cdot \frac{-1}{6} + \color{blue}{\frac{-1}{6}}\right), re\right), im\right) \]
        16. lower-fma.f6436.9

          \[\leadsto \mathsf{fma}\left(im, \mathsf{fma}\left(im, im \cdot \color{blue}{\mathsf{fma}\left(re, -0.16666666666666666, -0.16666666666666666\right)}, re\right), im\right) \]
      11. Applied rewrites36.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, \mathsf{fma}\left(im, im \cdot \mathsf{fma}\left(re, -0.16666666666666666, -0.16666666666666666\right), re\right), im\right)} \]

      if 5.0000000000000002e-109 < (*.f64 (exp.f64 re) (sin.f64 im))

      1. Initial program 98.8%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot e^{re}} \]
        2. lower-exp.f6454.6

          \[\leadsto im \cdot \color{blue}{e^{re}} \]
      5. Applied rewrites54.6%

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      6. Taylor expanded in re around 0

        \[\leadsto im \cdot \color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right) + 1\right)} \]
        2. lower-fma.f64N/A

          \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left(re, 1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right), 1\right)} \]
        3. +-commutativeN/A

          \[\leadsto im \cdot \mathsf{fma}\left(re, \color{blue}{re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right) + 1}, 1\right) \]
        4. lower-fma.f64N/A

          \[\leadsto im \cdot \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, \frac{1}{2} + \frac{1}{6} \cdot re, 1\right)}, 1\right) \]
        5. +-commutativeN/A

          \[\leadsto im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, \color{blue}{\frac{1}{6} \cdot re + \frac{1}{2}}, 1\right), 1\right) \]
        6. *-commutativeN/A

          \[\leadsto im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, \color{blue}{re \cdot \frac{1}{6}} + \frac{1}{2}, 1\right), 1\right) \]
        7. lower-fma.f6447.0

          \[\leadsto im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, 0.16666666666666666, 0.5\right)}, 1\right), 1\right) \]
      8. Applied rewrites47.0%

        \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right)} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 9: 23.2% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\ \;\;\;\;im \cdot \mathsf{fma}\left(re, -0.16666666666666666 \cdot \left(im \cdot im\right), re\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\ \end{array} \end{array} \]
    (FPCore (re im)
     :precision binary64
     (if (<= (* (exp re) (sin im)) 0.0)
       (* im (fma re (* -0.16666666666666666 (* im im)) re))
       (* im (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0))))
    double code(double re, double im) {
    	double tmp;
    	if ((exp(re) * sin(im)) <= 0.0) {
    		tmp = im * fma(re, (-0.16666666666666666 * (im * im)), re);
    	} else {
    		tmp = im * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
    	}
    	return tmp;
    }
    
    function code(re, im)
    	tmp = 0.0
    	if (Float64(exp(re) * sin(im)) <= 0.0)
    		tmp = Float64(im * fma(re, Float64(-0.16666666666666666 * Float64(im * im)), re));
    	else
    		tmp = Float64(im * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0));
    	end
    	return tmp
    end
    
    code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.0], N[(im * N[(re * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + re), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
    \;\;\;\;im \cdot \mathsf{fma}\left(re, -0.16666666666666666 \cdot \left(im \cdot im\right), re\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0

      1. Initial program 100.0%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in re around 0

        \[\leadsto \color{blue}{\left(1 + re\right)} \cdot \sin im \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
        2. lower-+.f6441.0

          \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
      5. Applied rewrites41.0%

        \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
      6. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot \left(1 + \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right)\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(\left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + 1\right)} \]
        2. distribute-lft-inN/A

          \[\leadsto \color{blue}{im \cdot \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + im \cdot 1} \]
        3. *-rgt-identityN/A

          \[\leadsto im \cdot \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + \color{blue}{im} \]
        4. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(im, re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right), im\right)} \]
      8. Applied rewrites28.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, \mathsf{fma}\left(im \cdot \mathsf{fma}\left(im, re, im\right), \mathsf{fma}\left(im \cdot im, 0.008333333333333333, -0.16666666666666666\right), re\right), im\right)} \]
      9. Taylor expanded in re around inf

        \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)\right)} \]
      10. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)\right)} \]
        2. +-commutativeN/A

          \[\leadsto im \cdot \left(re \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) + 1\right)}\right) \]
        3. distribute-rgt-inN/A

          \[\leadsto im \cdot \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right) \cdot re + 1 \cdot re\right)} \]
        4. associate-*l*N/A

          \[\leadsto im \cdot \left(\color{blue}{{im}^{2} \cdot \left(\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re\right)} + 1 \cdot re\right) \]
        5. *-lft-identityN/A

          \[\leadsto im \cdot \left({im}^{2} \cdot \left(\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re\right) + \color{blue}{re}\right) \]
        6. lower-fma.f64N/A

          \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left({im}^{2}, \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re, re\right)} \]
        7. unpow2N/A

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

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

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re}, re\right) \]
        10. sub-negN/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\left(\frac{1}{120} \cdot {im}^{2} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right)} \cdot re, re\right) \]
        11. *-commutativeN/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{{im}^{2} \cdot \frac{1}{120}} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
        12. unpow2N/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{120} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
        13. associate-*l*N/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{im \cdot \left(im \cdot \frac{1}{120}\right)} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
        14. metadata-evalN/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(im \cdot \left(im \cdot \frac{1}{120}\right) + \color{blue}{\frac{-1}{6}}\right) \cdot re, re\right) \]
        15. lower-fma.f64N/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\mathsf{fma}\left(im, im \cdot \frac{1}{120}, \frac{-1}{6}\right)} \cdot re, re\right) \]
        16. lower-*.f648.3

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, \color{blue}{im \cdot 0.008333333333333333}, -0.16666666666666666\right) \cdot re, re\right) \]
      11. Applied rewrites8.3%

        \[\leadsto \color{blue}{im \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.008333333333333333, -0.16666666666666666\right) \cdot re, re\right)} \]
      12. Taylor expanded in im around 0

        \[\leadsto im \cdot \color{blue}{\left(re + \frac{-1}{6} \cdot \left({im}^{2} \cdot re\right)\right)} \]
      13. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(\frac{-1}{6} \cdot \left({im}^{2} \cdot re\right) + re\right)} \]
        2. associate-*r*N/A

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

          \[\leadsto im \cdot \left(\color{blue}{re \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right)} + re\right) \]
        4. lower-fma.f64N/A

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

          \[\leadsto im \cdot \mathsf{fma}\left(re, \color{blue}{\frac{-1}{6} \cdot {im}^{2}}, re\right) \]
        6. unpow2N/A

          \[\leadsto im \cdot \mathsf{fma}\left(re, \frac{-1}{6} \cdot \color{blue}{\left(im \cdot im\right)}, re\right) \]
        7. lower-*.f648.4

          \[\leadsto im \cdot \mathsf{fma}\left(re, -0.16666666666666666 \cdot \color{blue}{\left(im \cdot im\right)}, re\right) \]
      14. Applied rewrites8.4%

        \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left(re, -0.16666666666666666 \cdot \left(im \cdot im\right), re\right)} \]

      if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im))

      1. Initial program 99.0%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot e^{re}} \]
        2. lower-exp.f6464.3

          \[\leadsto im \cdot \color{blue}{e^{re}} \]
      5. Applied rewrites64.3%

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      6. Taylor expanded in re around 0

        \[\leadsto im \cdot \color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right) + 1\right)} \]
        2. lower-fma.f64N/A

          \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left(re, 1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right), 1\right)} \]
        3. +-commutativeN/A

          \[\leadsto im \cdot \mathsf{fma}\left(re, \color{blue}{re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right) + 1}, 1\right) \]
        4. lower-fma.f64N/A

          \[\leadsto im \cdot \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, \frac{1}{2} + \frac{1}{6} \cdot re, 1\right)}, 1\right) \]
        5. +-commutativeN/A

          \[\leadsto im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, \color{blue}{\frac{1}{6} \cdot re + \frac{1}{2}}, 1\right), 1\right) \]
        6. *-commutativeN/A

          \[\leadsto im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, \color{blue}{re \cdot \frac{1}{6}} + \frac{1}{2}, 1\right), 1\right) \]
        7. lower-fma.f6457.3

          \[\leadsto im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, 0.16666666666666666, 0.5\right)}, 1\right), 1\right) \]
      8. Applied rewrites57.3%

        \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right)} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 10: 23.0% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\ \;\;\;\;im \cdot \mathsf{fma}\left(re, -0.16666666666666666 \cdot \left(im \cdot im\right), re\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right), im, im\right)\\ \end{array} \end{array} \]
    (FPCore (re im)
     :precision binary64
     (if (<= (* (exp re) (sin im)) 0.0)
       (* im (fma re (* -0.16666666666666666 (* im im)) re))
       (fma (* re (* re (* re 0.16666666666666666))) im im)))
    double code(double re, double im) {
    	double tmp;
    	if ((exp(re) * sin(im)) <= 0.0) {
    		tmp = im * fma(re, (-0.16666666666666666 * (im * im)), re);
    	} else {
    		tmp = fma((re * (re * (re * 0.16666666666666666))), im, im);
    	}
    	return tmp;
    }
    
    function code(re, im)
    	tmp = 0.0
    	if (Float64(exp(re) * sin(im)) <= 0.0)
    		tmp = Float64(im * fma(re, Float64(-0.16666666666666666 * Float64(im * im)), re));
    	else
    		tmp = fma(Float64(re * Float64(re * Float64(re * 0.16666666666666666))), im, im);
    	end
    	return tmp
    end
    
    code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.0], N[(im * N[(re * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + re), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(re * N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * im + im), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
    \;\;\;\;im \cdot \mathsf{fma}\left(re, -0.16666666666666666 \cdot \left(im \cdot im\right), re\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right), im, im\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0

      1. Initial program 100.0%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in re around 0

        \[\leadsto \color{blue}{\left(1 + re\right)} \cdot \sin im \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
        2. lower-+.f6441.0

          \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
      5. Applied rewrites41.0%

        \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
      6. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot \left(1 + \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right)\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(\left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + 1\right)} \]
        2. distribute-lft-inN/A

          \[\leadsto \color{blue}{im \cdot \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + im \cdot 1} \]
        3. *-rgt-identityN/A

          \[\leadsto im \cdot \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + \color{blue}{im} \]
        4. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(im, re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right), im\right)} \]
      8. Applied rewrites28.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, \mathsf{fma}\left(im \cdot \mathsf{fma}\left(im, re, im\right), \mathsf{fma}\left(im \cdot im, 0.008333333333333333, -0.16666666666666666\right), re\right), im\right)} \]
      9. Taylor expanded in re around inf

        \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)\right)} \]
      10. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)\right)} \]
        2. +-commutativeN/A

          \[\leadsto im \cdot \left(re \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) + 1\right)}\right) \]
        3. distribute-rgt-inN/A

          \[\leadsto im \cdot \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right) \cdot re + 1 \cdot re\right)} \]
        4. associate-*l*N/A

          \[\leadsto im \cdot \left(\color{blue}{{im}^{2} \cdot \left(\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re\right)} + 1 \cdot re\right) \]
        5. *-lft-identityN/A

          \[\leadsto im \cdot \left({im}^{2} \cdot \left(\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re\right) + \color{blue}{re}\right) \]
        6. lower-fma.f64N/A

          \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left({im}^{2}, \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re, re\right)} \]
        7. unpow2N/A

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

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

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re}, re\right) \]
        10. sub-negN/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\left(\frac{1}{120} \cdot {im}^{2} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right)} \cdot re, re\right) \]
        11. *-commutativeN/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{{im}^{2} \cdot \frac{1}{120}} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
        12. unpow2N/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{120} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
        13. associate-*l*N/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{im \cdot \left(im \cdot \frac{1}{120}\right)} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
        14. metadata-evalN/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(im \cdot \left(im \cdot \frac{1}{120}\right) + \color{blue}{\frac{-1}{6}}\right) \cdot re, re\right) \]
        15. lower-fma.f64N/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\mathsf{fma}\left(im, im \cdot \frac{1}{120}, \frac{-1}{6}\right)} \cdot re, re\right) \]
        16. lower-*.f648.3

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, \color{blue}{im \cdot 0.008333333333333333}, -0.16666666666666666\right) \cdot re, re\right) \]
      11. Applied rewrites8.3%

        \[\leadsto \color{blue}{im \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.008333333333333333, -0.16666666666666666\right) \cdot re, re\right)} \]
      12. Taylor expanded in im around 0

        \[\leadsto im \cdot \color{blue}{\left(re + \frac{-1}{6} \cdot \left({im}^{2} \cdot re\right)\right)} \]
      13. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(\frac{-1}{6} \cdot \left({im}^{2} \cdot re\right) + re\right)} \]
        2. associate-*r*N/A

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

          \[\leadsto im \cdot \left(\color{blue}{re \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right)} + re\right) \]
        4. lower-fma.f64N/A

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

          \[\leadsto im \cdot \mathsf{fma}\left(re, \color{blue}{\frac{-1}{6} \cdot {im}^{2}}, re\right) \]
        6. unpow2N/A

          \[\leadsto im \cdot \mathsf{fma}\left(re, \frac{-1}{6} \cdot \color{blue}{\left(im \cdot im\right)}, re\right) \]
        7. lower-*.f648.4

          \[\leadsto im \cdot \mathsf{fma}\left(re, -0.16666666666666666 \cdot \color{blue}{\left(im \cdot im\right)}, re\right) \]
      14. Applied rewrites8.4%

        \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left(re, -0.16666666666666666 \cdot \left(im \cdot im\right), re\right)} \]

      if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im))

      1. Initial program 99.0%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot e^{re}} \]
        2. lower-exp.f6464.3

          \[\leadsto im \cdot \color{blue}{e^{re}} \]
      5. Applied rewrites64.3%

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      6. Taylor expanded in re around 0

        \[\leadsto \color{blue}{im + re \cdot \left(im + re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right)\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{re \cdot \left(im + re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right)\right) + im} \]
        2. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(re, im + re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right), im\right)} \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right) + im}, im\right) \]
        4. distribute-rgt-inN/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{\left(\left(\frac{1}{6} \cdot \left(im \cdot re\right)\right) \cdot re + \left(\frac{1}{2} \cdot im\right) \cdot re\right)} + im, im\right) \]
        5. associate-*r*N/A

          \[\leadsto \mathsf{fma}\left(re, \left(\left(\frac{1}{6} \cdot \left(im \cdot re\right)\right) \cdot re + \color{blue}{\frac{1}{2} \cdot \left(im \cdot re\right)}\right) + im, im\right) \]
        6. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \left(\color{blue}{\left(\left(im \cdot re\right) \cdot \frac{1}{6}\right)} \cdot re + \frac{1}{2} \cdot \left(im \cdot re\right)\right) + im, im\right) \]
        7. associate-*l*N/A

          \[\leadsto \mathsf{fma}\left(re, \left(\color{blue}{\left(im \cdot re\right) \cdot \left(\frac{1}{6} \cdot re\right)} + \frac{1}{2} \cdot \left(im \cdot re\right)\right) + im, im\right) \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \left(\left(im \cdot re\right) \cdot \left(\frac{1}{6} \cdot re\right) + \color{blue}{\left(im \cdot re\right) \cdot \frac{1}{2}}\right) + im, im\right) \]
        9. distribute-lft-outN/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{\left(im \cdot re\right) \cdot \left(\frac{1}{6} \cdot re + \frac{1}{2}\right)} + im, im\right) \]
        10. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \left(im \cdot re\right) \cdot \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot re\right)} + im, im\right) \]
        11. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(im \cdot re, \frac{1}{2} + \frac{1}{6} \cdot re, im\right)}, im\right) \]
        12. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(\color{blue}{im \cdot re}, \frac{1}{2} + \frac{1}{6} \cdot re, im\right), im\right) \]
        13. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \color{blue}{\frac{1}{6} \cdot re + \frac{1}{2}}, im\right), im\right) \]
        14. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \color{blue}{re \cdot \frac{1}{6}} + \frac{1}{2}, im\right), im\right) \]
        15. lower-fma.f6455.6

          \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \color{blue}{\mathsf{fma}\left(re, 0.16666666666666666, 0.5\right)}, im\right), im\right) \]
      8. Applied rewrites55.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), im\right), im\right)} \]
      9. Taylor expanded in re around inf

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

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

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

          \[\leadsto \mathsf{fma}\left(re, im \cdot \color{blue}{\left(\frac{1}{6} \cdot {re}^{2}\right)}, im\right) \]
        4. unpow2N/A

          \[\leadsto \mathsf{fma}\left(re, im \cdot \left(\frac{1}{6} \cdot \color{blue}{\left(re \cdot re\right)}\right), im\right) \]
        5. associate-*r*N/A

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

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{im \cdot \left(\left(\frac{1}{6} \cdot re\right) \cdot re\right)}, im\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, im \cdot \color{blue}{\left(re \cdot \left(\frac{1}{6} \cdot re\right)\right)}, im\right) \]
        8. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(re, im \cdot \color{blue}{\left(re \cdot \left(\frac{1}{6} \cdot re\right)\right)}, im\right) \]
        9. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, im \cdot \left(re \cdot \color{blue}{\left(re \cdot \frac{1}{6}\right)}\right), im\right) \]
        10. lower-*.f6457.3

          \[\leadsto \mathsf{fma}\left(re, im \cdot \left(re \cdot \color{blue}{\left(re \cdot 0.16666666666666666\right)}\right), im\right) \]
      11. Applied rewrites57.3%

        \[\leadsto \mathsf{fma}\left(re, \color{blue}{im \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right)}, im\right) \]
      12. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto re \cdot \left(im \cdot \left(re \cdot \color{blue}{\left(re \cdot \frac{1}{6}\right)}\right)\right) + im \]
        2. lift-*.f64N/A

          \[\leadsto re \cdot \left(im \cdot \color{blue}{\left(re \cdot \left(re \cdot \frac{1}{6}\right)\right)}\right) + im \]
        3. lift-*.f64N/A

          \[\leadsto re \cdot \color{blue}{\left(im \cdot \left(re \cdot \left(re \cdot \frac{1}{6}\right)\right)\right)} + im \]
        4. lift-*.f64N/A

          \[\leadsto re \cdot \color{blue}{\left(im \cdot \left(re \cdot \left(re \cdot \frac{1}{6}\right)\right)\right)} + im \]
        5. *-commutativeN/A

          \[\leadsto re \cdot \color{blue}{\left(\left(re \cdot \left(re \cdot \frac{1}{6}\right)\right) \cdot im\right)} + im \]
        6. associate-*r*N/A

          \[\leadsto \color{blue}{\left(re \cdot \left(re \cdot \left(re \cdot \frac{1}{6}\right)\right)\right) \cdot im} + im \]
        7. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(re \cdot \left(re \cdot \left(re \cdot \frac{1}{6}\right)\right), im, im\right)} \]
        8. lower-*.f6457.3

          \[\leadsto \mathsf{fma}\left(\color{blue}{re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right)}, im, im\right) \]
      13. Applied rewrites57.3%

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

    Alternative 11: 22.4% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\ \;\;\;\;im \cdot \mathsf{fma}\left(re, -0.16666666666666666 \cdot \left(im \cdot im\right), re\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(re, im \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right), im\right)\\ \end{array} \end{array} \]
    (FPCore (re im)
     :precision binary64
     (if (<= (* (exp re) (sin im)) 0.0)
       (* im (fma re (* -0.16666666666666666 (* im im)) re))
       (fma re (* im (* re (* re 0.16666666666666666))) im)))
    double code(double re, double im) {
    	double tmp;
    	if ((exp(re) * sin(im)) <= 0.0) {
    		tmp = im * fma(re, (-0.16666666666666666 * (im * im)), re);
    	} else {
    		tmp = fma(re, (im * (re * (re * 0.16666666666666666))), im);
    	}
    	return tmp;
    }
    
    function code(re, im)
    	tmp = 0.0
    	if (Float64(exp(re) * sin(im)) <= 0.0)
    		tmp = Float64(im * fma(re, Float64(-0.16666666666666666 * Float64(im * im)), re));
    	else
    		tmp = fma(re, Float64(im * Float64(re * Float64(re * 0.16666666666666666))), im);
    	end
    	return tmp
    end
    
    code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.0], N[(im * N[(re * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + re), $MachinePrecision]), $MachinePrecision], N[(re * N[(im * N[(re * N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + im), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
    \;\;\;\;im \cdot \mathsf{fma}\left(re, -0.16666666666666666 \cdot \left(im \cdot im\right), re\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(re, im \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right), im\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0

      1. Initial program 100.0%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in re around 0

        \[\leadsto \color{blue}{\left(1 + re\right)} \cdot \sin im \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
        2. lower-+.f6441.0

          \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
      5. Applied rewrites41.0%

        \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
      6. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot \left(1 + \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right)\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(\left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + 1\right)} \]
        2. distribute-lft-inN/A

          \[\leadsto \color{blue}{im \cdot \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + im \cdot 1} \]
        3. *-rgt-identityN/A

          \[\leadsto im \cdot \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + \color{blue}{im} \]
        4. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(im, re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right), im\right)} \]
      8. Applied rewrites28.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, \mathsf{fma}\left(im \cdot \mathsf{fma}\left(im, re, im\right), \mathsf{fma}\left(im \cdot im, 0.008333333333333333, -0.16666666666666666\right), re\right), im\right)} \]
      9. Taylor expanded in re around inf

        \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)\right)} \]
      10. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)\right)} \]
        2. +-commutativeN/A

          \[\leadsto im \cdot \left(re \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) + 1\right)}\right) \]
        3. distribute-rgt-inN/A

          \[\leadsto im \cdot \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right) \cdot re + 1 \cdot re\right)} \]
        4. associate-*l*N/A

          \[\leadsto im \cdot \left(\color{blue}{{im}^{2} \cdot \left(\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re\right)} + 1 \cdot re\right) \]
        5. *-lft-identityN/A

          \[\leadsto im \cdot \left({im}^{2} \cdot \left(\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re\right) + \color{blue}{re}\right) \]
        6. lower-fma.f64N/A

          \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left({im}^{2}, \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re, re\right)} \]
        7. unpow2N/A

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

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

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re}, re\right) \]
        10. sub-negN/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\left(\frac{1}{120} \cdot {im}^{2} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right)} \cdot re, re\right) \]
        11. *-commutativeN/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{{im}^{2} \cdot \frac{1}{120}} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
        12. unpow2N/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{120} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
        13. associate-*l*N/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{im \cdot \left(im \cdot \frac{1}{120}\right)} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
        14. metadata-evalN/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(im \cdot \left(im \cdot \frac{1}{120}\right) + \color{blue}{\frac{-1}{6}}\right) \cdot re, re\right) \]
        15. lower-fma.f64N/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\mathsf{fma}\left(im, im \cdot \frac{1}{120}, \frac{-1}{6}\right)} \cdot re, re\right) \]
        16. lower-*.f648.3

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, \color{blue}{im \cdot 0.008333333333333333}, -0.16666666666666666\right) \cdot re, re\right) \]
      11. Applied rewrites8.3%

        \[\leadsto \color{blue}{im \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.008333333333333333, -0.16666666666666666\right) \cdot re, re\right)} \]
      12. Taylor expanded in im around 0

        \[\leadsto im \cdot \color{blue}{\left(re + \frac{-1}{6} \cdot \left({im}^{2} \cdot re\right)\right)} \]
      13. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(\frac{-1}{6} \cdot \left({im}^{2} \cdot re\right) + re\right)} \]
        2. associate-*r*N/A

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

          \[\leadsto im \cdot \left(\color{blue}{re \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right)} + re\right) \]
        4. lower-fma.f64N/A

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

          \[\leadsto im \cdot \mathsf{fma}\left(re, \color{blue}{\frac{-1}{6} \cdot {im}^{2}}, re\right) \]
        6. unpow2N/A

          \[\leadsto im \cdot \mathsf{fma}\left(re, \frac{-1}{6} \cdot \color{blue}{\left(im \cdot im\right)}, re\right) \]
        7. lower-*.f648.4

          \[\leadsto im \cdot \mathsf{fma}\left(re, -0.16666666666666666 \cdot \color{blue}{\left(im \cdot im\right)}, re\right) \]
      14. Applied rewrites8.4%

        \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left(re, -0.16666666666666666 \cdot \left(im \cdot im\right), re\right)} \]

      if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im))

      1. Initial program 99.0%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot e^{re}} \]
        2. lower-exp.f6464.3

          \[\leadsto im \cdot \color{blue}{e^{re}} \]
      5. Applied rewrites64.3%

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      6. Taylor expanded in re around 0

        \[\leadsto \color{blue}{im + re \cdot \left(im + re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right)\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{re \cdot \left(im + re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right)\right) + im} \]
        2. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(re, im + re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right), im\right)} \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right) + im}, im\right) \]
        4. distribute-rgt-inN/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{\left(\left(\frac{1}{6} \cdot \left(im \cdot re\right)\right) \cdot re + \left(\frac{1}{2} \cdot im\right) \cdot re\right)} + im, im\right) \]
        5. associate-*r*N/A

          \[\leadsto \mathsf{fma}\left(re, \left(\left(\frac{1}{6} \cdot \left(im \cdot re\right)\right) \cdot re + \color{blue}{\frac{1}{2} \cdot \left(im \cdot re\right)}\right) + im, im\right) \]
        6. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \left(\color{blue}{\left(\left(im \cdot re\right) \cdot \frac{1}{6}\right)} \cdot re + \frac{1}{2} \cdot \left(im \cdot re\right)\right) + im, im\right) \]
        7. associate-*l*N/A

          \[\leadsto \mathsf{fma}\left(re, \left(\color{blue}{\left(im \cdot re\right) \cdot \left(\frac{1}{6} \cdot re\right)} + \frac{1}{2} \cdot \left(im \cdot re\right)\right) + im, im\right) \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \left(\left(im \cdot re\right) \cdot \left(\frac{1}{6} \cdot re\right) + \color{blue}{\left(im \cdot re\right) \cdot \frac{1}{2}}\right) + im, im\right) \]
        9. distribute-lft-outN/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{\left(im \cdot re\right) \cdot \left(\frac{1}{6} \cdot re + \frac{1}{2}\right)} + im, im\right) \]
        10. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \left(im \cdot re\right) \cdot \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot re\right)} + im, im\right) \]
        11. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(im \cdot re, \frac{1}{2} + \frac{1}{6} \cdot re, im\right)}, im\right) \]
        12. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(\color{blue}{im \cdot re}, \frac{1}{2} + \frac{1}{6} \cdot re, im\right), im\right) \]
        13. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \color{blue}{\frac{1}{6} \cdot re + \frac{1}{2}}, im\right), im\right) \]
        14. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \color{blue}{re \cdot \frac{1}{6}} + \frac{1}{2}, im\right), im\right) \]
        15. lower-fma.f6455.6

          \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \color{blue}{\mathsf{fma}\left(re, 0.16666666666666666, 0.5\right)}, im\right), im\right) \]
      8. Applied rewrites55.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), im\right), im\right)} \]
      9. Taylor expanded in re around inf

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

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

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

          \[\leadsto \mathsf{fma}\left(re, im \cdot \color{blue}{\left(\frac{1}{6} \cdot {re}^{2}\right)}, im\right) \]
        4. unpow2N/A

          \[\leadsto \mathsf{fma}\left(re, im \cdot \left(\frac{1}{6} \cdot \color{blue}{\left(re \cdot re\right)}\right), im\right) \]
        5. associate-*r*N/A

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

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{im \cdot \left(\left(\frac{1}{6} \cdot re\right) \cdot re\right)}, im\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, im \cdot \color{blue}{\left(re \cdot \left(\frac{1}{6} \cdot re\right)\right)}, im\right) \]
        8. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(re, im \cdot \color{blue}{\left(re \cdot \left(\frac{1}{6} \cdot re\right)\right)}, im\right) \]
        9. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, im \cdot \left(re \cdot \color{blue}{\left(re \cdot \frac{1}{6}\right)}\right), im\right) \]
        10. lower-*.f6457.3

          \[\leadsto \mathsf{fma}\left(re, im \cdot \left(re \cdot \color{blue}{\left(re \cdot 0.16666666666666666\right)}\right), im\right) \]
      11. Applied rewrites57.3%

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

    Alternative 12: 22.0% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\ \;\;\;\;im \cdot \mathsf{fma}\left(re, -0.16666666666666666 \cdot \left(im \cdot im\right), re\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\\ \end{array} \end{array} \]
    (FPCore (re im)
     :precision binary64
     (if (<= (* (exp re) (sin im)) 0.0)
       (* im (fma re (* -0.16666666666666666 (* im im)) re))
       (* im (fma re (fma re 0.5 1.0) 1.0))))
    double code(double re, double im) {
    	double tmp;
    	if ((exp(re) * sin(im)) <= 0.0) {
    		tmp = im * fma(re, (-0.16666666666666666 * (im * im)), re);
    	} else {
    		tmp = im * fma(re, fma(re, 0.5, 1.0), 1.0);
    	}
    	return tmp;
    }
    
    function code(re, im)
    	tmp = 0.0
    	if (Float64(exp(re) * sin(im)) <= 0.0)
    		tmp = Float64(im * fma(re, Float64(-0.16666666666666666 * Float64(im * im)), re));
    	else
    		tmp = Float64(im * fma(re, fma(re, 0.5, 1.0), 1.0));
    	end
    	return tmp
    end
    
    code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.0], N[(im * N[(re * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + re), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
    \;\;\;\;im \cdot \mathsf{fma}\left(re, -0.16666666666666666 \cdot \left(im \cdot im\right), re\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0

      1. Initial program 100.0%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in re around 0

        \[\leadsto \color{blue}{\left(1 + re\right)} \cdot \sin im \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
        2. lower-+.f6441.0

          \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
      5. Applied rewrites41.0%

        \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
      6. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot \left(1 + \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right)\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(\left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + 1\right)} \]
        2. distribute-lft-inN/A

          \[\leadsto \color{blue}{im \cdot \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + im \cdot 1} \]
        3. *-rgt-identityN/A

          \[\leadsto im \cdot \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + \color{blue}{im} \]
        4. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(im, re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right), im\right)} \]
      8. Applied rewrites28.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, \mathsf{fma}\left(im \cdot \mathsf{fma}\left(im, re, im\right), \mathsf{fma}\left(im \cdot im, 0.008333333333333333, -0.16666666666666666\right), re\right), im\right)} \]
      9. Taylor expanded in re around inf

        \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)\right)} \]
      10. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)\right)} \]
        2. +-commutativeN/A

          \[\leadsto im \cdot \left(re \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) + 1\right)}\right) \]
        3. distribute-rgt-inN/A

          \[\leadsto im \cdot \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right) \cdot re + 1 \cdot re\right)} \]
        4. associate-*l*N/A

          \[\leadsto im \cdot \left(\color{blue}{{im}^{2} \cdot \left(\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re\right)} + 1 \cdot re\right) \]
        5. *-lft-identityN/A

          \[\leadsto im \cdot \left({im}^{2} \cdot \left(\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re\right) + \color{blue}{re}\right) \]
        6. lower-fma.f64N/A

          \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left({im}^{2}, \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re, re\right)} \]
        7. unpow2N/A

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

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

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re}, re\right) \]
        10. sub-negN/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\left(\frac{1}{120} \cdot {im}^{2} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right)} \cdot re, re\right) \]
        11. *-commutativeN/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{{im}^{2} \cdot \frac{1}{120}} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
        12. unpow2N/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{120} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
        13. associate-*l*N/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{im \cdot \left(im \cdot \frac{1}{120}\right)} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
        14. metadata-evalN/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(im \cdot \left(im \cdot \frac{1}{120}\right) + \color{blue}{\frac{-1}{6}}\right) \cdot re, re\right) \]
        15. lower-fma.f64N/A

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\mathsf{fma}\left(im, im \cdot \frac{1}{120}, \frac{-1}{6}\right)} \cdot re, re\right) \]
        16. lower-*.f648.3

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, \color{blue}{im \cdot 0.008333333333333333}, -0.16666666666666666\right) \cdot re, re\right) \]
      11. Applied rewrites8.3%

        \[\leadsto \color{blue}{im \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.008333333333333333, -0.16666666666666666\right) \cdot re, re\right)} \]
      12. Taylor expanded in im around 0

        \[\leadsto im \cdot \color{blue}{\left(re + \frac{-1}{6} \cdot \left({im}^{2} \cdot re\right)\right)} \]
      13. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(\frac{-1}{6} \cdot \left({im}^{2} \cdot re\right) + re\right)} \]
        2. associate-*r*N/A

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

          \[\leadsto im \cdot \left(\color{blue}{re \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right)} + re\right) \]
        4. lower-fma.f64N/A

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

          \[\leadsto im \cdot \mathsf{fma}\left(re, \color{blue}{\frac{-1}{6} \cdot {im}^{2}}, re\right) \]
        6. unpow2N/A

          \[\leadsto im \cdot \mathsf{fma}\left(re, \frac{-1}{6} \cdot \color{blue}{\left(im \cdot im\right)}, re\right) \]
        7. lower-*.f648.4

          \[\leadsto im \cdot \mathsf{fma}\left(re, -0.16666666666666666 \cdot \color{blue}{\left(im \cdot im\right)}, re\right) \]
      14. Applied rewrites8.4%

        \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left(re, -0.16666666666666666 \cdot \left(im \cdot im\right), re\right)} \]

      if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im))

      1. Initial program 99.0%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot e^{re}} \]
        2. lower-exp.f6464.3

          \[\leadsto im \cdot \color{blue}{e^{re}} \]
      5. Applied rewrites64.3%

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      6. Taylor expanded in re around 0

        \[\leadsto im \cdot \color{blue}{\left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right) + 1\right)} \]
        2. lower-fma.f64N/A

          \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left(re, 1 + \frac{1}{2} \cdot re, 1\right)} \]
        3. +-commutativeN/A

          \[\leadsto im \cdot \mathsf{fma}\left(re, \color{blue}{\frac{1}{2} \cdot re + 1}, 1\right) \]
        4. *-commutativeN/A

          \[\leadsto im \cdot \mathsf{fma}\left(re, \color{blue}{re \cdot \frac{1}{2}} + 1, 1\right) \]
        5. lower-fma.f6456.4

          \[\leadsto im \cdot \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, 0.5, 1\right)}, 1\right) \]
      8. Applied rewrites56.4%

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

    Alternative 13: 34.1% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 4 \cdot 10^{-6}:\\ \;\;\;\;\mathsf{fma}\left(im \cdot im, im \cdot -0.16666666666666666, im\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot re\right) \cdot \left(re \cdot \left(im \cdot 0.16666666666666666\right)\right)\\ \end{array} \end{array} \]
    (FPCore (re im)
     :precision binary64
     (if (<= (* (exp re) (sin im)) 4e-6)
       (fma (* im im) (* im -0.16666666666666666) im)
       (* (* re re) (* re (* im 0.16666666666666666)))))
    double code(double re, double im) {
    	double tmp;
    	if ((exp(re) * sin(im)) <= 4e-6) {
    		tmp = fma((im * im), (im * -0.16666666666666666), im);
    	} else {
    		tmp = (re * re) * (re * (im * 0.16666666666666666));
    	}
    	return tmp;
    }
    
    function code(re, im)
    	tmp = 0.0
    	if (Float64(exp(re) * sin(im)) <= 4e-6)
    		tmp = fma(Float64(im * im), Float64(im * -0.16666666666666666), im);
    	else
    		tmp = Float64(Float64(re * re) * Float64(re * Float64(im * 0.16666666666666666)));
    	end
    	return tmp
    end
    
    code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 4e-6], N[(N[(im * im), $MachinePrecision] * N[(im * -0.16666666666666666), $MachinePrecision] + im), $MachinePrecision], N[(N[(re * re), $MachinePrecision] * N[(re * N[(im * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;e^{re} \cdot \sin im \leq 4 \cdot 10^{-6}:\\
    \;\;\;\;\mathsf{fma}\left(im \cdot im, im \cdot -0.16666666666666666, im\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(re \cdot re\right) \cdot \left(re \cdot \left(im \cdot 0.16666666666666666\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (exp.f64 re) (sin.f64 im)) < 3.99999999999999982e-6

      1. Initial program 100.0%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in re around 0

        \[\leadsto \color{blue}{\sin im} \]
      4. Step-by-step derivation
        1. lower-sin.f6451.8

          \[\leadsto \color{blue}{\sin im} \]
      5. Applied rewrites51.8%

        \[\leadsto \color{blue}{\sin im} \]
      6. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{2}\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(\frac{-1}{6} \cdot {im}^{2} + 1\right)} \]
        2. distribute-rgt-inN/A

          \[\leadsto \color{blue}{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot im + 1 \cdot im} \]
        3. *-commutativeN/A

          \[\leadsto \color{blue}{\left({im}^{2} \cdot \frac{-1}{6}\right)} \cdot im + 1 \cdot im \]
        4. associate-*l*N/A

          \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{-1}{6} \cdot im\right)} + 1 \cdot im \]
        5. *-lft-identityN/A

          \[\leadsto {im}^{2} \cdot \left(\frac{-1}{6} \cdot im\right) + \color{blue}{im} \]
        6. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{-1}{6} \cdot im, im\right)} \]
        7. unpow2N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{-1}{6} \cdot im, im\right) \]
        8. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{-1}{6} \cdot im, im\right) \]
        9. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{im \cdot \frac{-1}{6}}, im\right) \]
        10. lower-*.f6442.2

          \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{im \cdot -0.16666666666666666}, im\right) \]
      8. Applied rewrites42.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im \cdot im, im \cdot -0.16666666666666666, im\right)} \]

      if 3.99999999999999982e-6 < (*.f64 (exp.f64 re) (sin.f64 im))

      1. Initial program 98.3%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot e^{re}} \]
        2. lower-exp.f6439.7

          \[\leadsto im \cdot \color{blue}{e^{re}} \]
      5. Applied rewrites39.7%

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      6. Taylor expanded in re around 0

        \[\leadsto \color{blue}{im + re \cdot \left(im + re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right)\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{re \cdot \left(im + re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right)\right) + im} \]
        2. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(re, im + re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right), im\right)} \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{re \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right) + \frac{1}{2} \cdot im\right) + im}, im\right) \]
        4. distribute-rgt-inN/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{\left(\left(\frac{1}{6} \cdot \left(im \cdot re\right)\right) \cdot re + \left(\frac{1}{2} \cdot im\right) \cdot re\right)} + im, im\right) \]
        5. associate-*r*N/A

          \[\leadsto \mathsf{fma}\left(re, \left(\left(\frac{1}{6} \cdot \left(im \cdot re\right)\right) \cdot re + \color{blue}{\frac{1}{2} \cdot \left(im \cdot re\right)}\right) + im, im\right) \]
        6. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \left(\color{blue}{\left(\left(im \cdot re\right) \cdot \frac{1}{6}\right)} \cdot re + \frac{1}{2} \cdot \left(im \cdot re\right)\right) + im, im\right) \]
        7. associate-*l*N/A

          \[\leadsto \mathsf{fma}\left(re, \left(\color{blue}{\left(im \cdot re\right) \cdot \left(\frac{1}{6} \cdot re\right)} + \frac{1}{2} \cdot \left(im \cdot re\right)\right) + im, im\right) \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \left(\left(im \cdot re\right) \cdot \left(\frac{1}{6} \cdot re\right) + \color{blue}{\left(im \cdot re\right) \cdot \frac{1}{2}}\right) + im, im\right) \]
        9. distribute-lft-outN/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{\left(im \cdot re\right) \cdot \left(\frac{1}{6} \cdot re + \frac{1}{2}\right)} + im, im\right) \]
        10. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \left(im \cdot re\right) \cdot \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot re\right)} + im, im\right) \]
        11. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(im \cdot re, \frac{1}{2} + \frac{1}{6} \cdot re, im\right)}, im\right) \]
        12. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(\color{blue}{im \cdot re}, \frac{1}{2} + \frac{1}{6} \cdot re, im\right), im\right) \]
        13. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \color{blue}{\frac{1}{6} \cdot re + \frac{1}{2}}, im\right), im\right) \]
        14. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \color{blue}{re \cdot \frac{1}{6}} + \frac{1}{2}, im\right), im\right) \]
        15. lower-fma.f6426.7

          \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \color{blue}{\mathsf{fma}\left(re, 0.16666666666666666, 0.5\right)}, im\right), im\right) \]
      8. Applied rewrites26.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(re, \mathsf{fma}\left(im \cdot re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), im\right), im\right)} \]
      9. Taylor expanded in re around inf

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

          \[\leadsto \color{blue}{\left(\frac{1}{6} \cdot im\right) \cdot {re}^{3}} \]
        2. *-commutativeN/A

          \[\leadsto \color{blue}{{re}^{3} \cdot \left(\frac{1}{6} \cdot im\right)} \]
        3. unpow3N/A

          \[\leadsto \color{blue}{\left(\left(re \cdot re\right) \cdot re\right)} \cdot \left(\frac{1}{6} \cdot im\right) \]
        4. unpow2N/A

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

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

          \[\leadsto {re}^{2} \cdot \color{blue}{\left(\left(\frac{1}{6} \cdot im\right) \cdot re\right)} \]
        7. associate-*r*N/A

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

          \[\leadsto \color{blue}{{re}^{2} \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right)\right)} \]
        9. unpow2N/A

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

          \[\leadsto \color{blue}{\left(re \cdot re\right)} \cdot \left(\frac{1}{6} \cdot \left(im \cdot re\right)\right) \]
        11. associate-*r*N/A

          \[\leadsto \left(re \cdot re\right) \cdot \color{blue}{\left(\left(\frac{1}{6} \cdot im\right) \cdot re\right)} \]
        12. *-commutativeN/A

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

          \[\leadsto \left(re \cdot re\right) \cdot \color{blue}{\left(re \cdot \left(\frac{1}{6} \cdot im\right)\right)} \]
        14. *-commutativeN/A

          \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \color{blue}{\left(im \cdot \frac{1}{6}\right)}\right) \]
        15. lower-*.f6429.6

          \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \color{blue}{\left(im \cdot 0.16666666666666666\right)}\right) \]
      11. Applied rewrites29.6%

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

    Alternative 14: 33.8% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\ \;\;\;\;\mathsf{fma}\left(im \cdot im, im \cdot -0.16666666666666666, im\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\\ \end{array} \end{array} \]
    (FPCore (re im)
     :precision binary64
     (if (<= (* (exp re) (sin im)) 0.0)
       (fma (* im im) (* im -0.16666666666666666) im)
       (* im (fma re (fma re 0.5 1.0) 1.0))))
    double code(double re, double im) {
    	double tmp;
    	if ((exp(re) * sin(im)) <= 0.0) {
    		tmp = fma((im * im), (im * -0.16666666666666666), im);
    	} else {
    		tmp = im * fma(re, fma(re, 0.5, 1.0), 1.0);
    	}
    	return tmp;
    }
    
    function code(re, im)
    	tmp = 0.0
    	if (Float64(exp(re) * sin(im)) <= 0.0)
    		tmp = fma(Float64(im * im), Float64(im * -0.16666666666666666), im);
    	else
    		tmp = Float64(im * fma(re, fma(re, 0.5, 1.0), 1.0));
    	end
    	return tmp
    end
    
    code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(im * im), $MachinePrecision] * N[(im * -0.16666666666666666), $MachinePrecision] + im), $MachinePrecision], N[(im * N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
    \;\;\;\;\mathsf{fma}\left(im \cdot im, im \cdot -0.16666666666666666, im\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0

      1. Initial program 100.0%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in re around 0

        \[\leadsto \color{blue}{\sin im} \]
      4. Step-by-step derivation
        1. lower-sin.f6440.3

          \[\leadsto \color{blue}{\sin im} \]
      5. Applied rewrites40.3%

        \[\leadsto \color{blue}{\sin im} \]
      6. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{2}\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(\frac{-1}{6} \cdot {im}^{2} + 1\right)} \]
        2. distribute-rgt-inN/A

          \[\leadsto \color{blue}{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot im + 1 \cdot im} \]
        3. *-commutativeN/A

          \[\leadsto \color{blue}{\left({im}^{2} \cdot \frac{-1}{6}\right)} \cdot im + 1 \cdot im \]
        4. associate-*l*N/A

          \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{-1}{6} \cdot im\right)} + 1 \cdot im \]
        5. *-lft-identityN/A

          \[\leadsto {im}^{2} \cdot \left(\frac{-1}{6} \cdot im\right) + \color{blue}{im} \]
        6. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{-1}{6} \cdot im, im\right)} \]
        7. unpow2N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{-1}{6} \cdot im, im\right) \]
        8. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{-1}{6} \cdot im, im\right) \]
        9. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{im \cdot \frac{-1}{6}}, im\right) \]
        10. lower-*.f6428.3

          \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{im \cdot -0.16666666666666666}, im\right) \]
      8. Applied rewrites28.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im \cdot im, im \cdot -0.16666666666666666, im\right)} \]

      if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im))

      1. Initial program 99.0%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot e^{re}} \]
        2. lower-exp.f6464.3

          \[\leadsto im \cdot \color{blue}{e^{re}} \]
      5. Applied rewrites64.3%

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      6. Taylor expanded in re around 0

        \[\leadsto im \cdot \color{blue}{\left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right) + 1\right)} \]
        2. lower-fma.f64N/A

          \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left(re, 1 + \frac{1}{2} \cdot re, 1\right)} \]
        3. +-commutativeN/A

          \[\leadsto im \cdot \mathsf{fma}\left(re, \color{blue}{\frac{1}{2} \cdot re + 1}, 1\right) \]
        4. *-commutativeN/A

          \[\leadsto im \cdot \mathsf{fma}\left(re, \color{blue}{re \cdot \frac{1}{2}} + 1, 1\right) \]
        5. lower-fma.f6456.4

          \[\leadsto im \cdot \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, 0.5, 1\right)}, 1\right) \]
      8. Applied rewrites56.4%

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

    Alternative 15: 33.6% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 4 \cdot 10^{-6}:\\ \;\;\;\;\mathsf{fma}\left(im \cdot im, im \cdot -0.16666666666666666, im\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(re \cdot 0.5\right)\right)\\ \end{array} \end{array} \]
    (FPCore (re im)
     :precision binary64
     (if (<= (* (exp re) (sin im)) 4e-6)
       (fma (* im im) (* im -0.16666666666666666) im)
       (* im (* re (* re 0.5)))))
    double code(double re, double im) {
    	double tmp;
    	if ((exp(re) * sin(im)) <= 4e-6) {
    		tmp = fma((im * im), (im * -0.16666666666666666), im);
    	} else {
    		tmp = im * (re * (re * 0.5));
    	}
    	return tmp;
    }
    
    function code(re, im)
    	tmp = 0.0
    	if (Float64(exp(re) * sin(im)) <= 4e-6)
    		tmp = fma(Float64(im * im), Float64(im * -0.16666666666666666), im);
    	else
    		tmp = Float64(im * Float64(re * Float64(re * 0.5)));
    	end
    	return tmp
    end
    
    code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 4e-6], N[(N[(im * im), $MachinePrecision] * N[(im * -0.16666666666666666), $MachinePrecision] + im), $MachinePrecision], N[(im * N[(re * N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;e^{re} \cdot \sin im \leq 4 \cdot 10^{-6}:\\
    \;\;\;\;\mathsf{fma}\left(im \cdot im, im \cdot -0.16666666666666666, im\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;im \cdot \left(re \cdot \left(re \cdot 0.5\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (exp.f64 re) (sin.f64 im)) < 3.99999999999999982e-6

      1. Initial program 100.0%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in re around 0

        \[\leadsto \color{blue}{\sin im} \]
      4. Step-by-step derivation
        1. lower-sin.f6451.8

          \[\leadsto \color{blue}{\sin im} \]
      5. Applied rewrites51.8%

        \[\leadsto \color{blue}{\sin im} \]
      6. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{2}\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(\frac{-1}{6} \cdot {im}^{2} + 1\right)} \]
        2. distribute-rgt-inN/A

          \[\leadsto \color{blue}{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot im + 1 \cdot im} \]
        3. *-commutativeN/A

          \[\leadsto \color{blue}{\left({im}^{2} \cdot \frac{-1}{6}\right)} \cdot im + 1 \cdot im \]
        4. associate-*l*N/A

          \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{-1}{6} \cdot im\right)} + 1 \cdot im \]
        5. *-lft-identityN/A

          \[\leadsto {im}^{2} \cdot \left(\frac{-1}{6} \cdot im\right) + \color{blue}{im} \]
        6. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{-1}{6} \cdot im, im\right)} \]
        7. unpow2N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{-1}{6} \cdot im, im\right) \]
        8. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{-1}{6} \cdot im, im\right) \]
        9. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{im \cdot \frac{-1}{6}}, im\right) \]
        10. lower-*.f6442.2

          \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{im \cdot -0.16666666666666666}, im\right) \]
      8. Applied rewrites42.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im \cdot im, im \cdot -0.16666666666666666, im\right)} \]

      if 3.99999999999999982e-6 < (*.f64 (exp.f64 re) (sin.f64 im))

      1. Initial program 98.3%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot e^{re}} \]
        2. lower-exp.f6439.7

          \[\leadsto im \cdot \color{blue}{e^{re}} \]
      5. Applied rewrites39.7%

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      6. Taylor expanded in re around 0

        \[\leadsto im \cdot \color{blue}{\left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right) + 1\right)} \]
        2. lower-fma.f64N/A

          \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left(re, 1 + \frac{1}{2} \cdot re, 1\right)} \]
        3. +-commutativeN/A

          \[\leadsto im \cdot \mathsf{fma}\left(re, \color{blue}{\frac{1}{2} \cdot re + 1}, 1\right) \]
        4. *-commutativeN/A

          \[\leadsto im \cdot \mathsf{fma}\left(re, \color{blue}{re \cdot \frac{1}{2}} + 1, 1\right) \]
        5. lower-fma.f6428.0

          \[\leadsto im \cdot \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, 0.5, 1\right)}, 1\right) \]
      8. Applied rewrites28.0%

        \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)} \]
      9. Taylor expanded in re around inf

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

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

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

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

          \[\leadsto \color{blue}{im \cdot \left(\frac{1}{2} \cdot {re}^{2}\right)} \]
        5. unpow2N/A

          \[\leadsto im \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(re \cdot re\right)}\right) \]
        6. associate-*r*N/A

          \[\leadsto im \cdot \color{blue}{\left(\left(\frac{1}{2} \cdot re\right) \cdot re\right)} \]
        7. *-commutativeN/A

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

          \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(\frac{1}{2} \cdot re\right)\right)} \]
        9. *-commutativeN/A

          \[\leadsto im \cdot \left(re \cdot \color{blue}{\left(re \cdot \frac{1}{2}\right)}\right) \]
        10. lower-*.f6428.7

          \[\leadsto im \cdot \left(re \cdot \color{blue}{\left(re \cdot 0.5\right)}\right) \]
      11. Applied rewrites28.7%

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

    Alternative 16: 33.5% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 0.26:\\ \;\;\;\;\mathsf{fma}\left(im, re, im\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(re \cdot 0.5\right)\right)\\ \end{array} \end{array} \]
    (FPCore (re im)
     :precision binary64
     (if (<= (* (exp re) (sin im)) 0.26) (fma im re im) (* im (* re (* re 0.5)))))
    double code(double re, double im) {
    	double tmp;
    	if ((exp(re) * sin(im)) <= 0.26) {
    		tmp = fma(im, re, im);
    	} else {
    		tmp = im * (re * (re * 0.5));
    	}
    	return tmp;
    }
    
    function code(re, im)
    	tmp = 0.0
    	if (Float64(exp(re) * sin(im)) <= 0.26)
    		tmp = fma(im, re, im);
    	else
    		tmp = Float64(im * Float64(re * Float64(re * 0.5)));
    	end
    	return tmp
    end
    
    code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.26], N[(im * re + im), $MachinePrecision], N[(im * N[(re * N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;e^{re} \cdot \sin im \leq 0.26:\\
    \;\;\;\;\mathsf{fma}\left(im, re, im\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;im \cdot \left(re \cdot \left(re \cdot 0.5\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.26000000000000001

      1. Initial program 100.0%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot e^{re}} \]
        2. lower-exp.f6479.6

          \[\leadsto im \cdot \color{blue}{e^{re}} \]
      5. Applied rewrites79.6%

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      6. Taylor expanded in re around 0

        \[\leadsto \color{blue}{im + im \cdot re} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{im \cdot re + im} \]
        2. lower-fma.f6440.0

          \[\leadsto \color{blue}{\mathsf{fma}\left(im, re, im\right)} \]
      8. Applied rewrites40.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, re, im\right)} \]

      if 0.26000000000000001 < (*.f64 (exp.f64 re) (sin.f64 im))

      1. Initial program 98.2%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot e^{re}} \]
        2. lower-exp.f6443.0

          \[\leadsto im \cdot \color{blue}{e^{re}} \]
      5. Applied rewrites43.0%

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      6. Taylor expanded in re around 0

        \[\leadsto im \cdot \color{blue}{\left(1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right) + 1\right)} \]
        2. lower-fma.f64N/A

          \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left(re, 1 + \frac{1}{2} \cdot re, 1\right)} \]
        3. +-commutativeN/A

          \[\leadsto im \cdot \mathsf{fma}\left(re, \color{blue}{\frac{1}{2} \cdot re + 1}, 1\right) \]
        4. *-commutativeN/A

          \[\leadsto im \cdot \mathsf{fma}\left(re, \color{blue}{re \cdot \frac{1}{2}} + 1, 1\right) \]
        5. lower-fma.f6430.2

          \[\leadsto im \cdot \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, 0.5, 1\right)}, 1\right) \]
      8. Applied rewrites30.2%

        \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)} \]
      9. Taylor expanded in re around inf

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

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

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

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

          \[\leadsto \color{blue}{im \cdot \left(\frac{1}{2} \cdot {re}^{2}\right)} \]
        5. unpow2N/A

          \[\leadsto im \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(re \cdot re\right)}\right) \]
        6. associate-*r*N/A

          \[\leadsto im \cdot \color{blue}{\left(\left(\frac{1}{2} \cdot re\right) \cdot re\right)} \]
        7. *-commutativeN/A

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

          \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(\frac{1}{2} \cdot re\right)\right)} \]
        9. *-commutativeN/A

          \[\leadsto im \cdot \left(re \cdot \color{blue}{\left(re \cdot \frac{1}{2}\right)}\right) \]
        10. lower-*.f6430.9

          \[\leadsto im \cdot \left(re \cdot \color{blue}{\left(re \cdot 0.5\right)}\right) \]
      11. Applied rewrites30.9%

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

    Alternative 17: 28.5% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 0.998:\\ \;\;\;\;im\\ \mathbf{else}:\\ \;\;\;\;re \cdot im\\ \end{array} \end{array} \]
    (FPCore (re im)
     :precision binary64
     (if (<= (* (exp re) (sin im)) 0.998) im (* re im)))
    double code(double re, double im) {
    	double tmp;
    	if ((exp(re) * sin(im)) <= 0.998) {
    		tmp = im;
    	} else {
    		tmp = re * im;
    	}
    	return tmp;
    }
    
    real(8) function code(re, im)
        real(8), intent (in) :: re
        real(8), intent (in) :: im
        real(8) :: tmp
        if ((exp(re) * sin(im)) <= 0.998d0) then
            tmp = im
        else
            tmp = re * im
        end if
        code = tmp
    end function
    
    public static double code(double re, double im) {
    	double tmp;
    	if ((Math.exp(re) * Math.sin(im)) <= 0.998) {
    		tmp = im;
    	} else {
    		tmp = re * im;
    	}
    	return tmp;
    }
    
    def code(re, im):
    	tmp = 0
    	if (math.exp(re) * math.sin(im)) <= 0.998:
    		tmp = im
    	else:
    		tmp = re * im
    	return tmp
    
    function code(re, im)
    	tmp = 0.0
    	if (Float64(exp(re) * sin(im)) <= 0.998)
    		tmp = im;
    	else
    		tmp = Float64(re * im);
    	end
    	return tmp
    end
    
    function tmp_2 = code(re, im)
    	tmp = 0.0;
    	if ((exp(re) * sin(im)) <= 0.998)
    		tmp = im;
    	else
    		tmp = re * im;
    	end
    	tmp_2 = tmp;
    end
    
    code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.998], im, N[(re * im), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;e^{re} \cdot \sin im \leq 0.998:\\
    \;\;\;\;im\\
    
    \mathbf{else}:\\
    \;\;\;\;re \cdot im\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.998

      1. Initial program 100.0%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot e^{re}} \]
        2. lower-exp.f6472.5

          \[\leadsto im \cdot \color{blue}{e^{re}} \]
      5. Applied rewrites72.5%

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      6. Taylor expanded in re around 0

        \[\leadsto im \cdot \color{blue}{1} \]
      7. Step-by-step derivation
        1. Applied rewrites34.7%

          \[\leadsto im \cdot \color{blue}{1} \]
        2. Step-by-step derivation
          1. *-rgt-identity34.7

            \[\leadsto \color{blue}{im} \]
        3. Applied rewrites34.7%

          \[\leadsto \color{blue}{im} \]

        if 0.998 < (*.f64 (exp.f64 re) (sin.f64 im))

        1. Initial program 97.0%

          \[e^{re} \cdot \sin im \]
        2. Add Preprocessing
        3. Taylor expanded in re around 0

          \[\leadsto \color{blue}{\left(1 + re\right)} \cdot \sin im \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
          2. lower-+.f6410.1

            \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
        5. Applied rewrites10.1%

          \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]
        6. Taylor expanded in im around 0

          \[\leadsto \color{blue}{im \cdot \left(1 + \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right)\right)} \]
        7. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto im \cdot \color{blue}{\left(\left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + 1\right)} \]
          2. distribute-lft-inN/A

            \[\leadsto \color{blue}{im \cdot \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + im \cdot 1} \]
          3. *-rgt-identityN/A

            \[\leadsto im \cdot \left(re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right)\right) + \color{blue}{im} \]
          4. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(im, re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)\right), im\right)} \]
        8. Applied rewrites14.6%

          \[\leadsto \color{blue}{\mathsf{fma}\left(im, \mathsf{fma}\left(im \cdot \mathsf{fma}\left(im, re, im\right), \mathsf{fma}\left(im \cdot im, 0.008333333333333333, -0.16666666666666666\right), re\right), im\right)} \]
        9. Taylor expanded in re around inf

          \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)\right)} \]
        10. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)\right)} \]
          2. +-commutativeN/A

            \[\leadsto im \cdot \left(re \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) + 1\right)}\right) \]
          3. distribute-rgt-inN/A

            \[\leadsto im \cdot \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right) \cdot re + 1 \cdot re\right)} \]
          4. associate-*l*N/A

            \[\leadsto im \cdot \left(\color{blue}{{im}^{2} \cdot \left(\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re\right)} + 1 \cdot re\right) \]
          5. *-lft-identityN/A

            \[\leadsto im \cdot \left({im}^{2} \cdot \left(\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re\right) + \color{blue}{re}\right) \]
          6. lower-fma.f64N/A

            \[\leadsto im \cdot \color{blue}{\mathsf{fma}\left({im}^{2}, \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re, re\right)} \]
          7. unpow2N/A

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

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

            \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right) \cdot re}, re\right) \]
          10. sub-negN/A

            \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\left(\frac{1}{120} \cdot {im}^{2} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right)} \cdot re, re\right) \]
          11. *-commutativeN/A

            \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{{im}^{2} \cdot \frac{1}{120}} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
          12. unpow2N/A

            \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{120} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
          13. associate-*l*N/A

            \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(\color{blue}{im \cdot \left(im \cdot \frac{1}{120}\right)} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right) \cdot re, re\right) \]
          14. metadata-evalN/A

            \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \left(im \cdot \left(im \cdot \frac{1}{120}\right) + \color{blue}{\frac{-1}{6}}\right) \cdot re, re\right) \]
          15. lower-fma.f64N/A

            \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\mathsf{fma}\left(im, im \cdot \frac{1}{120}, \frac{-1}{6}\right)} \cdot re, re\right) \]
          16. lower-*.f6414.8

            \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, \color{blue}{im \cdot 0.008333333333333333}, -0.16666666666666666\right) \cdot re, re\right) \]
        11. Applied rewrites14.8%

          \[\leadsto \color{blue}{im \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.008333333333333333, -0.16666666666666666\right) \cdot re, re\right)} \]
        12. Taylor expanded in im around 0

          \[\leadsto \color{blue}{im \cdot re} \]
        13. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{re \cdot im} \]
          2. lower-*.f6415.0

            \[\leadsto \color{blue}{re \cdot im} \]
        14. Applied rewrites15.0%

          \[\leadsto \color{blue}{re \cdot im} \]
      8. Recombined 2 regimes into one program.
      9. Add Preprocessing

      Alternative 18: 97.0% accurate, 1.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\ \mathbf{if}\;re \leq -0.0022:\\ \;\;\;\;e^{re} \cdot im\\ \mathbf{elif}\;re \leq 0.00028:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;re \leq 1.45 \cdot 10^{+95}:\\ \;\;\;\;e^{re} \cdot \mathsf{fma}\left(im, -0.16666666666666666 \cdot \left(im \cdot im\right), im\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (re im)
       :precision binary64
       (let* ((t_0
               (*
                (sin im)
                (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0))))
         (if (<= re -0.0022)
           (* (exp re) im)
           (if (<= re 0.00028)
             t_0
             (if (<= re 1.45e+95)
               (* (exp re) (fma im (* -0.16666666666666666 (* im im)) im))
               t_0)))))
      double code(double re, double im) {
      	double t_0 = sin(im) * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
      	double tmp;
      	if (re <= -0.0022) {
      		tmp = exp(re) * im;
      	} else if (re <= 0.00028) {
      		tmp = t_0;
      	} else if (re <= 1.45e+95) {
      		tmp = exp(re) * fma(im, (-0.16666666666666666 * (im * im)), im);
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      function code(re, im)
      	t_0 = Float64(sin(im) * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0))
      	tmp = 0.0
      	if (re <= -0.0022)
      		tmp = Float64(exp(re) * im);
      	elseif (re <= 0.00028)
      		tmp = t_0;
      	elseif (re <= 1.45e+95)
      		tmp = Float64(exp(re) * fma(im, Float64(-0.16666666666666666 * Float64(im * im)), im));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      code[re_, im_] := Block[{t$95$0 = N[(N[Sin[im], $MachinePrecision] * N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -0.0022], N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision], If[LessEqual[re, 0.00028], t$95$0, If[LessEqual[re, 1.45e+95], N[(N[Exp[re], $MachinePrecision] * N[(im * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + im), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \sin im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\
      \mathbf{if}\;re \leq -0.0022:\\
      \;\;\;\;e^{re} \cdot im\\
      
      \mathbf{elif}\;re \leq 0.00028:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;re \leq 1.45 \cdot 10^{+95}:\\
      \;\;\;\;e^{re} \cdot \mathsf{fma}\left(im, -0.16666666666666666 \cdot \left(im \cdot im\right), im\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if re < -0.00220000000000000013

        1. Initial program 100.0%

          \[e^{re} \cdot \sin im \]
        2. Add Preprocessing
        3. Taylor expanded in im around 0

          \[\leadsto \color{blue}{im \cdot e^{re}} \]
        4. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \color{blue}{im \cdot e^{re}} \]
          2. lower-exp.f64100.0

            \[\leadsto im \cdot \color{blue}{e^{re}} \]
        5. Applied rewrites100.0%

          \[\leadsto \color{blue}{im \cdot e^{re}} \]

        if -0.00220000000000000013 < re < 2.7999999999999998e-4 or 1.45000000000000007e95 < re

        1. Initial program 100.0%

          \[e^{re} \cdot \sin im \]
        2. Add Preprocessing
        3. Taylor expanded in re around 0

          \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)} \cdot \sin im \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \color{blue}{\left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right) + 1\right)} \cdot \sin im \]
          2. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(re, 1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right), 1\right)} \cdot \sin im \]
          3. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(re, \color{blue}{re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right) + 1}, 1\right) \cdot \sin im \]
          4. lower-fma.f64N/A

            \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, \frac{1}{2} + \frac{1}{6} \cdot re, 1\right)}, 1\right) \cdot \sin im \]
          5. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(re, \color{blue}{\frac{1}{6} \cdot re + \frac{1}{2}}, 1\right), 1\right) \cdot \sin im \]
          6. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(re, \color{blue}{re \cdot \frac{1}{6}} + \frac{1}{2}, 1\right), 1\right) \cdot \sin im \]
          7. lower-fma.f6499.4

            \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, 0.16666666666666666, 0.5\right)}, 1\right), 1\right) \cdot \sin im \]
        5. Applied rewrites99.4%

          \[\leadsto \color{blue}{\mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right)} \cdot \sin im \]

        if 2.7999999999999998e-4 < re < 1.45000000000000007e95

        1. Initial program 95.7%

          \[e^{re} \cdot \sin im \]
        2. Add Preprocessing
        3. Taylor expanded in im around 0

          \[\leadsto \color{blue}{im \cdot \left(e^{re} + \frac{-1}{6} \cdot \left({im}^{2} \cdot e^{re}\right)\right)} \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto im \cdot \color{blue}{\left(\frac{-1}{6} \cdot \left({im}^{2} \cdot e^{re}\right) + e^{re}\right)} \]
          2. associate-*r*N/A

            \[\leadsto im \cdot \left(\color{blue}{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot e^{re}} + e^{re}\right) \]
          3. distribute-lft1-inN/A

            \[\leadsto im \cdot \color{blue}{\left(\left(\frac{-1}{6} \cdot {im}^{2} + 1\right) \cdot e^{re}\right)} \]
          4. +-commutativeN/A

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

            \[\leadsto \color{blue}{\left(im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{2}\right)\right) \cdot e^{re}} \]
          6. *-commutativeN/A

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

            \[\leadsto \color{blue}{e^{re} \cdot \left(im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{2}\right)\right)} \]
          8. lower-exp.f64N/A

            \[\leadsto \color{blue}{e^{re}} \cdot \left(im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{2}\right)\right) \]
          9. +-commutativeN/A

            \[\leadsto e^{re} \cdot \left(im \cdot \color{blue}{\left(\frac{-1}{6} \cdot {im}^{2} + 1\right)}\right) \]
          10. distribute-lft-inN/A

            \[\leadsto e^{re} \cdot \color{blue}{\left(im \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) + im \cdot 1\right)} \]
          11. *-rgt-identityN/A

            \[\leadsto e^{re} \cdot \left(im \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) + \color{blue}{im}\right) \]
          12. lower-fma.f64N/A

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

            \[\leadsto e^{re} \cdot \mathsf{fma}\left(im, \color{blue}{\frac{-1}{6} \cdot {im}^{2}}, im\right) \]
          14. unpow2N/A

            \[\leadsto e^{re} \cdot \mathsf{fma}\left(im, \frac{-1}{6} \cdot \color{blue}{\left(im \cdot im\right)}, im\right) \]
          15. lower-*.f6482.1

            \[\leadsto e^{re} \cdot \mathsf{fma}\left(im, -0.16666666666666666 \cdot \color{blue}{\left(im \cdot im\right)}, im\right) \]
        5. Applied rewrites82.1%

          \[\leadsto \color{blue}{e^{re} \cdot \mathsf{fma}\left(im, -0.16666666666666666 \cdot \left(im \cdot im\right), im\right)} \]
      3. Recombined 3 regimes into one program.
      4. Final simplification98.1%

        \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -0.0022:\\ \;\;\;\;e^{re} \cdot im\\ \mathbf{elif}\;re \leq 0.00028:\\ \;\;\;\;\sin im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\ \mathbf{elif}\;re \leq 1.45 \cdot 10^{+95}:\\ \;\;\;\;e^{re} \cdot \mathsf{fma}\left(im, -0.16666666666666666 \cdot \left(im \cdot im\right), im\right)\\ \mathbf{else}:\\ \;\;\;\;\sin im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 19: 30.0% accurate, 29.4× speedup?

      \[\begin{array}{l} \\ \mathsf{fma}\left(im, re, im\right) \end{array} \]
      (FPCore (re im) :precision binary64 (fma im re im))
      double code(double re, double im) {
      	return fma(im, re, im);
      }
      
      function code(re, im)
      	return fma(im, re, im)
      end
      
      code[re_, im_] := N[(im * re + im), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \mathsf{fma}\left(im, re, im\right)
      \end{array}
      
      Derivation
      1. Initial program 99.6%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot e^{re}} \]
        2. lower-exp.f6472.1

          \[\leadsto im \cdot \color{blue}{e^{re}} \]
      5. Applied rewrites72.1%

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      6. Taylor expanded in re around 0

        \[\leadsto \color{blue}{im + im \cdot re} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{im \cdot re + im} \]
        2. lower-fma.f6433.8

          \[\leadsto \color{blue}{\mathsf{fma}\left(im, re, im\right)} \]
      8. Applied rewrites33.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, re, im\right)} \]
      9. Add Preprocessing

      Alternative 20: 26.9% accurate, 206.0× speedup?

      \[\begin{array}{l} \\ im \end{array} \]
      (FPCore (re im) :precision binary64 im)
      double code(double re, double im) {
      	return im;
      }
      
      real(8) function code(re, im)
          real(8), intent (in) :: re
          real(8), intent (in) :: im
          code = im
      end function
      
      public static double code(double re, double im) {
      	return im;
      }
      
      def code(re, im):
      	return im
      
      function code(re, im)
      	return im
      end
      
      function tmp = code(re, im)
      	tmp = im;
      end
      
      code[re_, im_] := im
      
      \begin{array}{l}
      
      \\
      im
      \end{array}
      
      Derivation
      1. Initial program 99.6%

        \[e^{re} \cdot \sin im \]
      2. Add Preprocessing
      3. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{im \cdot e^{re}} \]
        2. lower-exp.f6472.1

          \[\leadsto im \cdot \color{blue}{e^{re}} \]
      5. Applied rewrites72.1%

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      6. Taylor expanded in re around 0

        \[\leadsto im \cdot \color{blue}{1} \]
      7. Step-by-step derivation
        1. Applied rewrites30.6%

          \[\leadsto im \cdot \color{blue}{1} \]
        2. Step-by-step derivation
          1. *-rgt-identity30.6

            \[\leadsto \color{blue}{im} \]
        3. Applied rewrites30.6%

          \[\leadsto \color{blue}{im} \]
        4. Add Preprocessing

        Reproduce

        ?
        herbie shell --seed 2024219 
        (FPCore (re im)
          :name "math.exp on complex, imaginary part"
          :precision binary64
          (* (exp re) (sin im)))