math.exp on complex, imaginary part

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 20 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 1.0× speedup?

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

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

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

Alternative 2: 87.1% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_0 \leq -0.02:\\
\;\;\;\;\sin im \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\\

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-68}:\\
\;\;\;\;t\_1\\

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{re} \cdot \mathsf{fma}\left(im, \frac{-1}{6} \cdot \color{blue}{\left(im \cdot im\right)}, im\right) \]
      15. *-lowering-*.f6472.0

        \[\leadsto e^{re} \cdot \mathsf{fma}\left(im, -0.16666666666666666 \cdot \color{blue}{\left(im \cdot im\right)}, im\right) \]
    5. Simplified72.0%

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

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

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

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

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

        \[\leadsto \color{blue}{e^{re}} \cdot \left(\frac{-1}{6} \cdot {im}^{3}\right) \]
      5. unpow3N/A

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

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

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

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

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

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

        \[\leadsto e^{re} \cdot \left(im \cdot \left(\frac{-1}{6} \cdot \color{blue}{\left(im \cdot im\right)}\right)\right) \]
      12. *-lowering-*.f6428.0

        \[\leadsto e^{re} \cdot \left(im \cdot \left(-0.16666666666666666 \cdot \color{blue}{\left(im \cdot im\right)}\right)\right) \]
    8. Simplified28.0%

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

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

    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.f6499.9

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

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

    if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 4.99999999999999971e-68 or 1 < (*.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.7%

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

      if 4.99999999999999971e-68 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1

      1. Initial program 100.0%

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq -\infty:\\ \;\;\;\;e^{re} \cdot \left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right)\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq -0.02:\\ \;\;\;\;\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 5 \cdot 10^{-68}:\\ \;\;\;\;e^{re} \cdot im\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq 1:\\ \;\;\;\;\sin im \cdot \left(re + 1\right)\\ \mathbf{else}:\\ \;\;\;\;e^{re} \cdot im\\ \end{array} \]
    7. Add Preprocessing

    Alternative 3: 89.2% accurate, 0.2× speedup?

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

      1. Initial program 100.0%

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

        \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + 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.f6469.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. Simplified69.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) + {im}^{2} \cdot \left(\frac{-1}{5040} \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) + \frac{1}{120} \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. Simplified44.5%

        \[\leadsto \color{blue}{im \cdot \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, im \cdot im, 1\right), \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right), \left(im \cdot im\right) \cdot \left(\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 \left(im \cdot \mathsf{fma}\left(im \cdot im, -0.0001984126984126984, 0.008333333333333333\right)\right)\right)\right)\right)} \]

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

      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.f6499.9

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

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

      if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 4.99999999999999971e-68 or 1 < (*.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.7%

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

        if 4.99999999999999971e-68 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1

        1. Initial program 100.0%

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

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

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

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

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

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

      Alternative 4: 89.2% accurate, 0.2× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \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 -\infty:\\ \;\;\;\;im \cdot \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, im \cdot im, 1\right), t\_0, \left(im \cdot im\right) \cdot \left(t\_0 \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(im \cdot im, -0.0001984126984126984, 0.008333333333333333\right)\right)\right)\right)\right)\\ \mathbf{elif}\;t\_1 \leq -0.02:\\ \;\;\;\;\frac{\sin im}{\left(-re\right) - -1}\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-68}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 1:\\ \;\;\;\;\sin im \cdot \left(re + 1\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
      (FPCore (re im)
       :precision binary64
       (let* ((t_0 (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 (- INFINITY))
           (*
            im
            (fma
             (fma -0.16666666666666666 (* im im) 1.0)
             t_0
             (*
              (* im im)
              (*
               t_0
               (*
                im
                (*
                 im
                 (fma (* im im) -0.0001984126984126984 0.008333333333333333)))))))
           (if (<= t_1 -0.02)
             (/ (sin im) (- (- re) -1.0))
             (if (<= t_1 5e-68)
               t_2
               (if (<= t_1 1.0) (* (sin im) (+ re 1.0)) t_2))))))
      double code(double re, double im) {
      	double t_0 = 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 <= -((double) INFINITY)) {
      		tmp = im * fma(fma(-0.16666666666666666, (im * im), 1.0), t_0, ((im * im) * (t_0 * (im * (im * fma((im * im), -0.0001984126984126984, 0.008333333333333333))))));
      	} else if (t_1 <= -0.02) {
      		tmp = sin(im) / (-re - -1.0);
      	} else if (t_1 <= 5e-68) {
      		tmp = t_2;
      	} else if (t_1 <= 1.0) {
      		tmp = sin(im) * (re + 1.0);
      	} else {
      		tmp = t_2;
      	}
      	return tmp;
      }
      
      function code(re, im)
      	t_0 = 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 <= Float64(-Inf))
      		tmp = Float64(im * fma(fma(-0.16666666666666666, Float64(im * im), 1.0), t_0, Float64(Float64(im * im) * Float64(t_0 * Float64(im * Float64(im * fma(Float64(im * im), -0.0001984126984126984, 0.008333333333333333)))))));
      	elseif (t_1 <= -0.02)
      		tmp = Float64(sin(im) / Float64(Float64(-re) - -1.0));
      	elseif (t_1 <= 5e-68)
      		tmp = t_2;
      	elseif (t_1 <= 1.0)
      		tmp = Float64(sin(im) * Float64(re + 1.0));
      	else
      		tmp = t_2;
      	end
      	return tmp
      end
      
      code[re_, im_] := Block[{t$95$0 = N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0 + N[(N[(im * im), $MachinePrecision] * N[(t$95$0 * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -0.02], N[(N[Sin[im], $MachinePrecision] / N[((-re) - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-68], t$95$2, If[LessEqual[t$95$1, 1.0], N[(N[Sin[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \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 -\infty:\\
      \;\;\;\;im \cdot \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, im \cdot im, 1\right), t\_0, \left(im \cdot im\right) \cdot \left(t\_0 \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(im \cdot im, -0.0001984126984126984, 0.008333333333333333\right)\right)\right)\right)\right)\\
      
      \mathbf{elif}\;t\_1 \leq -0.02:\\
      \;\;\;\;\frac{\sin im}{\left(-re\right) - -1}\\
      
      \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-68}:\\
      \;\;\;\;t\_2\\
      
      \mathbf{elif}\;t\_1 \leq 1:\\
      \;\;\;\;\sin im \cdot \left(re + 1\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_2\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -inf.0

        1. Initial program 100.0%

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

          \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + 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.f6469.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. Simplified69.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) + {im}^{2} \cdot \left(\frac{-1}{5040} \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) + \frac{1}{120} \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. Simplified44.5%

          \[\leadsto \color{blue}{im \cdot \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, im \cdot im, 1\right), \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right), \left(im \cdot im\right) \cdot \left(\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 \left(im \cdot \mathsf{fma}\left(im \cdot im, -0.0001984126984126984, 0.008333333333333333\right)\right)\right)\right)\right)} \]

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

        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-+.f6499.9

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

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

            \[\leadsto \color{blue}{\frac{re \cdot re - 1 \cdot 1}{re - 1}} \cdot \sin im \]
          2. associate-*l/N/A

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

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

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

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

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

            \[\leadsto \frac{\sin im \cdot \left(re \cdot re - \color{blue}{1}\right)}{re - 1} \]
          8. sub-negN/A

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

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

            \[\leadsto \frac{\sin im \cdot \mathsf{fma}\left(re, re, \color{blue}{-1}\right)}{re - 1} \]
          11. sub-negN/A

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

            \[\leadsto \frac{\sin im \cdot \mathsf{fma}\left(re, re, -1\right)}{\color{blue}{re + \left(\mathsf{neg}\left(1\right)\right)}} \]
          13. metadata-eval99.9

            \[\leadsto \frac{\sin im \cdot \mathsf{fma}\left(re, re, -1\right)}{re + \color{blue}{-1}} \]
        7. Applied egg-rr99.9%

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

          \[\leadsto \frac{\color{blue}{-1 \cdot \sin im}}{re + -1} \]
        9. Step-by-step derivation
          1. mul-1-negN/A

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

            \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\sin im\right)}}{re + -1} \]
          3. sin-lowering-sin.f6499.9

            \[\leadsto \frac{-\color{blue}{\sin im}}{re + -1} \]
        10. Simplified99.9%

          \[\leadsto \frac{\color{blue}{-\sin im}}{re + -1} \]

        if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 4.99999999999999971e-68 or 1 < (*.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.7%

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

          if 4.99999999999999971e-68 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1

          1. Initial program 100.0%

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

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

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

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq -\infty:\\ \;\;\;\;im \cdot \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, im \cdot im, 1\right), \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right), \left(im \cdot im\right) \cdot \left(\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 \left(im \cdot \mathsf{fma}\left(im \cdot im, -0.0001984126984126984, 0.008333333333333333\right)\right)\right)\right)\right)\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq -0.02:\\ \;\;\;\;\frac{\sin im}{\left(-re\right) - -1}\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq 5 \cdot 10^{-68}:\\ \;\;\;\;e^{re} \cdot im\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq 1:\\ \;\;\;\;\sin im \cdot \left(re + 1\right)\\ \mathbf{else}:\\ \;\;\;\;e^{re} \cdot im\\ \end{array} \]
        7. Add Preprocessing

        Alternative 5: 89.2% accurate, 0.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin im \cdot \left(re + 1\right)\\ t_1 := \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\ t_2 := e^{re} \cdot \sin im\\ t_3 := e^{re} \cdot im\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;im \cdot \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, im \cdot im, 1\right), t\_1, \left(im \cdot im\right) \cdot \left(t\_1 \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(im \cdot im, -0.0001984126984126984, 0.008333333333333333\right)\right)\right)\right)\right)\\ \mathbf{elif}\;t\_2 \leq -0.02:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-68}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 1:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
        (FPCore (re im)
         :precision binary64
         (let* ((t_0 (* (sin im) (+ re 1.0)))
                (t_1 (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0))
                (t_2 (* (exp re) (sin im)))
                (t_3 (* (exp re) im)))
           (if (<= t_2 (- INFINITY))
             (*
              im
              (fma
               (fma -0.16666666666666666 (* im im) 1.0)
               t_1
               (*
                (* im im)
                (*
                 t_1
                 (*
                  im
                  (*
                   im
                   (fma (* im im) -0.0001984126984126984 0.008333333333333333)))))))
             (if (<= t_2 -0.02)
               t_0
               (if (<= t_2 5e-68) t_3 (if (<= t_2 1.0) t_0 t_3))))))
        double code(double re, double im) {
        	double t_0 = sin(im) * (re + 1.0);
        	double t_1 = fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
        	double t_2 = exp(re) * sin(im);
        	double t_3 = exp(re) * im;
        	double tmp;
        	if (t_2 <= -((double) INFINITY)) {
        		tmp = im * fma(fma(-0.16666666666666666, (im * im), 1.0), t_1, ((im * im) * (t_1 * (im * (im * fma((im * im), -0.0001984126984126984, 0.008333333333333333))))));
        	} else if (t_2 <= -0.02) {
        		tmp = t_0;
        	} else if (t_2 <= 5e-68) {
        		tmp = t_3;
        	} else if (t_2 <= 1.0) {
        		tmp = t_0;
        	} else {
        		tmp = t_3;
        	}
        	return tmp;
        }
        
        function code(re, im)
        	t_0 = Float64(sin(im) * Float64(re + 1.0))
        	t_1 = fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0)
        	t_2 = Float64(exp(re) * sin(im))
        	t_3 = Float64(exp(re) * im)
        	tmp = 0.0
        	if (t_2 <= Float64(-Inf))
        		tmp = Float64(im * fma(fma(-0.16666666666666666, Float64(im * im), 1.0), t_1, Float64(Float64(im * im) * Float64(t_1 * Float64(im * Float64(im * fma(Float64(im * im), -0.0001984126984126984, 0.008333333333333333)))))));
        	elseif (t_2 <= -0.02)
        		tmp = t_0;
        	elseif (t_2 <= 5e-68)
        		tmp = t_3;
        	elseif (t_2 <= 1.0)
        		tmp = t_0;
        	else
        		tmp = t_3;
        	end
        	return tmp
        end
        
        code[re_, im_] := Block[{t$95$0 = N[(N[Sin[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$1 + N[(N[(im * im), $MachinePrecision] * N[(t$95$1 * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -0.02], t$95$0, If[LessEqual[t$95$2, 5e-68], t$95$3, If[LessEqual[t$95$2, 1.0], t$95$0, t$95$3]]]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \sin im \cdot \left(re + 1\right)\\
        t_1 := \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\
        t_2 := e^{re} \cdot \sin im\\
        t_3 := e^{re} \cdot im\\
        \mathbf{if}\;t\_2 \leq -\infty:\\
        \;\;\;\;im \cdot \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, im \cdot im, 1\right), t\_1, \left(im \cdot im\right) \cdot \left(t\_1 \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(im \cdot im, -0.0001984126984126984, 0.008333333333333333\right)\right)\right)\right)\right)\\
        
        \mathbf{elif}\;t\_2 \leq -0.02:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-68}:\\
        \;\;\;\;t\_3\\
        
        \mathbf{elif}\;t\_2 \leq 1:\\
        \;\;\;\;t\_0\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_3\\
        
        
        \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.f6469.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. Simplified69.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) + {im}^{2} \cdot \left(\frac{-1}{5040} \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) + \frac{1}{120} \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. Simplified44.5%

            \[\leadsto \color{blue}{im \cdot \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, im \cdot im, 1\right), \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right), \left(im \cdot im\right) \cdot \left(\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 \left(im \cdot \mathsf{fma}\left(im \cdot im, -0.0001984126984126984, 0.008333333333333333\right)\right)\right)\right)\right)} \]

          if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004 or 4.99999999999999971e-68 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1

          1. Initial program 100.0%

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

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

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

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

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

          if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 4.99999999999999971e-68 or 1 < (*.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.7%

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

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

          Alternative 6: 88.9% accurate, 0.2× speedup?

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

            1. Initial program 100.0%

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

              \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + 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.f6469.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. Simplified69.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) + {im}^{2} \cdot \left(\frac{-1}{5040} \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) + \frac{1}{120} \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. Simplified44.5%

              \[\leadsto \color{blue}{im \cdot \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, im \cdot im, 1\right), \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right), \left(im \cdot im\right) \cdot \left(\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 \left(im \cdot \mathsf{fma}\left(im \cdot im, -0.0001984126984126984, 0.008333333333333333\right)\right)\right)\right)\right)} \]

            if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004 or 4.99999999999999971e-68 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1

            1. Initial program 100.0%

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

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

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

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

            if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 4.99999999999999971e-68 or 1 < (*.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.7%

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

            Alternative 7: 57.7% accurate, 0.2× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \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\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;im \cdot \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, im \cdot im, 1\right), t\_0, \left(im \cdot im\right) \cdot \left(t\_0 \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(im \cdot im, -0.0001984126984126984, 0.008333333333333333\right)\right)\right)\right)\right)\\ \mathbf{elif}\;t\_1 \leq -0.02:\\ \;\;\;\;\sin im\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right) \cdot \left(re + 1\right)\\ \mathbf{elif}\;t\_1 \leq 1:\\ \;\;\;\;\sin im\\ \mathbf{else}:\\ \;\;\;\;im \cdot t\_0\\ \end{array} \end{array} \]
            (FPCore (re im)
             :precision binary64
             (let* ((t_0 (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0))
                    (t_1 (* (exp re) (sin im))))
               (if (<= t_1 (- INFINITY))
                 (*
                  im
                  (fma
                   (fma -0.16666666666666666 (* im im) 1.0)
                   t_0
                   (*
                    (* im im)
                    (*
                     t_0
                     (*
                      im
                      (*
                       im
                       (fma (* im im) -0.0001984126984126984 0.008333333333333333)))))))
                 (if (<= t_1 -0.02)
                   (sin im)
                   (if (<= t_1 0.0)
                     (* (* im (* -0.16666666666666666 (* im im))) (+ re 1.0))
                     (if (<= t_1 1.0) (sin im) (* im t_0)))))))
            double code(double re, double im) {
            	double t_0 = fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
            	double t_1 = exp(re) * sin(im);
            	double tmp;
            	if (t_1 <= -((double) INFINITY)) {
            		tmp = im * fma(fma(-0.16666666666666666, (im * im), 1.0), t_0, ((im * im) * (t_0 * (im * (im * fma((im * im), -0.0001984126984126984, 0.008333333333333333))))));
            	} else if (t_1 <= -0.02) {
            		tmp = sin(im);
            	} else if (t_1 <= 0.0) {
            		tmp = (im * (-0.16666666666666666 * (im * im))) * (re + 1.0);
            	} else if (t_1 <= 1.0) {
            		tmp = sin(im);
            	} else {
            		tmp = im * t_0;
            	}
            	return tmp;
            }
            
            function code(re, im)
            	t_0 = fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0)
            	t_1 = Float64(exp(re) * sin(im))
            	tmp = 0.0
            	if (t_1 <= Float64(-Inf))
            		tmp = Float64(im * fma(fma(-0.16666666666666666, Float64(im * im), 1.0), t_0, Float64(Float64(im * im) * Float64(t_0 * Float64(im * Float64(im * fma(Float64(im * im), -0.0001984126984126984, 0.008333333333333333)))))));
            	elseif (t_1 <= -0.02)
            		tmp = sin(im);
            	elseif (t_1 <= 0.0)
            		tmp = Float64(Float64(im * Float64(-0.16666666666666666 * Float64(im * im))) * Float64(re + 1.0));
            	elseif (t_1 <= 1.0)
            		tmp = sin(im);
            	else
            		tmp = Float64(im * t_0);
            	end
            	return tmp
            end
            
            code[re_, im_] := Block[{t$95$0 = N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0 + N[(N[(im * im), $MachinePrecision] * N[(t$95$0 * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -0.02], N[Sin[im], $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(im * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.0], N[Sin[im], $MachinePrecision], N[(im * t$95$0), $MachinePrecision]]]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \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\\
            \mathbf{if}\;t\_1 \leq -\infty:\\
            \;\;\;\;im \cdot \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, im \cdot im, 1\right), t\_0, \left(im \cdot im\right) \cdot \left(t\_0 \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(im \cdot im, -0.0001984126984126984, 0.008333333333333333\right)\right)\right)\right)\right)\\
            
            \mathbf{elif}\;t\_1 \leq -0.02:\\
            \;\;\;\;\sin im\\
            
            \mathbf{elif}\;t\_1 \leq 0:\\
            \;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right) \cdot \left(re + 1\right)\\
            
            \mathbf{elif}\;t\_1 \leq 1:\\
            \;\;\;\;\sin im\\
            
            \mathbf{else}:\\
            \;\;\;\;im \cdot t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 4 regimes
            2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -inf.0

              1. Initial program 100.0%

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

                \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + 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.f6469.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. Simplified69.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) + {im}^{2} \cdot \left(\frac{-1}{5040} \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) + \frac{1}{120} \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. Simplified44.5%

                \[\leadsto \color{blue}{im \cdot \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, im \cdot im, 1\right), \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right), \left(im \cdot im\right) \cdot \left(\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 \left(im \cdot \mathsf{fma}\left(im \cdot im, -0.0001984126984126984, 0.008333333333333333\right)\right)\right)\right)\right)} \]

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

              1. Initial program 100.0%

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

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

                  \[\leadsto \color{blue}{\sin im} \]
              5. Simplified96.7%

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

              if -0.0200000000000000004 < (*.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 \color{blue}{im \cdot \left(e^{re} + \frac{-1}{6} \cdot \left({im}^{2} \cdot e^{re}\right)\right)} \]
              4. Step-by-step derivation
                1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto e^{re} \cdot \mathsf{fma}\left(im, \frac{-1}{6} \cdot \color{blue}{\left(im \cdot im\right)}, im\right) \]
                15. *-lowering-*.f6472.6

                  \[\leadsto e^{re} \cdot \mathsf{fma}\left(im, -0.16666666666666666 \cdot \color{blue}{\left(im \cdot im\right)}, im\right) \]
              5. Simplified72.6%

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(re + 1\right) \cdot \left(im \cdot \left(\frac{-1}{6} \cdot \color{blue}{\left(im \cdot im\right)}\right)\right) \]
                8. *-lowering-*.f6419.9

                  \[\leadsto \left(re + 1\right) \cdot \left(im \cdot \left(-0.16666666666666666 \cdot \color{blue}{\left(im \cdot im\right)}\right)\right) \]
              11. Simplified19.9%

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

              if 1 < (*.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. Simplified75.9%

                  \[\leadsto e^{re} \cdot \color{blue}{im} \]
                2. 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 im \]
                3. 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 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 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 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 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 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 im \]
                  7. accelerator-lowering-fma.f6456.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 im \]
                4. Simplified56.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 im \]
              5. Recombined 4 regimes into one program.
              6. Final simplification55.2%

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

              Alternative 8: 31.7% accurate, 0.9× speedup?

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

                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto e^{re} \cdot \mathsf{fma}\left(im, -0.16666666666666666 \cdot \color{blue}{\left(im \cdot im\right)}, im\right) \]
                5. Simplified59.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(re + 1\right) \cdot \left(im \cdot \left(-0.16666666666666666 \cdot \color{blue}{\left(im \cdot im\right)}\right)\right) \]
                11. Simplified17.4%

                  \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\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.f6486.8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 9: 31.7% accurate, 0.9× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\ \;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right) \cdot \left(re + 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 (* -0.16666666666666666 (* im im))) (+ re 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 * (-0.16666666666666666 * (im * im))) * (re + 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(Float64(im * Float64(-0.16666666666666666 * Float64(im * im))) * Float64(re + 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[(N[(im * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re + 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:\\
              \;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right) \cdot \left(re + 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 im around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto e^{re} \cdot \mathsf{fma}\left(im, -0.16666666666666666 \cdot \color{blue}{\left(im \cdot im\right)}, im\right) \]
                5. Simplified59.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(re + 1\right) \cdot \left(im \cdot \left(-0.16666666666666666 \cdot \color{blue}{\left(im \cdot im\right)}\right)\right) \]
                11. Simplified17.4%

                  \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\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. Simplified62.1%

                    \[\leadsto e^{re} \cdot \color{blue}{im} \]
                  2. 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 im \]
                  3. 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 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 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 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 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 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 im \]
                    7. accelerator-lowering-fma.f6455.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 im \]
                  4. Simplified55.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 im \]
                5. Recombined 2 regimes into one program.
                6. Final simplification31.4%

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

                Alternative 10: 30.4% accurate, 0.9× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\ \;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right) \cdot \left(re + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot 0.5\right), im, \mathsf{fma}\left(re, im, im\right)\right)\\ \end{array} \end{array} \]
                (FPCore (re im)
                 :precision binary64
                 (if (<= (* (exp re) (sin im)) 0.0)
                   (* (* im (* -0.16666666666666666 (* im im))) (+ re 1.0))
                   (fma (* re (* re 0.5)) im (fma re im im))))
                double code(double re, double im) {
                	double tmp;
                	if ((exp(re) * sin(im)) <= 0.0) {
                		tmp = (im * (-0.16666666666666666 * (im * im))) * (re + 1.0);
                	} else {
                		tmp = fma((re * (re * 0.5)), im, fma(re, im, im));
                	}
                	return tmp;
                }
                
                function code(re, im)
                	tmp = 0.0
                	if (Float64(exp(re) * sin(im)) <= 0.0)
                		tmp = Float64(Float64(im * Float64(-0.16666666666666666 * Float64(im * im))) * Float64(re + 1.0));
                	else
                		tmp = fma(Float64(re * Float64(re * 0.5)), im, fma(re, im, im));
                	end
                	return tmp
                end
                
                code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(im * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(re * 0.5), $MachinePrecision]), $MachinePrecision] * im + N[(re * im + im), $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
                \;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right) \cdot \left(re + 1\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot 0.5\right), im, \mathsf{fma}\left(re, im, im\right)\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 im around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto e^{re} \cdot \mathsf{fma}\left(im, -0.16666666666666666 \cdot \color{blue}{\left(im \cdot im\right)}, im\right) \]
                  5. Simplified59.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(re + 1\right) \cdot \left(im \cdot \left(-0.16666666666666666 \cdot \color{blue}{\left(im \cdot im\right)}\right)\right) \]
                  11. Simplified17.4%

                    \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\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. Simplified62.1%

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

                      \[\leadsto \color{blue}{im + re \cdot \left(im + \frac{1}{2} \cdot \left(im \cdot re\right)\right)} \]
                    3. Step-by-step derivation
                      1. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(im, \mathsf{fma}\left(0.5, re \cdot re, re\right), im\right)} \]
                    5. Step-by-step derivation
                      1. distribute-rgt-inN/A

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(re \cdot \color{blue}{\left(re \cdot \frac{1}{2}\right)}, im, re \cdot im + im\right) \]
                      9. accelerator-lowering-fma.f6450.1

                        \[\leadsto \mathsf{fma}\left(re \cdot \left(re \cdot 0.5\right), im, \color{blue}{\mathsf{fma}\left(re, im, im\right)}\right) \]
                    6. Applied egg-rr50.1%

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

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

                  Alternative 11: 28.6% accurate, 0.9× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\ \;\;\;\;-0.16666666666666666 \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(im, re, im\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot 0.5\right), im, \mathsf{fma}\left(re, im, im\right)\right)\\ \end{array} \end{array} \]
                  (FPCore (re im)
                   :precision binary64
                   (if (<= (* (exp re) (sin im)) 0.0)
                     (* -0.16666666666666666 (* im (* im (fma im re im))))
                     (fma (* re (* re 0.5)) im (fma re im im))))
                  double code(double re, double im) {
                  	double tmp;
                  	if ((exp(re) * sin(im)) <= 0.0) {
                  		tmp = -0.16666666666666666 * (im * (im * fma(im, re, im)));
                  	} else {
                  		tmp = fma((re * (re * 0.5)), im, fma(re, im, im));
                  	}
                  	return tmp;
                  }
                  
                  function code(re, im)
                  	tmp = 0.0
                  	if (Float64(exp(re) * sin(im)) <= 0.0)
                  		tmp = Float64(-0.16666666666666666 * Float64(im * Float64(im * fma(im, re, im))));
                  	else
                  		tmp = fma(Float64(re * Float64(re * 0.5)), im, fma(re, im, im));
                  	end
                  	return tmp
                  end
                  
                  code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.0], N[(-0.16666666666666666 * N[(im * N[(im * N[(im * re + im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(re * 0.5), $MachinePrecision]), $MachinePrecision] * im + N[(re * im + im), $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;e^{re} \cdot \sin im \leq 0:\\
                  \;\;\;\;-0.16666666666666666 \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(im, re, im\right)\right)\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot 0.5\right), im, \mathsf{fma}\left(re, im, im\right)\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 im around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto e^{re} \cdot \mathsf{fma}\left(im, -0.16666666666666666 \cdot \color{blue}{\left(im \cdot im\right)}, im\right) \]
                    5. Simplified59.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(im, re, im\right)\right)\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. Simplified62.1%

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

                        \[\leadsto \color{blue}{im + re \cdot \left(im + \frac{1}{2} \cdot \left(im \cdot re\right)\right)} \]
                      3. Step-by-step derivation
                        1. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\mathsf{fma}\left(im, \mathsf{fma}\left(0.5, re \cdot re, re\right), im\right)} \]
                      5. Step-by-step derivation
                        1. distribute-rgt-inN/A

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(re \cdot \color{blue}{\left(re \cdot \frac{1}{2}\right)}, im, re \cdot im + im\right) \]
                        9. accelerator-lowering-fma.f6450.1

                          \[\leadsto \mathsf{fma}\left(re \cdot \left(re \cdot 0.5\right), im, \color{blue}{\mathsf{fma}\left(re, im, im\right)}\right) \]
                      6. Applied egg-rr50.1%

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

                    Alternative 12: 28.6% accurate, 0.9× speedup?

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

                      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto e^{re} \cdot \mathsf{fma}\left(im, -0.16666666666666666 \cdot \color{blue}{\left(im \cdot im\right)}, im\right) \]
                      5. Simplified59.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(im \cdot \left(im \cdot \mathsf{fma}\left(im, re, im\right)\right)\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. Simplified62.1%

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

                          \[\leadsto \color{blue}{im + re \cdot \left(im + \frac{1}{2} \cdot \left(im \cdot re\right)\right)} \]
                        3. Step-by-step derivation
                          1. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 13: 34.1% accurate, 0.9× speedup?

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

                        1. Initial program 100.0%

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

                          \[\leadsto \color{blue}{\sin im} \]
                        4. Step-by-step derivation
                          1. sin-lowering-sin.f6440.0

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{\mathsf{fma}\left(im, -0.16666666666666666 \cdot \left(im \cdot im\right), im\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. Simplified62.1%

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

                            \[\leadsto \color{blue}{im + re \cdot \left(im + \frac{1}{2} \cdot \left(im \cdot re\right)\right)} \]
                          3. Step-by-step derivation
                            1. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        Alternative 14: 33.8% accurate, 0.9× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 10^{-7}:\\ \;\;\;\;\mathsf{fma}\left(im, -0.16666666666666666 \cdot \left(im \cdot im\right), im\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(im \cdot \left(re \cdot re\right)\right)\\ \end{array} \end{array} \]
                        (FPCore (re im)
                         :precision binary64
                         (if (<= (* (exp re) (sin im)) 1e-7)
                           (fma im (* -0.16666666666666666 (* im im)) im)
                           (* 0.5 (* im (* re re)))))
                        double code(double re, double im) {
                        	double tmp;
                        	if ((exp(re) * sin(im)) <= 1e-7) {
                        		tmp = fma(im, (-0.16666666666666666 * (im * im)), im);
                        	} else {
                        		tmp = 0.5 * (im * (re * re));
                        	}
                        	return tmp;
                        }
                        
                        function code(re, im)
                        	tmp = 0.0
                        	if (Float64(exp(re) * sin(im)) <= 1e-7)
                        		tmp = fma(im, Float64(-0.16666666666666666 * Float64(im * im)), im);
                        	else
                        		tmp = Float64(0.5 * Float64(im * Float64(re * re)));
                        	end
                        	return tmp
                        end
                        
                        code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 1e-7], N[(im * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + im), $MachinePrecision], N[(0.5 * N[(im * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;e^{re} \cdot \sin im \leq 10^{-7}:\\
                        \;\;\;\;\mathsf{fma}\left(im, -0.16666666666666666 \cdot \left(im \cdot im\right), im\right)\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;0.5 \cdot \left(im \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)) < 9.9999999999999995e-8

                          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.f6450.0

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

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

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

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

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

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

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

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

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

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

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

                          if 9.9999999999999995e-8 < (*.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. Simplified39.1%

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

                              \[\leadsto \color{blue}{im + re \cdot \left(im + \frac{1}{2} \cdot \left(im \cdot re\right)\right)} \]
                            3. Step-by-step derivation
                              1. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \color{blue}{\mathsf{fma}\left(im, \mathsf{fma}\left(0.5, re \cdot re, re\right), im\right)} \]
                            5. Step-by-step derivation
                              1. distribute-rgt-inN/A

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(re \cdot \color{blue}{\left(re \cdot \frac{1}{2}\right)}, im, re \cdot im + im\right) \]
                              9. accelerator-lowering-fma.f6421.1

                                \[\leadsto \mathsf{fma}\left(re \cdot \left(re \cdot 0.5\right), im, \color{blue}{\mathsf{fma}\left(re, im, im\right)}\right) \]
                            6. Applied egg-rr21.1%

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

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

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

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

                                \[\leadsto \frac{1}{2} \cdot \left(im \cdot \color{blue}{\left(re \cdot re\right)}\right) \]
                              4. *-lowering-*.f6421.3

                                \[\leadsto 0.5 \cdot \left(im \cdot \color{blue}{\left(re \cdot re\right)}\right) \]
                            9. Simplified21.3%

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

                          Alternative 15: 33.6% accurate, 0.9× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 1:\\ \;\;\;\;\mathsf{fma}\left(im, re, im\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(im \cdot \left(re \cdot re\right)\right)\\ \end{array} \end{array} \]
                          (FPCore (re im)
                           :precision binary64
                           (if (<= (* (exp re) (sin im)) 1.0) (fma im re im) (* 0.5 (* im (* re re)))))
                          double code(double re, double im) {
                          	double tmp;
                          	if ((exp(re) * sin(im)) <= 1.0) {
                          		tmp = fma(im, re, im);
                          	} else {
                          		tmp = 0.5 * (im * (re * re));
                          	}
                          	return tmp;
                          }
                          
                          function code(re, im)
                          	tmp = 0.0
                          	if (Float64(exp(re) * sin(im)) <= 1.0)
                          		tmp = fma(im, re, im);
                          	else
                          		tmp = Float64(0.5 * Float64(im * Float64(re * re)));
                          	end
                          	return tmp
                          end
                          
                          code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 1.0], N[(im * re + im), $MachinePrecision], N[(0.5 * N[(im * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;e^{re} \cdot \sin im \leq 1:\\
                          \;\;\;\;\mathsf{fma}\left(im, re, im\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;0.5 \cdot \left(im \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

                            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. Simplified71.4%

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

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

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

                              if 1 < (*.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. Simplified75.9%

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

                                  \[\leadsto \color{blue}{im + re \cdot \left(im + \frac{1}{2} \cdot \left(im \cdot re\right)\right)} \]
                                3. Step-by-step derivation
                                  1. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(im, \mathsf{fma}\left(0.5, re \cdot re, re\right), im\right)} \]
                                5. Step-by-step derivation
                                  1. distribute-rgt-inN/A

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(re \cdot \color{blue}{\left(re \cdot \frac{1}{2}\right)}, im, re \cdot im + im\right) \]
                                  9. accelerator-lowering-fma.f6439.3

                                    \[\leadsto \mathsf{fma}\left(re \cdot \left(re \cdot 0.5\right), im, \color{blue}{\mathsf{fma}\left(re, im, im\right)}\right) \]
                                6. Applied egg-rr39.3%

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

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

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

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

                                    \[\leadsto \frac{1}{2} \cdot \left(im \cdot \color{blue}{\left(re \cdot re\right)}\right) \]
                                  4. *-lowering-*.f6439.3

                                    \[\leadsto 0.5 \cdot \left(im \cdot \color{blue}{\left(re \cdot re\right)}\right) \]
                                9. Simplified39.3%

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

                              Alternative 16: 28.3% accurate, 0.9× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 0.999:\\ \;\;\;\;im\\ \mathbf{else}:\\ \;\;\;\;re \cdot im\\ \end{array} \end{array} \]
                              (FPCore (re im)
                               :precision binary64
                               (if (<= (* (exp re) (sin im)) 0.999) im (* re im)))
                              double code(double re, double im) {
                              	double tmp;
                              	if ((exp(re) * sin(im)) <= 0.999) {
                              		tmp = im;
                              	} else {
                              		tmp = re * im;
                              	}
                              	return tmp;
                              }
                              
                              real(8) function code(re, im)
                                  real(8), intent (in) :: re
                                  real(8), intent (in) :: im
                                  real(8) :: tmp
                                  if ((exp(re) * sin(im)) <= 0.999d0) then
                                      tmp = im
                                  else
                                      tmp = re * im
                                  end if
                                  code = tmp
                              end function
                              
                              public static double code(double re, double im) {
                              	double tmp;
                              	if ((Math.exp(re) * Math.sin(im)) <= 0.999) {
                              		tmp = im;
                              	} else {
                              		tmp = re * im;
                              	}
                              	return tmp;
                              }
                              
                              def code(re, im):
                              	tmp = 0
                              	if (math.exp(re) * math.sin(im)) <= 0.999:
                              		tmp = im
                              	else:
                              		tmp = re * im
                              	return tmp
                              
                              function code(re, im)
                              	tmp = 0.0
                              	if (Float64(exp(re) * sin(im)) <= 0.999)
                              		tmp = im;
                              	else
                              		tmp = Float64(re * im);
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(re, im)
                              	tmp = 0.0;
                              	if ((exp(re) * sin(im)) <= 0.999)
                              		tmp = im;
                              	else
                              		tmp = re * im;
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.999], im, N[(re * im), $MachinePrecision]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;e^{re} \cdot \sin im \leq 0.999:\\
                              \;\;\;\;im\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;re \cdot im\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.998999999999999999

                                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. Simplified71.7%

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

                                    \[\leadsto \color{blue}{im} \]
                                  3. Step-by-step derivation
                                    1. Simplified31.1%

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

                                    if 0.998999999999999999 < (*.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. Simplified73.4%

                                        \[\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.f6412.4

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

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

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

                                          \[\leadsto \color{blue}{im \cdot re} \]
                                      7. Simplified12.6%

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

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

                                    Alternative 17: 97.4% accurate, 1.5× speedup?

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

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

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

                                        if -0.0779999999999999999 < re < 9.5999999999999998e-15 or 1e103 < 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.f6499.9

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

                                          \[\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 9.5999999999999998e-15 < re < 1e103

                                        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto e^{re} \cdot \mathsf{fma}\left(im, -0.16666666666666666 \cdot \color{blue}{\left(im \cdot im\right)}, im\right) \]
                                        5. Simplified92.4%

                                          \[\leadsto \color{blue}{e^{re} \cdot \mathsf{fma}\left(im, -0.16666666666666666 \cdot \left(im \cdot im\right), im\right)} \]
                                      5. Recombined 3 regimes into one program.
                                      6. Final simplification99.1%

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

                                      Alternative 18: 96.2% accurate, 1.5× speedup?

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

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

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

                                          if -0.016 < re < 9.5999999999999998e-15 or 1.8999999999999999e154 < 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 + \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.f6499.8

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

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

                                          if 9.5999999999999998e-15 < re < 1.8999999999999999e154

                                          1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto e^{re} \cdot \mathsf{fma}\left(im, \frac{-1}{6} \cdot \color{blue}{\left(im \cdot im\right)}, im\right) \]
                                            15. *-lowering-*.f6489.1

                                              \[\leadsto e^{re} \cdot \mathsf{fma}\left(im, -0.16666666666666666 \cdot \color{blue}{\left(im \cdot im\right)}, im\right) \]
                                          5. Simplified89.1%

                                            \[\leadsto \color{blue}{e^{re} \cdot \mathsf{fma}\left(im, -0.16666666666666666 \cdot \left(im \cdot im\right), im\right)} \]
                                        5. Recombined 3 regimes into one program.
                                        6. Final simplification98.3%

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

                                        Alternative 19: 29.7% 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. Simplified71.9%

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

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

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

                                          Alternative 20: 26.6% 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 im around 0

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

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

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

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

                                              Reproduce

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