math.exp on complex, imaginary part

Percentage Accurate: 100.0% → 100.0%
Time: 13.1s
Alternatives: 18
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 18 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 100.0%

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

Alternative 2: 86.9% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_1 \leq -0.05:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;t\_1 \leq 10^{+23}:\\
\;\;\;\;t\_2\\

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


\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 + 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. accelerator-lowering-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. accelerator-lowering-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. accelerator-lowering-fma.f6487.5

        \[\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. Simplified87.5%

      \[\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 \]
    6. Taylor expanded in im around 0

      \[\leadsto \color{blue}{im \cdot \left(1 + \left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right) + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right)\right)\right)\right)} \]
    7. Simplified29.3%

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

      \[\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) + im \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

        \[\leadsto \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right) \cdot \left(im + im \cdot re\right)} \]
    10. Simplified28.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(im, \color{blue}{im \cdot -0.16666666666666666}, 1\right) \cdot \mathsf{fma}\left(re, im, im\right) \]
    13. Simplified21.4%

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

    if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.050000000000000003 or 1.9999999999999998e-71 < (*.f64 (exp.f64 re) (sin.f64 im)) < 9.9999999999999992e22

    1. Initial program 99.9%

      \[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. accelerator-lowering-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. accelerator-lowering-fma.f6497.5

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

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

    if -0.050000000000000003 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1.9999999999999998e-71 or 9.9999999999999992e22 < (*.f64 (exp.f64 re) (sin.f64 im))

    1. Initial program 100.0%

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

      \[\leadsto e^{re} \cdot \color{blue}{im} \]
    4. Step-by-step derivation
      1. Simplified95.5%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, im, im\right)\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq -0.05:\\ \;\;\;\;\sin im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq 2 \cdot 10^{-71}:\\ \;\;\;\;e^{re} \cdot im\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq 10^{+23}:\\ \;\;\;\;\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} \]
    7. Add Preprocessing

    Alternative 3: 86.8% accurate, 0.2× speedup?

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

          \[\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. Simplified87.5%

        \[\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 \]
      6. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot \left(1 + \left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right) + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right)\right)\right)\right)} \]
      7. Simplified29.3%

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

        \[\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) + im \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)} \]
      9. Step-by-step derivation
        1. +-commutativeN/A

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

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

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

          \[\leadsto \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right) \cdot \left(im + im \cdot re\right)} \]
      10. Simplified28.0%

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(im, \color{blue}{im \cdot -0.16666666666666666}, 1\right) \cdot \mathsf{fma}\left(re, im, im\right) \]
      13. Simplified21.4%

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

      if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.050000000000000003 or 1.9999999999999998e-71 < (*.f64 (exp.f64 re) (sin.f64 im)) < 9.9999999999999992e22

      1. Initial program 99.9%

        \[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. +-lowering-+.f6497.2

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

        \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \sin im \]

      if -0.050000000000000003 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1.9999999999999998e-71 or 9.9999999999999992e22 < (*.f64 (exp.f64 re) (sin.f64 im))

      1. Initial program 100.0%

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

        \[\leadsto e^{re} \cdot \color{blue}{im} \]
      4. Step-by-step derivation
        1. Simplified95.5%

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

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

      Alternative 4: 86.6% 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:\\ \;\;\;\;\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, im, im\right)\\ \mathbf{elif}\;t\_0 \leq -0.05:\\ \;\;\;\;\sin im\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-19}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 10^{+23}:\\ \;\;\;\;\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))
           (* (fma im (* im -0.16666666666666666) 1.0) (fma re im im))
           (if (<= t_0 -0.05)
             (sin im)
             (if (<= t_0 5e-19) t_1 (if (<= t_0 1e+23) (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 = fma(im, (im * -0.16666666666666666), 1.0) * fma(re, im, im);
      	} else if (t_0 <= -0.05) {
      		tmp = sin(im);
      	} else if (t_0 <= 5e-19) {
      		tmp = t_1;
      	} else if (t_0 <= 1e+23) {
      		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(fma(im, Float64(im * -0.16666666666666666), 1.0) * fma(re, im, im));
      	elseif (t_0 <= -0.05)
      		tmp = sin(im);
      	elseif (t_0 <= 5e-19)
      		tmp = t_1;
      	elseif (t_0 <= 1e+23)
      		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[(N[(im * N[(im * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(re * im + im), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.05], N[Sin[im], $MachinePrecision], If[LessEqual[t$95$0, 5e-19], t$95$1, If[LessEqual[t$95$0, 1e+23], 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:\\
      \;\;\;\;\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, im, im\right)\\
      
      \mathbf{elif}\;t\_0 \leq -0.05:\\
      \;\;\;\;\sin im\\
      
      \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-19}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;t\_0 \leq 10^{+23}:\\
      \;\;\;\;\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 + 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. accelerator-lowering-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. accelerator-lowering-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. accelerator-lowering-fma.f6487.5

            \[\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. Simplified87.5%

          \[\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 \]
        6. Taylor expanded in im around 0

          \[\leadsto \color{blue}{im \cdot \left(1 + \left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right) + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right)\right)\right)\right)} \]
        7. Simplified29.3%

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

          \[\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) + im \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)} \]
        9. Step-by-step derivation
          1. +-commutativeN/A

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

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

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

            \[\leadsto \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right) \cdot \left(im + im \cdot re\right)} \]
        10. Simplified28.0%

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(im, \color{blue}{im \cdot -0.16666666666666666}, 1\right) \cdot \mathsf{fma}\left(re, im, im\right) \]
        13. Simplified21.4%

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

        if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.050000000000000003 or 5.0000000000000004e-19 < (*.f64 (exp.f64 re) (sin.f64 im)) < 9.9999999999999992e22

        1. Initial program 99.9%

          \[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. sin-lowering-sin.f6494.8

            \[\leadsto \color{blue}{\sin im} \]
        5. Simplified94.8%

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

        if -0.050000000000000003 < (*.f64 (exp.f64 re) (sin.f64 im)) < 5.0000000000000004e-19 or 9.9999999999999992e22 < (*.f64 (exp.f64 re) (sin.f64 im))

        1. Initial program 100.0%

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

          \[\leadsto e^{re} \cdot \color{blue}{im} \]
        4. Step-by-step derivation
          1. Simplified95.5%

            \[\leadsto e^{re} \cdot \color{blue}{im} \]
        5. Recombined 3 regimes into one program.
        6. Add Preprocessing

        Alternative 5: 92.2% accurate, 0.3× 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)\\ t_1 := e^{re} \cdot \sin im\\ t_2 := e^{re} \cdot im\\ \mathbf{if}\;t\_1 \leq -0.05:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 10^{-100}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 10^{+23}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \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)))
                (t_1 (* (exp re) (sin im)))
                (t_2 (* (exp re) im)))
           (if (<= t_1 -0.05)
             t_0
             (if (<= t_1 1e-100) t_2 (if (<= t_1 1e+23) t_0 t_2)))))
        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 t_1 = exp(re) * sin(im);
        	double t_2 = exp(re) * im;
        	double tmp;
        	if (t_1 <= -0.05) {
        		tmp = t_0;
        	} else if (t_1 <= 1e-100) {
        		tmp = t_2;
        	} else if (t_1 <= 1e+23) {
        		tmp = t_0;
        	} else {
        		tmp = t_2;
        	}
        	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))
        	t_1 = Float64(exp(re) * sin(im))
        	t_2 = Float64(exp(re) * im)
        	tmp = 0.0
        	if (t_1 <= -0.05)
        		tmp = t_0;
        	elseif (t_1 <= 1e-100)
        		tmp = t_2;
        	elseif (t_1 <= 1e+23)
        		tmp = t_0;
        	else
        		tmp = t_2;
        	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]}, 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, -0.05], t$95$0, If[LessEqual[t$95$1, 1e-100], t$95$2, If[LessEqual[t$95$1, 1e+23], t$95$0, t$95$2]]]]]]
        
        \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)\\
        t_1 := e^{re} \cdot \sin im\\
        t_2 := e^{re} \cdot im\\
        \mathbf{if}\;t\_1 \leq -0.05:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;t\_1 \leq 10^{-100}:\\
        \;\;\;\;t\_2\\
        
        \mathbf{elif}\;t\_1 \leq 10^{+23}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_2\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.050000000000000003 or 1e-100 < (*.f64 (exp.f64 re) (sin.f64 im)) < 9.9999999999999992e22

          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. accelerator-lowering-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. accelerator-lowering-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. accelerator-lowering-fma.f6494.6

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

            \[\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 -0.050000000000000003 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1e-100 or 9.9999999999999992e22 < (*.f64 (exp.f64 re) (sin.f64 im))

          1. Initial program 100.0%

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

            \[\leadsto e^{re} \cdot \color{blue}{im} \]
          4. Step-by-step derivation
            1. Simplified95.4%

              \[\leadsto e^{re} \cdot \color{blue}{im} \]
          5. Recombined 2 regimes into one program.
          6. Final simplification95.1%

            \[\leadsto \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq -0.05:\\ \;\;\;\;\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}\;e^{re} \cdot \sin im \leq 10^{-100}:\\ \;\;\;\;e^{re} \cdot im\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq 10^{+23}:\\ \;\;\;\;\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{else}:\\ \;\;\;\;e^{re} \cdot im\\ \end{array} \]
          7. Add Preprocessing

          Alternative 6: 60.1% accurate, 0.4× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{re} \cdot \sin im\\ \mathbf{if}\;t\_0 \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, im, im\right)\\ \mathbf{elif}\;t\_0 \leq 10^{+23}:\\ \;\;\;\;\sin im\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, 0.16666666666666666 \cdot \mathsf{fma}\left(im \cdot im, 0.008333333333333333, -0.16666666666666666\right), 0.16666666666666666\right)\right)\right)\\ \end{array} \end{array} \]
          (FPCore (re im)
           :precision binary64
           (let* ((t_0 (* (exp re) (sin im))))
             (if (<= t_0 (- INFINITY))
               (* (fma im (* im -0.16666666666666666) 1.0) (fma re im im))
               (if (<= t_0 1e+23)
                 (sin im)
                 (*
                  im
                  (*
                   (* re re)
                   (*
                    re
                    (fma
                     (* im im)
                     (*
                      0.16666666666666666
                      (fma (* im im) 0.008333333333333333 -0.16666666666666666))
                     0.16666666666666666))))))))
          double code(double re, double im) {
          	double t_0 = exp(re) * sin(im);
          	double tmp;
          	if (t_0 <= -((double) INFINITY)) {
          		tmp = fma(im, (im * -0.16666666666666666), 1.0) * fma(re, im, im);
          	} else if (t_0 <= 1e+23) {
          		tmp = sin(im);
          	} else {
          		tmp = im * ((re * re) * (re * fma((im * im), (0.16666666666666666 * fma((im * im), 0.008333333333333333, -0.16666666666666666)), 0.16666666666666666)));
          	}
          	return tmp;
          }
          
          function code(re, im)
          	t_0 = Float64(exp(re) * sin(im))
          	tmp = 0.0
          	if (t_0 <= Float64(-Inf))
          		tmp = Float64(fma(im, Float64(im * -0.16666666666666666), 1.0) * fma(re, im, im));
          	elseif (t_0 <= 1e+23)
          		tmp = sin(im);
          	else
          		tmp = Float64(im * Float64(Float64(re * re) * Float64(re * fma(Float64(im * im), Float64(0.16666666666666666 * fma(Float64(im * im), 0.008333333333333333, -0.16666666666666666)), 0.16666666666666666))));
          	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[(N[(im * N[(im * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(re * im + im), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+23], N[Sin[im], $MachinePrecision], N[(im * N[(N[(re * re), $MachinePrecision] * N[(re * N[(N[(im * im), $MachinePrecision] * N[(0.16666666666666666 * N[(N[(im * im), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := e^{re} \cdot \sin im\\
          \mathbf{if}\;t\_0 \leq -\infty:\\
          \;\;\;\;\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, im, im\right)\\
          
          \mathbf{elif}\;t\_0 \leq 10^{+23}:\\
          \;\;\;\;\sin im\\
          
          \mathbf{else}:\\
          \;\;\;\;im \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, 0.16666666666666666 \cdot \mathsf{fma}\left(im \cdot im, 0.008333333333333333, -0.16666666666666666\right), 0.16666666666666666\right)\right)\right)\\
          
          
          \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 + 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. accelerator-lowering-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. accelerator-lowering-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. accelerator-lowering-fma.f6487.5

                \[\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. Simplified87.5%

              \[\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 \]
            6. Taylor expanded in im around 0

              \[\leadsto \color{blue}{im \cdot \left(1 + \left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right) + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right)\right)\right)\right)} \]
            7. Simplified29.3%

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

              \[\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) + im \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)} \]
            9. Step-by-step derivation
              1. +-commutativeN/A

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

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

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

                \[\leadsto \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right) \cdot \left(im + im \cdot re\right)} \]
            10. Simplified28.0%

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(im, \color{blue}{im \cdot -0.16666666666666666}, 1\right) \cdot \mathsf{fma}\left(re, im, im\right) \]
            13. Simplified21.4%

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

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

            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. sin-lowering-sin.f6468.1

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

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

            if 9.9999999999999992e22 < (*.f64 (exp.f64 re) (sin.f64 im))

            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. accelerator-lowering-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. accelerator-lowering-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. accelerator-lowering-fma.f6473.0

                \[\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. Simplified73.0%

              \[\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 \]
            6. Taylor expanded in im around 0

              \[\leadsto \color{blue}{im \cdot \left(1 + \left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right) + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right) + \frac{1}{120} \cdot \left({im}^{2} \cdot \left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right)\right)\right)\right)} \]
            7. Simplified35.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto im \cdot \left(\left(re \cdot re\right) \cdot \left(re \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 \frac{1}{6}, \frac{1}{6}\right)\right)\right) \]
              16. *-commutativeN/A

                \[\leadsto im \cdot \left(\left(re \cdot re\right) \cdot \left(re \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 \frac{1}{6}, \frac{1}{6}\right)\right)\right) \]
              17. metadata-evalN/A

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

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

                \[\leadsto im \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{120}, \frac{-1}{6}\right) \cdot \frac{1}{6}, \frac{1}{6}\right)\right)\right) \]
              20. *-lowering-*.f6463.2

                \[\leadsto im \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, 0.008333333333333333, -0.16666666666666666\right) \cdot 0.16666666666666666, 0.16666666666666666\right)\right)\right) \]
            10. Simplified63.2%

              \[\leadsto im \cdot \color{blue}{\left(\left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.008333333333333333, -0.16666666666666666\right) \cdot 0.16666666666666666, 0.16666666666666666\right)\right)\right)} \]
          3. Recombined 3 regimes into one program.
          4. Final simplification61.9%

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

          Alternative 7: 32.4% accurate, 0.4× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{re} \cdot \sin im\\ \mathbf{if}\;t\_0 \leq -0.05:\\ \;\;\;\;\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, im, im\right)\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\frac{im \cdot im - re \cdot \left(im \cdot \left(re \cdot im\right)\right)}{im - re \cdot im}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right) \cdot \left(im \cdot \mathsf{fma}\left(im, im \cdot \mathsf{fma}\left(im \cdot im, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right)\\ \end{array} \end{array} \]
          (FPCore (re im)
           :precision binary64
           (let* ((t_0 (* (exp re) (sin im))))
             (if (<= t_0 -0.05)
               (* (fma im (* im -0.16666666666666666) 1.0) (fma re im im))
               (if (<= t_0 0.0)
                 (/ (- (* im im) (* re (* im (* re im)))) (- im (* re im)))
                 (*
                  (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0)
                  (*
                   im
                   (fma
                    im
                    (* im (fma (* im im) 0.008333333333333333 -0.16666666666666666))
                    1.0)))))))
          double code(double re, double im) {
          	double t_0 = exp(re) * sin(im);
          	double tmp;
          	if (t_0 <= -0.05) {
          		tmp = fma(im, (im * -0.16666666666666666), 1.0) * fma(re, im, im);
          	} else if (t_0 <= 0.0) {
          		tmp = ((im * im) - (re * (im * (re * im)))) / (im - (re * im));
          	} else {
          		tmp = fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0) * (im * fma(im, (im * fma((im * im), 0.008333333333333333, -0.16666666666666666)), 1.0));
          	}
          	return tmp;
          }
          
          function code(re, im)
          	t_0 = Float64(exp(re) * sin(im))
          	tmp = 0.0
          	if (t_0 <= -0.05)
          		tmp = Float64(fma(im, Float64(im * -0.16666666666666666), 1.0) * fma(re, im, im));
          	elseif (t_0 <= 0.0)
          		tmp = Float64(Float64(Float64(im * im) - Float64(re * Float64(im * Float64(re * im)))) / Float64(im - Float64(re * im)));
          	else
          		tmp = Float64(fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0) * Float64(im * fma(im, Float64(im * fma(Float64(im * im), 0.008333333333333333, -0.16666666666666666)), 1.0)));
          	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.05], N[(N[(im * N[(im * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(re * im + im), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(N[(im * im), $MachinePrecision] - N[(re * N[(im * N[(re * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(im - N[(re * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision] * N[(im * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := e^{re} \cdot \sin im\\
          \mathbf{if}\;t\_0 \leq -0.05:\\
          \;\;\;\;\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, im, im\right)\\
          
          \mathbf{elif}\;t\_0 \leq 0:\\
          \;\;\;\;\frac{im \cdot im - re \cdot \left(im \cdot \left(re \cdot im\right)\right)}{im - re \cdot im}\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right) \cdot \left(im \cdot \mathsf{fma}\left(im, im \cdot \mathsf{fma}\left(im \cdot im, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.050000000000000003

            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. accelerator-lowering-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. accelerator-lowering-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. accelerator-lowering-fma.f6492.3

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

              \[\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 \]
            6. Taylor expanded in im around 0

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

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

              \[\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) + im \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)} \]
            9. Step-by-step derivation
              1. +-commutativeN/A

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

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

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

                \[\leadsto \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right) \cdot \left(im + im \cdot re\right)} \]
            10. Simplified16.0%

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(im, \color{blue}{im \cdot -0.16666666666666666}, 1\right) \cdot \mathsf{fma}\left(re, im, im\right) \]
            13. Simplified12.4%

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

            if -0.050000000000000003 < (*.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 im around 0

              \[\leadsto e^{re} \cdot \color{blue}{im} \]
            4. Step-by-step derivation
              1. Simplified98.9%

                \[\leadsto e^{re} \cdot \color{blue}{im} \]
              2. 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)} \]
              3. 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. accelerator-lowering-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, \color{blue}{\left(\frac{1}{2} \cdot \left(im \cdot re\right) + \left(\frac{1}{6} \cdot \left(im \cdot re\right)\right) \cdot re\right)} + im, im\right) \]
                7. *-commutativeN/A

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

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

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

                  \[\leadsto \mathsf{fma}\left(re, \color{blue}{\left(im \cdot re\right) \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)} + im, im\right) \]
                11. accelerator-lowering-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. *-lowering-*.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. accelerator-lowering-fma.f6438.8

                  \[\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) \]
              4. Simplified38.8%

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

                \[\leadsto \color{blue}{im + im \cdot re} \]
              6. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto \color{blue}{im \cdot re + im} \]
                2. *-commutativeN/A

                  \[\leadsto \color{blue}{re \cdot im} + im \]
                3. accelerator-lowering-fma.f6438.5

                  \[\leadsto \color{blue}{\mathsf{fma}\left(re, im, im\right)} \]
              7. Simplified38.5%

                \[\leadsto \color{blue}{\mathsf{fma}\left(re, im, im\right)} \]
              8. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto \color{blue}{im + re \cdot im} \]
                2. flip-+N/A

                  \[\leadsto \color{blue}{\frac{im \cdot im - \left(re \cdot im\right) \cdot \left(re \cdot im\right)}{im - re \cdot im}} \]
                3. /-lowering-/.f64N/A

                  \[\leadsto \color{blue}{\frac{im \cdot im - \left(re \cdot im\right) \cdot \left(re \cdot im\right)}{im - re \cdot im}} \]
                4. --lowering--.f64N/A

                  \[\leadsto \frac{\color{blue}{im \cdot im - \left(re \cdot im\right) \cdot \left(re \cdot im\right)}}{im - re \cdot im} \]
                5. *-lowering-*.f64N/A

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

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

                  \[\leadsto \frac{im \cdot im - re \cdot \color{blue}{\left(\left(re \cdot im\right) \cdot im\right)}}{im - re \cdot im} \]
                8. *-lowering-*.f64N/A

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

                  \[\leadsto \frac{im \cdot im - re \cdot \color{blue}{\left(im \cdot \left(re \cdot im\right)\right)}}{im - re \cdot im} \]
                10. *-lowering-*.f64N/A

                  \[\leadsto \frac{im \cdot im - re \cdot \color{blue}{\left(im \cdot \left(re \cdot im\right)\right)}}{im - re \cdot im} \]
                11. *-lowering-*.f64N/A

                  \[\leadsto \frac{im \cdot im - re \cdot \left(im \cdot \color{blue}{\left(re \cdot im\right)}\right)}{im - re \cdot im} \]
                12. --lowering--.f64N/A

                  \[\leadsto \frac{im \cdot im - re \cdot \left(im \cdot \left(re \cdot im\right)\right)}{\color{blue}{im - re \cdot im}} \]
                13. *-lowering-*.f6419.0

                  \[\leadsto \frac{im \cdot im - re \cdot \left(im \cdot \left(re \cdot im\right)\right)}{im - \color{blue}{re \cdot im}} \]
              9. Applied egg-rr19.0%

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

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

              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. accelerator-lowering-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. accelerator-lowering-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. accelerator-lowering-fma.f6490.7

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

                \[\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 \]
              6. Taylor expanded in im around 0

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right), 1\right), 1\right) \cdot \left(im \cdot \mathsf{fma}\left(im, im \cdot \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{120}, \frac{-1}{6}\right), 1\right)\right) \]
                12. *-lowering-*.f6453.4

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

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

            Alternative 8: 32.1% accurate, 0.4× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{re} \cdot \sin im\\ \mathbf{if}\;t\_0 \leq -0.05:\\ \;\;\;\;\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, im, im\right)\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\frac{im \cdot im - re \cdot \left(im \cdot \left(re \cdot im\right)\right)}{im - re \cdot im}\\ \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
             (let* ((t_0 (* (exp re) (sin im))))
               (if (<= t_0 -0.05)
                 (* (fma im (* im -0.16666666666666666) 1.0) (fma re im im))
                 (if (<= t_0 0.0)
                   (/ (- (* im im) (* re (* im (* re im)))) (- im (* re im)))
                   (* im (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0))))))
            double code(double re, double im) {
            	double t_0 = exp(re) * sin(im);
            	double tmp;
            	if (t_0 <= -0.05) {
            		tmp = fma(im, (im * -0.16666666666666666), 1.0) * fma(re, im, im);
            	} else if (t_0 <= 0.0) {
            		tmp = ((im * im) - (re * (im * (re * im)))) / (im - (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)
            	t_0 = Float64(exp(re) * sin(im))
            	tmp = 0.0
            	if (t_0 <= -0.05)
            		tmp = Float64(fma(im, Float64(im * -0.16666666666666666), 1.0) * fma(re, im, im));
            	elseif (t_0 <= 0.0)
            		tmp = Float64(Float64(Float64(im * im) - Float64(re * Float64(im * Float64(re * im)))) / Float64(im - Float64(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_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.05], N[(N[(im * N[(im * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(re * im + im), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(N[(im * im), $MachinePrecision] - N[(re * N[(im * N[(re * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(im - N[(re * im), $MachinePrecision]), $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}
            t_0 := e^{re} \cdot \sin im\\
            \mathbf{if}\;t\_0 \leq -0.05:\\
            \;\;\;\;\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, im, im\right)\\
            
            \mathbf{elif}\;t\_0 \leq 0:\\
            \;\;\;\;\frac{im \cdot im - re \cdot \left(im \cdot \left(re \cdot im\right)\right)}{im - re \cdot im}\\
            
            \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 3 regimes
            2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.050000000000000003

              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. accelerator-lowering-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. accelerator-lowering-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. accelerator-lowering-fma.f6492.3

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

                \[\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 \]
              6. Taylor expanded in im around 0

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

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

                \[\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) + im \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)} \]
              9. Step-by-step derivation
                1. +-commutativeN/A

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

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

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

                  \[\leadsto \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right) \cdot \left(im + im \cdot re\right)} \]
              10. Simplified16.0%

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(im, \color{blue}{im \cdot -0.16666666666666666}, 1\right) \cdot \mathsf{fma}\left(re, im, im\right) \]
              13. Simplified12.4%

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

              if -0.050000000000000003 < (*.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 im around 0

                \[\leadsto e^{re} \cdot \color{blue}{im} \]
              4. Step-by-step derivation
                1. Simplified98.9%

                  \[\leadsto e^{re} \cdot \color{blue}{im} \]
                2. 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)} \]
                3. 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. accelerator-lowering-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, \color{blue}{\left(\frac{1}{2} \cdot \left(im \cdot re\right) + \left(\frac{1}{6} \cdot \left(im \cdot re\right)\right) \cdot re\right)} + im, im\right) \]
                  7. *-commutativeN/A

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

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

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

                    \[\leadsto \mathsf{fma}\left(re, \color{blue}{\left(im \cdot re\right) \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)} + im, im\right) \]
                  11. accelerator-lowering-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. *-lowering-*.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. accelerator-lowering-fma.f6438.8

                    \[\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) \]
                4. Simplified38.8%

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

                  \[\leadsto \color{blue}{im + im \cdot re} \]
                6. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \color{blue}{im \cdot re + im} \]
                  2. *-commutativeN/A

                    \[\leadsto \color{blue}{re \cdot im} + im \]
                  3. accelerator-lowering-fma.f6438.5

                    \[\leadsto \color{blue}{\mathsf{fma}\left(re, im, im\right)} \]
                7. Simplified38.5%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(re, im, im\right)} \]
                8. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \color{blue}{im + re \cdot im} \]
                  2. flip-+N/A

                    \[\leadsto \color{blue}{\frac{im \cdot im - \left(re \cdot im\right) \cdot \left(re \cdot im\right)}{im - re \cdot im}} \]
                  3. /-lowering-/.f64N/A

                    \[\leadsto \color{blue}{\frac{im \cdot im - \left(re \cdot im\right) \cdot \left(re \cdot im\right)}{im - re \cdot im}} \]
                  4. --lowering--.f64N/A

                    \[\leadsto \frac{\color{blue}{im \cdot im - \left(re \cdot im\right) \cdot \left(re \cdot im\right)}}{im - re \cdot im} \]
                  5. *-lowering-*.f64N/A

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

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

                    \[\leadsto \frac{im \cdot im - re \cdot \color{blue}{\left(\left(re \cdot im\right) \cdot im\right)}}{im - re \cdot im} \]
                  8. *-lowering-*.f64N/A

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

                    \[\leadsto \frac{im \cdot im - re \cdot \color{blue}{\left(im \cdot \left(re \cdot im\right)\right)}}{im - re \cdot im} \]
                  10. *-lowering-*.f64N/A

                    \[\leadsto \frac{im \cdot im - re \cdot \color{blue}{\left(im \cdot \left(re \cdot im\right)\right)}}{im - re \cdot im} \]
                  11. *-lowering-*.f64N/A

                    \[\leadsto \frac{im \cdot im - re \cdot \left(im \cdot \color{blue}{\left(re \cdot im\right)}\right)}{im - re \cdot im} \]
                  12. --lowering--.f64N/A

                    \[\leadsto \frac{im \cdot im - re \cdot \left(im \cdot \left(re \cdot im\right)\right)}{\color{blue}{im - re \cdot im}} \]
                  13. *-lowering-*.f6419.0

                    \[\leadsto \frac{im \cdot im - re \cdot \left(im \cdot \left(re \cdot im\right)\right)}{im - \color{blue}{re \cdot im}} \]
                9. Applied egg-rr19.0%

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

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

                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. accelerator-lowering-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. accelerator-lowering-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. accelerator-lowering-fma.f6490.7

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

                  \[\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 \]
                6. Taylor expanded in im around 0

                  \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right), 1\right), 1\right) \cdot \color{blue}{im} \]
                7. Step-by-step derivation
                  1. Simplified53.7%

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq -0.05:\\ \;\;\;\;\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, im, im\right)\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq 0:\\ \;\;\;\;\frac{im \cdot im - re \cdot \left(im \cdot \left(re \cdot im\right)\right)}{im - re \cdot im}\\ \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} \]
                10. Add Preprocessing

                Alternative 9: 35.5% accurate, 0.8× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\ \;\;\;\;im \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\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
                     (* im im)
                     (fma
                      (* im im)
                      (fma im (* im -0.0001984126984126984) 0.008333333333333333)
                      -0.16666666666666666)
                     1.0))
                   (* 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((im * im), fma((im * im), fma(im, (im * -0.0001984126984126984), 0.008333333333333333), -0.16666666666666666), 1.0);
                	} 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(Float64(im * im), fma(Float64(im * im), fma(im, Float64(im * -0.0001984126984126984), 0.008333333333333333), -0.16666666666666666), 1.0));
                	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[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * -0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] + 1.0), $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(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\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}{\sin im} \]
                  4. Step-by-step derivation
                    1. sin-lowering-sin.f6441.6

                      \[\leadsto \color{blue}{\sin im} \]
                  5. Simplified41.6%

                    \[\leadsto \color{blue}{\sin im} \]
                  6. Taylor expanded in im around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \color{blue}{\mathsf{fma}\left(im, im \cdot \frac{-1}{5040}, \frac{1}{120}\right)}, \frac{-1}{6}\right), 1\right) \]
                    16. *-lowering-*.f6427.8

                      \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, \color{blue}{im \cdot -0.0001984126984126984}, 0.008333333333333333\right), -0.16666666666666666\right), 1\right) \]
                  8. Simplified27.8%

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

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

                  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. accelerator-lowering-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. accelerator-lowering-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. accelerator-lowering-fma.f6490.7

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

                    \[\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 \]
                  6. Taylor expanded in im around 0

                    \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right), 1\right), 1\right) \cdot \color{blue}{im} \]
                  7. Step-by-step derivation
                    1. Simplified53.7%

                      \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right) \cdot \color{blue}{im} \]
                  8. Recombined 2 regimes into one program.
                  9. Final simplification38.2%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\ \;\;\;\;im \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\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} \]
                  10. Add Preprocessing

                  Alternative 10: 35.4% accurate, 0.9× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 5 \cdot 10^{-305}:\\ \;\;\;\;\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, im, 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-305)
                     (* (fma im (* im -0.16666666666666666) 1.0) (fma re im 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-305) {
                  		tmp = fma(im, (im * -0.16666666666666666), 1.0) * fma(re, im, 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-305)
                  		tmp = Float64(fma(im, Float64(im * -0.16666666666666666), 1.0) * fma(re, im, 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-305], N[(N[(im * N[(im * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(re * im + im), $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 5 \cdot 10^{-305}:\\
                  \;\;\;\;\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, im, 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)) < 4.99999999999999985e-305

                    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. accelerator-lowering-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. accelerator-lowering-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. accelerator-lowering-fma.f6460.3

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

                      \[\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 \]
                    6. Taylor expanded in im around 0

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

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

                      \[\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) + im \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)} \]
                    9. Step-by-step derivation
                      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(im, \color{blue}{im \cdot -0.16666666666666666}, 1\right) \cdot \mathsf{fma}\left(re, im, im\right) \]
                    13. Simplified29.2%

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

                    if 4.99999999999999985e-305 < (*.f64 (exp.f64 re) (sin.f64 im))

                    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. accelerator-lowering-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. accelerator-lowering-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. accelerator-lowering-fma.f6490.5

                        \[\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. Simplified90.5%

                      \[\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 \]
                    6. Taylor expanded in im around 0

                      \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right), 1\right), 1\right) \cdot \color{blue}{im} \]
                    7. Step-by-step derivation
                      1. Simplified52.8%

                        \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right) \cdot \color{blue}{im} \]
                    8. Recombined 2 regimes into one program.
                    9. Final simplification38.5%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 5 \cdot 10^{-305}:\\ \;\;\;\;\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, im, 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} \]
                    10. Add Preprocessing

                    Alternative 11: 35.3% accurate, 0.9× speedup?

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

                      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. accelerator-lowering-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. accelerator-lowering-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. accelerator-lowering-fma.f6467.1

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

                        \[\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 \]
                      6. Taylor expanded in im around 0

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

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

                        \[\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) + im \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)} \]
                      9. Step-by-step derivation
                        1. +-commutativeN/A

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

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

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

                          \[\leadsto \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right) \cdot \left(im + im \cdot re\right)} \]
                      10. Simplified42.3%

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(im, \color{blue}{im \cdot -0.16666666666666666}, 1\right) \cdot \mathsf{fma}\left(re, im, im\right) \]
                      13. Simplified41.2%

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

                      if 1.9999999999999999e-7 < (*.f64 (exp.f64 re) (sin.f64 im))

                      1. Initial program 99.9%

                        \[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. accelerator-lowering-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. accelerator-lowering-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. accelerator-lowering-fma.f6486.1

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

                        \[\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 \]
                      6. Taylor expanded in re around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \left(\left(re \cdot re\right) \cdot \left(\color{blue}{re \cdot \frac{1}{6}} + \frac{1}{2}\right)\right) \cdot \sin im \]
                        14. accelerator-lowering-fma.f6436.4

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

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

                        \[\leadsto \left(\left(re \cdot re\right) \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)\right) \cdot \color{blue}{im} \]
                      10. Step-by-step derivation
                        1. Simplified31.4%

                          \[\leadsto \left(\left(re \cdot re\right) \cdot \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right)\right) \cdot \color{blue}{im} \]
                      11. Recombined 2 regimes into one program.
                      12. Final simplification38.5%

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

                      Alternative 12: 34.7% accurate, 0.9× speedup?

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

                        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. sin-lowering-sin.f6451.9

                            \[\leadsto \color{blue}{\sin im} \]
                        5. Simplified51.9%

                          \[\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. *-lowering-*.f64N/A

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

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

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

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

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

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

                            \[\leadsto im \cdot \mathsf{fma}\left(im, \color{blue}{im \cdot -0.16666666666666666}, 1\right) \]
                        8. Simplified40.1%

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

                        if 1.9999999999999999e-7 < (*.f64 (exp.f64 re) (sin.f64 im))

                        1. Initial program 99.9%

                          \[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. accelerator-lowering-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. accelerator-lowering-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. accelerator-lowering-fma.f6486.1

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

                          \[\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 \]
                        6. Taylor expanded in re around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(\left(re \cdot re\right) \cdot \left(\color{blue}{re \cdot \frac{1}{6}} + \frac{1}{2}\right)\right) \cdot \sin im \]
                          14. accelerator-lowering-fma.f6436.4

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

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

                          \[\leadsto \left(\left(re \cdot re\right) \cdot \mathsf{fma}\left(re, \frac{1}{6}, \frac{1}{2}\right)\right) \cdot \color{blue}{im} \]
                        10. Step-by-step derivation
                          1. Simplified31.4%

                            \[\leadsto \left(\left(re \cdot re\right) \cdot \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right)\right) \cdot \color{blue}{im} \]
                        11. Recombined 2 regimes into one program.
                        12. Final simplification37.7%

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

                        Alternative 13: 33.7% accurate, 0.9× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\ \;\;\;\;im \cdot \mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\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 im (* im -0.16666666666666666) 1.0))
                           (* 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(im, (im * -0.16666666666666666), 1.0);
                        	} 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(im, Float64(im * -0.16666666666666666), 1.0));
                        	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[(im * N[(im * -0.16666666666666666), $MachinePrecision] + 1.0), $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(im, im \cdot -0.16666666666666666, 1\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. sin-lowering-sin.f6441.6

                              \[\leadsto \color{blue}{\sin im} \]
                          5. Simplified41.6%

                            \[\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. *-lowering-*.f64N/A

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

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

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

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

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

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

                              \[\leadsto im \cdot \mathsf{fma}\left(im, \color{blue}{im \cdot -0.16666666666666666}, 1\right) \]
                          8. Simplified27.1%

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

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

                          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. accelerator-lowering-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. accelerator-lowering-fma.f6484.2

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

                            \[\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 \mathsf{fma}\left(re, \mathsf{fma}\left(re, \frac{1}{2}, 1\right), 1\right) \cdot \color{blue}{im} \]
                          7. Step-by-step derivation
                            1. Simplified51.8%

                              \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right) \cdot \color{blue}{im} \]
                          8. Recombined 2 regimes into one program.
                          9. Final simplification37.1%

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

                          Alternative 14: 29.9% accurate, 0.9× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\ \;\;\;\;im \cdot \mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(im, re, im\right)\\ \end{array} \end{array} \]
                          (FPCore (re im)
                           :precision binary64
                           (if (<= (* (exp re) (sin im)) 0.0)
                             (* im (fma im (* im -0.16666666666666666) 1.0))
                             (fma im re im)))
                          double code(double re, double im) {
                          	double tmp;
                          	if ((exp(re) * sin(im)) <= 0.0) {
                          		tmp = im * fma(im, (im * -0.16666666666666666), 1.0);
                          	} else {
                          		tmp = fma(im, re, im);
                          	}
                          	return tmp;
                          }
                          
                          function code(re, im)
                          	tmp = 0.0
                          	if (Float64(exp(re) * sin(im)) <= 0.0)
                          		tmp = Float64(im * fma(im, Float64(im * -0.16666666666666666), 1.0));
                          	else
                          		tmp = fma(im, re, 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[(im * N[(im * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(im * re + im), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
                          \;\;\;\;im \cdot \mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\mathsf{fma}\left(im, re, 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}{\sin im} \]
                            4. Step-by-step derivation
                              1. sin-lowering-sin.f6441.6

                                \[\leadsto \color{blue}{\sin im} \]
                            5. Simplified41.6%

                              \[\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. *-lowering-*.f64N/A

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

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

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

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

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

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

                                \[\leadsto im \cdot \mathsf{fma}\left(im, \color{blue}{im \cdot -0.16666666666666666}, 1\right) \]
                            8. Simplified27.1%

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

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

                            1. Initial program 100.0%

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

                              \[\leadsto e^{re} \cdot \color{blue}{im} \]
                            4. Step-by-step derivation
                              1. Simplified59.3%

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

                                \[\leadsto \color{blue}{im + im \cdot re} \]
                              3. Step-by-step derivation
                                1. +-commutativeN/A

                                  \[\leadsto \color{blue}{im \cdot re + im} \]
                                2. accelerator-lowering-fma.f6442.3

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(im, re, im\right)} \]
                              4. Simplified42.3%

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

                            Alternative 15: 27.9% accurate, 0.9× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 10^{+23}:\\ \;\;\;\;im\\ \mathbf{else}:\\ \;\;\;\;re \cdot im\\ \end{array} \end{array} \]
                            (FPCore (re im)
                             :precision binary64
                             (if (<= (* (exp re) (sin im)) 1e+23) im (* re im)))
                            double code(double re, double im) {
                            	double tmp;
                            	if ((exp(re) * sin(im)) <= 1e+23) {
                            		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)) <= 1d+23) 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)) <= 1e+23) {
                            		tmp = im;
                            	} else {
                            		tmp = re * im;
                            	}
                            	return tmp;
                            }
                            
                            def code(re, im):
                            	tmp = 0
                            	if (math.exp(re) * math.sin(im)) <= 1e+23:
                            		tmp = im
                            	else:
                            		tmp = re * im
                            	return tmp
                            
                            function code(re, im)
                            	tmp = 0.0
                            	if (Float64(exp(re) * sin(im)) <= 1e+23)
                            		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)) <= 1e+23)
                            		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], 1e+23], im, N[(re * im), $MachinePrecision]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;e^{re} \cdot \sin im \leq 10^{+23}:\\
                            \;\;\;\;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)) < 9.9999999999999992e22

                              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. sin-lowering-sin.f6459.1

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

                                \[\leadsto \color{blue}{\sin im} \]
                              6. Taylor expanded in im around 0

                                \[\leadsto \color{blue}{im} \]
                              7. Step-by-step derivation
                                1. Simplified32.2%

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

                                if 9.9999999999999992e22 < (*.f64 (exp.f64 re) (sin.f64 im))

                                1. Initial program 100.0%

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

                                  \[\leadsto e^{re} \cdot \color{blue}{im} \]
                                4. Step-by-step derivation
                                  1. Simplified81.3%

                                    \[\leadsto e^{re} \cdot \color{blue}{im} \]
                                  2. 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)} \]
                                  3. 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. accelerator-lowering-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, \color{blue}{\left(\frac{1}{2} \cdot \left(im \cdot re\right) + \left(\frac{1}{6} \cdot \left(im \cdot re\right)\right) \cdot re\right)} + im, im\right) \]
                                    7. *-commutativeN/A

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

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

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

                                      \[\leadsto \mathsf{fma}\left(re, \color{blue}{\left(im \cdot re\right) \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)} + im, im\right) \]
                                    11. accelerator-lowering-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. *-lowering-*.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. accelerator-lowering-fma.f6454.3

                                      \[\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) \]
                                  4. Simplified54.3%

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

                                    \[\leadsto \color{blue}{im + im \cdot re} \]
                                  6. Step-by-step derivation
                                    1. +-commutativeN/A

                                      \[\leadsto \color{blue}{im \cdot re + im} \]
                                    2. *-commutativeN/A

                                      \[\leadsto \color{blue}{re \cdot im} + im \]
                                    3. accelerator-lowering-fma.f6427.2

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(re, im, im\right)} \]
                                  7. Simplified27.2%

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

                                    \[\leadsto \color{blue}{im \cdot re} \]
                                  9. Step-by-step derivation
                                    1. *-lowering-*.f6427.2

                                      \[\leadsto \color{blue}{im \cdot re} \]
                                  10. Simplified27.2%

                                    \[\leadsto \color{blue}{im \cdot re} \]
                                5. Recombined 2 regimes into one program.
                                6. Final simplification31.5%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 10^{+23}:\\ \;\;\;\;im\\ \mathbf{else}:\\ \;\;\;\;re \cdot im\\ \end{array} \]
                                7. Add Preprocessing

                                Alternative 16: 97.1% accurate, 1.5× speedup?

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

                                  1. Initial program 100.0%

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

                                    \[\leadsto e^{re} \cdot \color{blue}{im} \]
                                  4. Step-by-step derivation
                                    1. Simplified97.3%

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

                                    if -9.5000000000000005e-6 < re < 3.3e6

                                    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. accelerator-lowering-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. accelerator-lowering-fma.f6498.0

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

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

                                    if 5.60000000000000037e102 < 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. accelerator-lowering-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. accelerator-lowering-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. accelerator-lowering-fma.f64100.0

                                        \[\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. Simplified100.0%

                                      \[\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 \]
                                    6. Taylor expanded in re around inf

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

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

                                        \[\leadsto \left(\frac{1}{6} \cdot \color{blue}{\left(re \cdot \left(re \cdot re\right)\right)}\right) \cdot \sin im \]
                                      3. unpow2N/A

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

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

                                        \[\leadsto \left(\frac{1}{6} \cdot \left(re \cdot \color{blue}{\left(re \cdot re\right)}\right)\right) \cdot \sin im \]
                                      6. *-lowering-*.f64100.0

                                        \[\leadsto \left(0.16666666666666666 \cdot \left(re \cdot \color{blue}{\left(re \cdot re\right)}\right)\right) \cdot \sin im \]
                                    8. Simplified100.0%

                                      \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)\right)} \cdot \sin im \]
                                  5. Recombined 3 regimes into one program.
                                  6. Final simplification98.2%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -9.5 \cdot 10^{-6}:\\ \;\;\;\;e^{re} \cdot im\\ \mathbf{elif}\;re \leq 3300000:\\ \;\;\;\;\sin im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\\ \mathbf{elif}\;re \leq 5.6 \cdot 10^{+102}:\\ \;\;\;\;e^{re} \cdot im\\ \mathbf{else}:\\ \;\;\;\;\sin im \cdot \left(0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)\right)\\ \end{array} \]
                                  7. Add Preprocessing

                                  Alternative 17: 29.4% 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 100.0%

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

                                    \[\leadsto e^{re} \cdot \color{blue}{im} \]
                                  4. Step-by-step derivation
                                    1. Simplified70.0%

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

                                      \[\leadsto \color{blue}{im + im \cdot re} \]
                                    3. Step-by-step derivation
                                      1. +-commutativeN/A

                                        \[\leadsto \color{blue}{im \cdot re + im} \]
                                      2. accelerator-lowering-fma.f6433.4

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(im, re, im\right)} \]
                                    4. Simplified33.4%

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(im, re, im\right)} \]
                                    5. Add Preprocessing

                                    Alternative 18: 26.3% 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 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. sin-lowering-sin.f6452.0

                                        \[\leadsto \color{blue}{\sin im} \]
                                    5. Simplified52.0%

                                      \[\leadsto \color{blue}{\sin im} \]
                                    6. Taylor expanded in im around 0

                                      \[\leadsto \color{blue}{im} \]
                                    7. Step-by-step derivation
                                      1. Simplified28.5%

                                        \[\leadsto \color{blue}{im} \]
                                      2. Add Preprocessing

                                      Reproduce

                                      ?
                                      herbie shell --seed 2024198 
                                      (FPCore (re im)
                                        :name "math.exp on complex, imaginary part"
                                        :precision binary64
                                        (* (exp re) (sin im)))