math.exp on complex, imaginary part

Percentage Accurate: 100.0% → 98.1%
Time: 21.4s
Alternatives: 24
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 24 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: 98.1% accurate, 0.2× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := e^{re} \cdot im\_m\\ t_1 := e^{re} \cdot \sin im\_m\\ t_2 := \sin im\_m \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, im\_m \cdot \left(-0.0001984126984126984 \cdot \left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right)\right), 1\right)\\ \mathbf{elif}\;t\_1 \leq -0.02:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 1:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (let* ((t_0 (* (exp re) im_m))
        (t_1 (* (exp re) (sin im_m)))
        (t_2 (* (sin im_m) (fma re (fma re 0.5 1.0) 1.0))))
   (*
    im_s
    (if (<= t_1 (- INFINITY))
      (*
       im_m
       (fma
        (* im_m im_m)
        (* im_m (* -0.0001984126984126984 (* im_m (* im_m im_m))))
        1.0))
      (if (<= t_1 -0.02)
        t_2
        (if (<= t_1 0.0) t_0 (if (<= t_1 1.0) t_2 t_0)))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	double t_0 = exp(re) * im_m;
	double t_1 = exp(re) * sin(im_m);
	double t_2 = sin(im_m) * fma(re, fma(re, 0.5, 1.0), 1.0);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = im_m * fma((im_m * im_m), (im_m * (-0.0001984126984126984 * (im_m * (im_m * im_m)))), 1.0);
	} else if (t_1 <= -0.02) {
		tmp = t_2;
	} else if (t_1 <= 0.0) {
		tmp = t_0;
	} else if (t_1 <= 1.0) {
		tmp = t_2;
	} else {
		tmp = t_0;
	}
	return im_s * tmp;
}
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	t_0 = Float64(exp(re) * im_m)
	t_1 = Float64(exp(re) * sin(im_m))
	t_2 = Float64(sin(im_m) * fma(re, fma(re, 0.5, 1.0), 1.0))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(im_m * fma(Float64(im_m * im_m), Float64(im_m * Float64(-0.0001984126984126984 * Float64(im_m * Float64(im_m * im_m)))), 1.0));
	elseif (t_1 <= -0.02)
		tmp = t_2;
	elseif (t_1 <= 0.0)
		tmp = t_0;
	elseif (t_1 <= 1.0)
		tmp = t_2;
	else
		tmp = t_0;
	end
	return Float64(im_s * tmp)
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im$95$m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[im$95$m], $MachinePrecision] * N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, N[(im$95$s * If[LessEqual[t$95$1, (-Infinity)], N[(im$95$m * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(im$95$m * N[(-0.0001984126984126984 * N[(im$95$m * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -0.02], t$95$2, If[LessEqual[t$95$1, 0.0], t$95$0, If[LessEqual[t$95$1, 1.0], t$95$2, t$95$0]]]]), $MachinePrecision]]]]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

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

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

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;t\_2\\

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


\end{array}
\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}{\sin im} \]
    4. Step-by-step derivation
      1. sin-lowering-sin.f642.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{-1}{5040} \cdot {im}^{4}}, 1\right) \]
    10. Step-by-step derivation
      1. metadata-evalN/A

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

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

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

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

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

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

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

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

        \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, im \cdot \left(\frac{-1}{5040} \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot im\right)\right), 1\right) \]
      10. unpow3N/A

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

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

        \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, im \cdot \color{blue}{\left(\frac{-1}{5040} \cdot {im}^{3}\right)}, 1\right) \]
      13. cube-multN/A

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

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

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

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

        \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, im \cdot \left(-0.0001984126984126984 \cdot \left(im \cdot \color{blue}{\left(im \cdot im\right)}\right)\right), 1\right) \]
    11. Simplified38.5%

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

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

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

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

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

    Alternative 2: 97.9% accurate, 0.2× speedup?

    \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := e^{re} \cdot \sin im\_m\\ t_1 := \sin im\_m \cdot \left(re + 1\right)\\ t_2 := e^{re} \cdot im\_m\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq -\infty:\\ \;\;\;\;im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, im\_m \cdot \left(-0.0001984126984126984 \cdot \left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right)\right), 1\right)\\ \mathbf{elif}\;t\_0 \leq -0.02:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_0 \leq 1:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \end{array} \]
    im\_m = (fabs.f64 im)
    im\_s = (copysign.f64 #s(literal 1 binary64) im)
    (FPCore (im_s re im_m)
     :precision binary64
     (let* ((t_0 (* (exp re) (sin im_m)))
            (t_1 (* (sin im_m) (+ re 1.0)))
            (t_2 (* (exp re) im_m)))
       (*
        im_s
        (if (<= t_0 (- INFINITY))
          (*
           im_m
           (fma
            (* im_m im_m)
            (* im_m (* -0.0001984126984126984 (* im_m (* im_m im_m))))
            1.0))
          (if (<= t_0 -0.02)
            t_1
            (if (<= t_0 0.0) t_2 (if (<= t_0 1.0) t_1 t_2)))))))
    im\_m = fabs(im);
    im\_s = copysign(1.0, im);
    double code(double im_s, double re, double im_m) {
    	double t_0 = exp(re) * sin(im_m);
    	double t_1 = sin(im_m) * (re + 1.0);
    	double t_2 = exp(re) * im_m;
    	double tmp;
    	if (t_0 <= -((double) INFINITY)) {
    		tmp = im_m * fma((im_m * im_m), (im_m * (-0.0001984126984126984 * (im_m * (im_m * im_m)))), 1.0);
    	} else if (t_0 <= -0.02) {
    		tmp = t_1;
    	} else if (t_0 <= 0.0) {
    		tmp = t_2;
    	} else if (t_0 <= 1.0) {
    		tmp = t_1;
    	} else {
    		tmp = t_2;
    	}
    	return im_s * tmp;
    }
    
    im\_m = abs(im)
    im\_s = copysign(1.0, im)
    function code(im_s, re, im_m)
    	t_0 = Float64(exp(re) * sin(im_m))
    	t_1 = Float64(sin(im_m) * Float64(re + 1.0))
    	t_2 = Float64(exp(re) * im_m)
    	tmp = 0.0
    	if (t_0 <= Float64(-Inf))
    		tmp = Float64(im_m * fma(Float64(im_m * im_m), Float64(im_m * Float64(-0.0001984126984126984 * Float64(im_m * Float64(im_m * im_m)))), 1.0));
    	elseif (t_0 <= -0.02)
    		tmp = t_1;
    	elseif (t_0 <= 0.0)
    		tmp = t_2;
    	elseif (t_0 <= 1.0)
    		tmp = t_1;
    	else
    		tmp = t_2;
    	end
    	return Float64(im_s * tmp)
    end
    
    im\_m = N[Abs[im], $MachinePrecision]
    im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im$95$m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[im$95$m], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[re], $MachinePrecision] * im$95$m), $MachinePrecision]}, N[(im$95$s * If[LessEqual[t$95$0, (-Infinity)], N[(im$95$m * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(im$95$m * N[(-0.0001984126984126984 * N[(im$95$m * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.02], t$95$1, If[LessEqual[t$95$0, 0.0], t$95$2, If[LessEqual[t$95$0, 1.0], t$95$1, t$95$2]]]]), $MachinePrecision]]]]
    
    \begin{array}{l}
    im\_m = \left|im\right|
    \\
    im\_s = \mathsf{copysign}\left(1, im\right)
    
    \\
    \begin{array}{l}
    t_0 := e^{re} \cdot \sin im\_m\\
    t_1 := \sin im\_m \cdot \left(re + 1\right)\\
    t_2 := e^{re} \cdot im\_m\\
    im\_s \cdot \begin{array}{l}
    \mathbf{if}\;t\_0 \leq -\infty:\\
    \;\;\;\;im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, im\_m \cdot \left(-0.0001984126984126984 \cdot \left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right)\right), 1\right)\\
    
    \mathbf{elif}\;t\_0 \leq -0.02:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t\_0 \leq 0:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;t\_0 \leq 1:\\
    \;\;\;\;t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_2\\
    
    
    \end{array}
    \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}{\sin im} \]
      4. Step-by-step derivation
        1. sin-lowering-sin.f642.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{-1}{5040} \cdot {im}^{4}}, 1\right) \]
      10. Step-by-step derivation
        1. metadata-evalN/A

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

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

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

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

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

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

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

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

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, im \cdot \left(\frac{-1}{5040} \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot im\right)\right), 1\right) \]
        10. unpow3N/A

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

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

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, im \cdot \color{blue}{\left(\frac{-1}{5040} \cdot {im}^{3}\right)}, 1\right) \]
        13. cube-multN/A

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

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

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

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

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, im \cdot \left(-0.0001984126984126984 \cdot \left(im \cdot \color{blue}{\left(im \cdot im\right)}\right)\right), 1\right) \]
      11. Simplified38.5%

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

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

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

      if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0 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.5%

          \[\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(im \cdot im, im \cdot \left(-0.0001984126984126984 \cdot \left(im \cdot \left(im \cdot im\right)\right)\right), 1\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 0:\\ \;\;\;\;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: 98.1% accurate, 0.2× speedup?

      \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := e^{re} \cdot \sin im\_m\\ t_1 := e^{re} \cdot im\_m\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq -\infty:\\ \;\;\;\;im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, im\_m \cdot \left(-0.0001984126984126984 \cdot \left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right)\right), 1\right)\\ \mathbf{elif}\;t\_0 \leq -0.02:\\ \;\;\;\;\sin im\_m\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-13}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 1:\\ \;\;\;\;\sin im\_m\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
      im\_m = (fabs.f64 im)
      im\_s = (copysign.f64 #s(literal 1 binary64) im)
      (FPCore (im_s re im_m)
       :precision binary64
       (let* ((t_0 (* (exp re) (sin im_m))) (t_1 (* (exp re) im_m)))
         (*
          im_s
          (if (<= t_0 (- INFINITY))
            (*
             im_m
             (fma
              (* im_m im_m)
              (* im_m (* -0.0001984126984126984 (* im_m (* im_m im_m))))
              1.0))
            (if (<= t_0 -0.02)
              (sin im_m)
              (if (<= t_0 2e-13) t_1 (if (<= t_0 1.0) (sin im_m) t_1)))))))
      im\_m = fabs(im);
      im\_s = copysign(1.0, im);
      double code(double im_s, double re, double im_m) {
      	double t_0 = exp(re) * sin(im_m);
      	double t_1 = exp(re) * im_m;
      	double tmp;
      	if (t_0 <= -((double) INFINITY)) {
      		tmp = im_m * fma((im_m * im_m), (im_m * (-0.0001984126984126984 * (im_m * (im_m * im_m)))), 1.0);
      	} else if (t_0 <= -0.02) {
      		tmp = sin(im_m);
      	} else if (t_0 <= 2e-13) {
      		tmp = t_1;
      	} else if (t_0 <= 1.0) {
      		tmp = sin(im_m);
      	} else {
      		tmp = t_1;
      	}
      	return im_s * tmp;
      }
      
      im\_m = abs(im)
      im\_s = copysign(1.0, im)
      function code(im_s, re, im_m)
      	t_0 = Float64(exp(re) * sin(im_m))
      	t_1 = Float64(exp(re) * im_m)
      	tmp = 0.0
      	if (t_0 <= Float64(-Inf))
      		tmp = Float64(im_m * fma(Float64(im_m * im_m), Float64(im_m * Float64(-0.0001984126984126984 * Float64(im_m * Float64(im_m * im_m)))), 1.0));
      	elseif (t_0 <= -0.02)
      		tmp = sin(im_m);
      	elseif (t_0 <= 2e-13)
      		tmp = t_1;
      	elseif (t_0 <= 1.0)
      		tmp = sin(im_m);
      	else
      		tmp = t_1;
      	end
      	return Float64(im_s * tmp)
      end
      
      im\_m = N[Abs[im], $MachinePrecision]
      im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
      code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im$95$m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[re], $MachinePrecision] * im$95$m), $MachinePrecision]}, N[(im$95$s * If[LessEqual[t$95$0, (-Infinity)], N[(im$95$m * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(im$95$m * N[(-0.0001984126984126984 * N[(im$95$m * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.02], N[Sin[im$95$m], $MachinePrecision], If[LessEqual[t$95$0, 2e-13], t$95$1, If[LessEqual[t$95$0, 1.0], N[Sin[im$95$m], $MachinePrecision], t$95$1]]]]), $MachinePrecision]]]
      
      \begin{array}{l}
      im\_m = \left|im\right|
      \\
      im\_s = \mathsf{copysign}\left(1, im\right)
      
      \\
      \begin{array}{l}
      t_0 := e^{re} \cdot \sin im\_m\\
      t_1 := e^{re} \cdot im\_m\\
      im\_s \cdot \begin{array}{l}
      \mathbf{if}\;t\_0 \leq -\infty:\\
      \;\;\;\;im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, im\_m \cdot \left(-0.0001984126984126984 \cdot \left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right)\right), 1\right)\\
      
      \mathbf{elif}\;t\_0 \leq -0.02:\\
      \;\;\;\;\sin im\_m\\
      
      \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-13}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;t\_0 \leq 1:\\
      \;\;\;\;\sin im\_m\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \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}{\sin im} \]
        4. Step-by-step derivation
          1. sin-lowering-sin.f642.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{-1}{5040} \cdot {im}^{4}}, 1\right) \]
        10. Step-by-step derivation
          1. metadata-evalN/A

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

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

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

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

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

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

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

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

            \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, im \cdot \left(\frac{-1}{5040} \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot im\right)\right), 1\right) \]
          10. unpow3N/A

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

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

            \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, im \cdot \color{blue}{\left(\frac{-1}{5040} \cdot {im}^{3}\right)}, 1\right) \]
          13. cube-multN/A

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

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

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

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

            \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, im \cdot \left(-0.0001984126984126984 \cdot \left(im \cdot \color{blue}{\left(im \cdot im\right)}\right)\right), 1\right) \]
        11. Simplified38.5%

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

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

        1. Initial program 99.9%

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

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

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

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

        if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 2.0000000000000001e-13 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. Simplified96.3%

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

        Alternative 4: 78.0% accurate, 0.2× speedup?

        \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := e^{re} \cdot \sin im\_m\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq -\infty:\\ \;\;\;\;im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, im\_m \cdot \left(-0.0001984126984126984 \cdot \left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right)\right), 1\right)\\ \mathbf{elif}\;t\_0 \leq -0.02:\\ \;\;\;\;\sin im\_m\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;im\_m \cdot \left(0.008333333333333333 \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(im\_m \cdot im\_m\right)\right)\right)\\ \mathbf{elif}\;t\_0 \leq 1:\\ \;\;\;\;\sin im\_m\\ \mathbf{else}:\\ \;\;\;\;im\_m \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} \end{array} \]
        im\_m = (fabs.f64 im)
        im\_s = (copysign.f64 #s(literal 1 binary64) im)
        (FPCore (im_s re im_m)
         :precision binary64
         (let* ((t_0 (* (exp re) (sin im_m))))
           (*
            im_s
            (if (<= t_0 (- INFINITY))
              (*
               im_m
               (fma
                (* im_m im_m)
                (* im_m (* -0.0001984126984126984 (* im_m (* im_m im_m))))
                1.0))
              (if (<= t_0 -0.02)
                (sin im_m)
                (if (<= t_0 0.0)
                  (* im_m (* 0.008333333333333333 (* (* im_m im_m) (* im_m im_m))))
                  (if (<= t_0 1.0)
                    (sin im_m)
                    (*
                     im_m
                     (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0)))))))))
        im\_m = fabs(im);
        im\_s = copysign(1.0, im);
        double code(double im_s, double re, double im_m) {
        	double t_0 = exp(re) * sin(im_m);
        	double tmp;
        	if (t_0 <= -((double) INFINITY)) {
        		tmp = im_m * fma((im_m * im_m), (im_m * (-0.0001984126984126984 * (im_m * (im_m * im_m)))), 1.0);
        	} else if (t_0 <= -0.02) {
        		tmp = sin(im_m);
        	} else if (t_0 <= 0.0) {
        		tmp = im_m * (0.008333333333333333 * ((im_m * im_m) * (im_m * im_m)));
        	} else if (t_0 <= 1.0) {
        		tmp = sin(im_m);
        	} else {
        		tmp = im_m * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
        	}
        	return im_s * tmp;
        }
        
        im\_m = abs(im)
        im\_s = copysign(1.0, im)
        function code(im_s, re, im_m)
        	t_0 = Float64(exp(re) * sin(im_m))
        	tmp = 0.0
        	if (t_0 <= Float64(-Inf))
        		tmp = Float64(im_m * fma(Float64(im_m * im_m), Float64(im_m * Float64(-0.0001984126984126984 * Float64(im_m * Float64(im_m * im_m)))), 1.0));
        	elseif (t_0 <= -0.02)
        		tmp = sin(im_m);
        	elseif (t_0 <= 0.0)
        		tmp = Float64(im_m * Float64(0.008333333333333333 * Float64(Float64(im_m * im_m) * Float64(im_m * im_m))));
        	elseif (t_0 <= 1.0)
        		tmp = sin(im_m);
        	else
        		tmp = Float64(im_m * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0));
        	end
        	return Float64(im_s * tmp)
        end
        
        im\_m = N[Abs[im], $MachinePrecision]
        im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
        code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im$95$m], $MachinePrecision]), $MachinePrecision]}, N[(im$95$s * If[LessEqual[t$95$0, (-Infinity)], N[(im$95$m * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(im$95$m * N[(-0.0001984126984126984 * N[(im$95$m * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.02], N[Sin[im$95$m], $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(im$95$m * N[(0.008333333333333333 * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.0], N[Sin[im$95$m], $MachinePrecision], N[(im$95$m * N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]
        
        \begin{array}{l}
        im\_m = \left|im\right|
        \\
        im\_s = \mathsf{copysign}\left(1, im\right)
        
        \\
        \begin{array}{l}
        t_0 := e^{re} \cdot \sin im\_m\\
        im\_s \cdot \begin{array}{l}
        \mathbf{if}\;t\_0 \leq -\infty:\\
        \;\;\;\;im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, im\_m \cdot \left(-0.0001984126984126984 \cdot \left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right)\right), 1\right)\\
        
        \mathbf{elif}\;t\_0 \leq -0.02:\\
        \;\;\;\;\sin im\_m\\
        
        \mathbf{elif}\;t\_0 \leq 0:\\
        \;\;\;\;im\_m \cdot \left(0.008333333333333333 \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(im\_m \cdot im\_m\right)\right)\right)\\
        
        \mathbf{elif}\;t\_0 \leq 1:\\
        \;\;\;\;\sin im\_m\\
        
        \mathbf{else}:\\
        \;\;\;\;im\_m \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}
        \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}{\sin im} \]
          4. Step-by-step derivation
            1. sin-lowering-sin.f642.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{-1}{5040} \cdot {im}^{4}}, 1\right) \]
          10. Step-by-step derivation
            1. metadata-evalN/A

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

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

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

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

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

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

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

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

              \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, im \cdot \left(\frac{-1}{5040} \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot im\right)\right), 1\right) \]
            10. unpow3N/A

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

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

              \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, im \cdot \color{blue}{\left(\frac{-1}{5040} \cdot {im}^{3}\right)}, 1\right) \]
            13. cube-multN/A

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

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

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

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

              \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, im \cdot \left(-0.0001984126984126984 \cdot \left(im \cdot \color{blue}{\left(im \cdot im\right)}\right)\right), 1\right) \]
          11. Simplified38.5%

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

              \[\leadsto \color{blue}{\sin im} \]
          5. Simplified97.2%

            \[\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 re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto im \cdot \left(\frac{1}{120} \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right)\right) \]
            8. *-lowering-*.f6427.0

              \[\leadsto im \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right)\right) \]
          11. Simplified27.0%

            \[\leadsto im \cdot \color{blue}{\left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \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. Simplified80.6%

              \[\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.f6462.2

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

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq -\infty:\\ \;\;\;\;im \cdot \mathsf{fma}\left(im \cdot im, im \cdot \left(-0.0001984126984126984 \cdot \left(im \cdot \left(im \cdot im\right)\right)\right), 1\right)\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq -0.02:\\ \;\;\;\;\sin im\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq 0:\\ \;\;\;\;im \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\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 5: 94.3% accurate, 0.4× speedup?

          \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := e^{re} \cdot \sin im\_m\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq -\infty:\\ \;\;\;\;im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, im\_m \cdot \left(-0.0001984126984126984 \cdot \left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right)\right), 1\right)\\ \mathbf{elif}\;t\_0 \leq 1:\\ \;\;\;\;\frac{\sin im\_m}{1 + \left(re \cdot \mathsf{fma}\left(re, 0.5, 1\right)\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), -1\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{re} \cdot im\_m\\ \end{array} \end{array} \end{array} \]
          im\_m = (fabs.f64 im)
          im\_s = (copysign.f64 #s(literal 1 binary64) im)
          (FPCore (im_s re im_m)
           :precision binary64
           (let* ((t_0 (* (exp re) (sin im_m))))
             (*
              im_s
              (if (<= t_0 (- INFINITY))
                (*
                 im_m
                 (fma
                  (* im_m im_m)
                  (* im_m (* -0.0001984126984126984 (* im_m (* im_m im_m))))
                  1.0))
                (if (<= t_0 1.0)
                  (/
                   (sin im_m)
                   (+ 1.0 (* (* re (fma re 0.5 1.0)) (fma re (fma re 0.5 1.0) -1.0))))
                  (* (exp re) im_m))))))
          im\_m = fabs(im);
          im\_s = copysign(1.0, im);
          double code(double im_s, double re, double im_m) {
          	double t_0 = exp(re) * sin(im_m);
          	double tmp;
          	if (t_0 <= -((double) INFINITY)) {
          		tmp = im_m * fma((im_m * im_m), (im_m * (-0.0001984126984126984 * (im_m * (im_m * im_m)))), 1.0);
          	} else if (t_0 <= 1.0) {
          		tmp = sin(im_m) / (1.0 + ((re * fma(re, 0.5, 1.0)) * fma(re, fma(re, 0.5, 1.0), -1.0)));
          	} else {
          		tmp = exp(re) * im_m;
          	}
          	return im_s * tmp;
          }
          
          im\_m = abs(im)
          im\_s = copysign(1.0, im)
          function code(im_s, re, im_m)
          	t_0 = Float64(exp(re) * sin(im_m))
          	tmp = 0.0
          	if (t_0 <= Float64(-Inf))
          		tmp = Float64(im_m * fma(Float64(im_m * im_m), Float64(im_m * Float64(-0.0001984126984126984 * Float64(im_m * Float64(im_m * im_m)))), 1.0));
          	elseif (t_0 <= 1.0)
          		tmp = Float64(sin(im_m) / Float64(1.0 + Float64(Float64(re * fma(re, 0.5, 1.0)) * fma(re, fma(re, 0.5, 1.0), -1.0))));
          	else
          		tmp = Float64(exp(re) * im_m);
          	end
          	return Float64(im_s * tmp)
          end
          
          im\_m = N[Abs[im], $MachinePrecision]
          im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
          code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im$95$m], $MachinePrecision]), $MachinePrecision]}, N[(im$95$s * If[LessEqual[t$95$0, (-Infinity)], N[(im$95$m * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(im$95$m * N[(-0.0001984126984126984 * N[(im$95$m * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.0], N[(N[Sin[im$95$m], $MachinePrecision] / N[(1.0 + N[(N[(re * N[(re * 0.5 + 1.0), $MachinePrecision]), $MachinePrecision] * N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Exp[re], $MachinePrecision] * im$95$m), $MachinePrecision]]]), $MachinePrecision]]
          
          \begin{array}{l}
          im\_m = \left|im\right|
          \\
          im\_s = \mathsf{copysign}\left(1, im\right)
          
          \\
          \begin{array}{l}
          t_0 := e^{re} \cdot \sin im\_m\\
          im\_s \cdot \begin{array}{l}
          \mathbf{if}\;t\_0 \leq -\infty:\\
          \;\;\;\;im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, im\_m \cdot \left(-0.0001984126984126984 \cdot \left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right)\right), 1\right)\\
          
          \mathbf{elif}\;t\_0 \leq 1:\\
          \;\;\;\;\frac{\sin im\_m}{1 + \left(re \cdot \mathsf{fma}\left(re, 0.5, 1\right)\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), -1\right)}\\
          
          \mathbf{else}:\\
          \;\;\;\;e^{re} \cdot im\_m\\
          
          
          \end{array}
          \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}{\sin im} \]
            4. Step-by-step derivation
              1. sin-lowering-sin.f642.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{-1}{5040} \cdot {im}^{4}}, 1\right) \]
            10. Step-by-step derivation
              1. metadata-evalN/A

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

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

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

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

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

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

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

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

                \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, im \cdot \left(\frac{-1}{5040} \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot im\right)\right), 1\right) \]
              10. unpow3N/A

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

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

                \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, im \cdot \color{blue}{\left(\frac{-1}{5040} \cdot {im}^{3}\right)}, 1\right) \]
              13. cube-multN/A

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

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

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

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

                \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, im \cdot \left(-0.0001984126984126984 \cdot \left(im \cdot \color{blue}{\left(im \cdot im\right)}\right)\right), 1\right) \]
            11. Simplified38.5%

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

            if -inf.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}{\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.f6473.2

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\frac{\left({\left(re \cdot \left(re \cdot \frac{1}{2} + 1\right)\right)}^{3} + {1}^{3}\right) \cdot \sin im}{1 \cdot 1 + \left(\left(re \cdot \left(re \cdot \frac{1}{2} + 1\right)\right) \cdot \left(re \cdot \left(re \cdot \frac{1}{2} + 1\right)\right) - 1 \cdot \left(re \cdot \left(re \cdot \frac{1}{2} + 1\right)\right)\right)}} \]
            7. Applied egg-rr72.8%

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

              \[\leadsto \frac{\color{blue}{\sin im}}{1 + \left(re \cdot \mathsf{fma}\left(re, \frac{1}{2}, 1\right)\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, \frac{1}{2}, 1\right), -1\right)} \]
            9. Step-by-step derivation
              1. sin-lowering-sin.f6497.2

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

              \[\leadsto \frac{\color{blue}{\sin im}}{1 + \left(re \cdot \mathsf{fma}\left(re, 0.5, 1\right)\right) \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), -1\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. Simplified80.6%

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

            Alternative 6: 55.8% accurate, 0.4× speedup?

            \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := e^{re} \cdot \sin im\_m\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq -0.02:\\ \;\;\;\;\mathsf{fma}\left(im\_m, \mathsf{fma}\left(im\_m \cdot im\_m, \left(re + 1\right) \cdot \mathsf{fma}\left(im\_m, im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), re\right), im\_m\right)\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;im\_m \cdot \left(0.008333333333333333 \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(im\_m \cdot im\_m\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(re \cdot \mathsf{fma}\left(re \cdot re, 0.25, -1\right), \frac{1}{\mathsf{fma}\left(re, 0.5, -1\right)}, 1\right) \cdot \left(im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, \mathsf{fma}\left(im\_m \cdot im\_m, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right)\\ \end{array} \end{array} \end{array} \]
            im\_m = (fabs.f64 im)
            im\_s = (copysign.f64 #s(literal 1 binary64) im)
            (FPCore (im_s re im_m)
             :precision binary64
             (let* ((t_0 (* (exp re) (sin im_m))))
               (*
                im_s
                (if (<= t_0 -0.02)
                  (fma
                   im_m
                   (fma
                    (* im_m im_m)
                    (*
                     (+ re 1.0)
                     (fma
                      im_m
                      (*
                       im_m
                       (fma (* im_m im_m) -0.0001984126984126984 0.008333333333333333))
                      -0.16666666666666666))
                    re)
                   im_m)
                  (if (<= t_0 0.0)
                    (* im_m (* 0.008333333333333333 (* (* im_m im_m) (* im_m im_m))))
                    (*
                     (fma (* re (fma (* re re) 0.25 -1.0)) (/ 1.0 (fma re 0.5 -1.0)) 1.0)
                     (*
                      im_m
                      (fma
                       (* im_m im_m)
                       (fma (* im_m im_m) 0.008333333333333333 -0.16666666666666666)
                       1.0))))))))
            im\_m = fabs(im);
            im\_s = copysign(1.0, im);
            double code(double im_s, double re, double im_m) {
            	double t_0 = exp(re) * sin(im_m);
            	double tmp;
            	if (t_0 <= -0.02) {
            		tmp = fma(im_m, fma((im_m * im_m), ((re + 1.0) * fma(im_m, (im_m * fma((im_m * im_m), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666)), re), im_m);
            	} else if (t_0 <= 0.0) {
            		tmp = im_m * (0.008333333333333333 * ((im_m * im_m) * (im_m * im_m)));
            	} else {
            		tmp = fma((re * fma((re * re), 0.25, -1.0)), (1.0 / fma(re, 0.5, -1.0)), 1.0) * (im_m * fma((im_m * im_m), fma((im_m * im_m), 0.008333333333333333, -0.16666666666666666), 1.0));
            	}
            	return im_s * tmp;
            }
            
            im\_m = abs(im)
            im\_s = copysign(1.0, im)
            function code(im_s, re, im_m)
            	t_0 = Float64(exp(re) * sin(im_m))
            	tmp = 0.0
            	if (t_0 <= -0.02)
            		tmp = fma(im_m, fma(Float64(im_m * im_m), Float64(Float64(re + 1.0) * fma(im_m, Float64(im_m * fma(Float64(im_m * im_m), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666)), re), im_m);
            	elseif (t_0 <= 0.0)
            		tmp = Float64(im_m * Float64(0.008333333333333333 * Float64(Float64(im_m * im_m) * Float64(im_m * im_m))));
            	else
            		tmp = Float64(fma(Float64(re * fma(Float64(re * re), 0.25, -1.0)), Float64(1.0 / fma(re, 0.5, -1.0)), 1.0) * Float64(im_m * fma(Float64(im_m * im_m), fma(Float64(im_m * im_m), 0.008333333333333333, -0.16666666666666666), 1.0)));
            	end
            	return Float64(im_s * tmp)
            end
            
            im\_m = N[Abs[im], $MachinePrecision]
            im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
            code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im$95$m], $MachinePrecision]), $MachinePrecision]}, N[(im$95$s * If[LessEqual[t$95$0, -0.02], N[(im$95$m * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(N[(re + 1.0), $MachinePrecision] * N[(im$95$m * N[(im$95$m * N[(N[(im$95$m * im$95$m), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + re), $MachinePrecision] + im$95$m), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(im$95$m * N[(0.008333333333333333 * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(re * N[(N[(re * re), $MachinePrecision] * 0.25 + -1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(re * 0.5 + -1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(im$95$m * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(N[(im$95$m * im$95$m), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
            
            \begin{array}{l}
            im\_m = \left|im\right|
            \\
            im\_s = \mathsf{copysign}\left(1, im\right)
            
            \\
            \begin{array}{l}
            t_0 := e^{re} \cdot \sin im\_m\\
            im\_s \cdot \begin{array}{l}
            \mathbf{if}\;t\_0 \leq -0.02:\\
            \;\;\;\;\mathsf{fma}\left(im\_m, \mathsf{fma}\left(im\_m \cdot im\_m, \left(re + 1\right) \cdot \mathsf{fma}\left(im\_m, im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), re\right), im\_m\right)\\
            
            \mathbf{elif}\;t\_0 \leq 0:\\
            \;\;\;\;im\_m \cdot \left(0.008333333333333333 \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(im\_m \cdot im\_m\right)\right)\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(re \cdot \mathsf{fma}\left(re \cdot re, 0.25, -1\right), \frac{1}{\mathsf{fma}\left(re, 0.5, -1\right)}, 1\right) \cdot \left(im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, \mathsf{fma}\left(im\_m \cdot im\_m, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right)\\
            
            
            \end{array}
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if (*.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-+.f6458.4

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

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

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

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

              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 re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto im \cdot \left(\frac{1}{120} \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right)\right) \]
                8. *-lowering-*.f6427.0

                  \[\leadsto im \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right)\right) \]
              11. Simplified27.0%

                \[\leadsto im \cdot \color{blue}{\left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \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 + \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.f6483.3

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(re \cdot re, 0.25, -1\right) \cdot re, \frac{1}{\color{blue}{\mathsf{fma}\left(re, 0.5, -1\right)}}, 1\right) \cdot \left(im \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right) \]
              10. Applied egg-rr54.5%

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

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

            Alternative 7: 55.5% accurate, 0.5× speedup?

            \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := e^{re} \cdot \sin im\_m\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq -0.02:\\ \;\;\;\;\mathsf{fma}\left(im\_m, \mathsf{fma}\left(im\_m \cdot im\_m, \left(re + 1\right) \cdot \mathsf{fma}\left(im\_m, im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), re\right), im\_m\right)\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;im\_m \cdot \left(0.008333333333333333 \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(im\_m \cdot im\_m\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \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} \end{array} \]
            im\_m = (fabs.f64 im)
            im\_s = (copysign.f64 #s(literal 1 binary64) im)
            (FPCore (im_s re im_m)
             :precision binary64
             (let* ((t_0 (* (exp re) (sin im_m))))
               (*
                im_s
                (if (<= t_0 -0.02)
                  (fma
                   im_m
                   (fma
                    (* im_m im_m)
                    (*
                     (+ re 1.0)
                     (fma
                      im_m
                      (*
                       im_m
                       (fma (* im_m im_m) -0.0001984126984126984 0.008333333333333333))
                      -0.16666666666666666))
                    re)
                   im_m)
                  (if (<= t_0 0.0)
                    (* im_m (* 0.008333333333333333 (* (* im_m im_m) (* im_m im_m))))
                    (*
                     im_m
                     (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0)))))))
            im\_m = fabs(im);
            im\_s = copysign(1.0, im);
            double code(double im_s, double re, double im_m) {
            	double t_0 = exp(re) * sin(im_m);
            	double tmp;
            	if (t_0 <= -0.02) {
            		tmp = fma(im_m, fma((im_m * im_m), ((re + 1.0) * fma(im_m, (im_m * fma((im_m * im_m), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666)), re), im_m);
            	} else if (t_0 <= 0.0) {
            		tmp = im_m * (0.008333333333333333 * ((im_m * im_m) * (im_m * im_m)));
            	} else {
            		tmp = im_m * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
            	}
            	return im_s * tmp;
            }
            
            im\_m = abs(im)
            im\_s = copysign(1.0, im)
            function code(im_s, re, im_m)
            	t_0 = Float64(exp(re) * sin(im_m))
            	tmp = 0.0
            	if (t_0 <= -0.02)
            		tmp = fma(im_m, fma(Float64(im_m * im_m), Float64(Float64(re + 1.0) * fma(im_m, Float64(im_m * fma(Float64(im_m * im_m), -0.0001984126984126984, 0.008333333333333333)), -0.16666666666666666)), re), im_m);
            	elseif (t_0 <= 0.0)
            		tmp = Float64(im_m * Float64(0.008333333333333333 * Float64(Float64(im_m * im_m) * Float64(im_m * im_m))));
            	else
            		tmp = Float64(im_m * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0));
            	end
            	return Float64(im_s * tmp)
            end
            
            im\_m = N[Abs[im], $MachinePrecision]
            im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
            code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im$95$m], $MachinePrecision]), $MachinePrecision]}, N[(im$95$s * If[LessEqual[t$95$0, -0.02], N[(im$95$m * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(N[(re + 1.0), $MachinePrecision] * N[(im$95$m * N[(im$95$m * N[(N[(im$95$m * im$95$m), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision]), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + re), $MachinePrecision] + im$95$m), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(im$95$m * N[(0.008333333333333333 * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
            
            \begin{array}{l}
            im\_m = \left|im\right|
            \\
            im\_s = \mathsf{copysign}\left(1, im\right)
            
            \\
            \begin{array}{l}
            t_0 := e^{re} \cdot \sin im\_m\\
            im\_s \cdot \begin{array}{l}
            \mathbf{if}\;t\_0 \leq -0.02:\\
            \;\;\;\;\mathsf{fma}\left(im\_m, \mathsf{fma}\left(im\_m \cdot im\_m, \left(re + 1\right) \cdot \mathsf{fma}\left(im\_m, im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), re\right), im\_m\right)\\
            
            \mathbf{elif}\;t\_0 \leq 0:\\
            \;\;\;\;im\_m \cdot \left(0.008333333333333333 \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(im\_m \cdot im\_m\right)\right)\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;im\_m \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}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if (*.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-+.f6458.4

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

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

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

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

              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 re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto im \cdot \left(\frac{1}{120} \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right)\right) \]
                8. *-lowering-*.f6427.0

                  \[\leadsto im \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right)\right) \]
              11. Simplified27.0%

                \[\leadsto im \cdot \color{blue}{\left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \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. Simplified60.0%

                  \[\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.f6454.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. Simplified54.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 3 regimes into one program.
              6. Final simplification35.7%

                \[\leadsto \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq -0.02:\\ \;\;\;\;\mathsf{fma}\left(im, \mathsf{fma}\left(im \cdot im, \left(re + 1\right) \cdot \mathsf{fma}\left(im, im \cdot \mathsf{fma}\left(im \cdot im, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), re\right), im\right)\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq 0:\\ \;\;\;\;im \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\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 8: 55.1% accurate, 0.5× speedup?

              \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := e^{re} \cdot \sin im\_m\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq -0.02:\\ \;\;\;\;im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, im\_m \cdot \left(-0.0001984126984126984 \cdot \left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right)\right), 1\right)\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;im\_m \cdot \left(0.008333333333333333 \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(im\_m \cdot im\_m\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \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} \end{array} \]
              im\_m = (fabs.f64 im)
              im\_s = (copysign.f64 #s(literal 1 binary64) im)
              (FPCore (im_s re im_m)
               :precision binary64
               (let* ((t_0 (* (exp re) (sin im_m))))
                 (*
                  im_s
                  (if (<= t_0 -0.02)
                    (*
                     im_m
                     (fma
                      (* im_m im_m)
                      (* im_m (* -0.0001984126984126984 (* im_m (* im_m im_m))))
                      1.0))
                    (if (<= t_0 0.0)
                      (* im_m (* 0.008333333333333333 (* (* im_m im_m) (* im_m im_m))))
                      (*
                       im_m
                       (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0)))))))
              im\_m = fabs(im);
              im\_s = copysign(1.0, im);
              double code(double im_s, double re, double im_m) {
              	double t_0 = exp(re) * sin(im_m);
              	double tmp;
              	if (t_0 <= -0.02) {
              		tmp = im_m * fma((im_m * im_m), (im_m * (-0.0001984126984126984 * (im_m * (im_m * im_m)))), 1.0);
              	} else if (t_0 <= 0.0) {
              		tmp = im_m * (0.008333333333333333 * ((im_m * im_m) * (im_m * im_m)));
              	} else {
              		tmp = im_m * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
              	}
              	return im_s * tmp;
              }
              
              im\_m = abs(im)
              im\_s = copysign(1.0, im)
              function code(im_s, re, im_m)
              	t_0 = Float64(exp(re) * sin(im_m))
              	tmp = 0.0
              	if (t_0 <= -0.02)
              		tmp = Float64(im_m * fma(Float64(im_m * im_m), Float64(im_m * Float64(-0.0001984126984126984 * Float64(im_m * Float64(im_m * im_m)))), 1.0));
              	elseif (t_0 <= 0.0)
              		tmp = Float64(im_m * Float64(0.008333333333333333 * Float64(Float64(im_m * im_m) * Float64(im_m * im_m))));
              	else
              		tmp = Float64(im_m * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0));
              	end
              	return Float64(im_s * tmp)
              end
              
              im\_m = N[Abs[im], $MachinePrecision]
              im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
              code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im$95$m], $MachinePrecision]), $MachinePrecision]}, N[(im$95$s * If[LessEqual[t$95$0, -0.02], N[(im$95$m * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(im$95$m * N[(-0.0001984126984126984 * N[(im$95$m * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(im$95$m * N[(0.008333333333333333 * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
              
              \begin{array}{l}
              im\_m = \left|im\right|
              \\
              im\_s = \mathsf{copysign}\left(1, im\right)
              
              \\
              \begin{array}{l}
              t_0 := e^{re} \cdot \sin im\_m\\
              im\_s \cdot \begin{array}{l}
              \mathbf{if}\;t\_0 \leq -0.02:\\
              \;\;\;\;im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, im\_m \cdot \left(-0.0001984126984126984 \cdot \left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right)\right), 1\right)\\
              
              \mathbf{elif}\;t\_0 \leq 0:\\
              \;\;\;\;im\_m \cdot \left(0.008333333333333333 \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(im\_m \cdot im\_m\right)\right)\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;im\_m \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}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if (*.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}{\sin im} \]
                4. Step-by-step derivation
                  1. sin-lowering-sin.f6455.9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{-1}{5040} \cdot {im}^{4}}, 1\right) \]
                10. Step-by-step derivation
                  1. metadata-evalN/A

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

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

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

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

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

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

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

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

                    \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, im \cdot \left(\frac{-1}{5040} \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot im\right)\right), 1\right) \]
                  10. unpow3N/A

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

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

                    \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, im \cdot \color{blue}{\left(\frac{-1}{5040} \cdot {im}^{3}\right)}, 1\right) \]
                  13. cube-multN/A

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

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

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

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

                    \[\leadsto im \cdot \mathsf{fma}\left(im \cdot im, im \cdot \left(-0.0001984126984126984 \cdot \left(im \cdot \color{blue}{\left(im \cdot im\right)}\right)\right), 1\right) \]
                11. Simplified18.2%

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

                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 re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto im \cdot \left(\frac{1}{120} \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right)\right) \]
                  8. *-lowering-*.f6427.0

                    \[\leadsto im \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right)\right) \]
                11. Simplified27.0%

                  \[\leadsto im \cdot \color{blue}{\left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \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. Simplified60.0%

                    \[\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.f6454.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. Simplified54.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 3 regimes into one program.
                6. Final simplification35.4%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq -0.02:\\ \;\;\;\;im \cdot \mathsf{fma}\left(im \cdot im, im \cdot \left(-0.0001984126984126984 \cdot \left(im \cdot \left(im \cdot im\right)\right)\right), 1\right)\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq 0:\\ \;\;\;\;im \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\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 9: 55.6% accurate, 0.5× speedup?

                \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := e^{re} \cdot \sin im\_m\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq -0.02:\\ \;\;\;\;im\_m \cdot \left(\mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right) \cdot \mathsf{fma}\left(im\_m, im\_m \cdot -0.16666666666666666, 1\right)\right)\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;im\_m \cdot \left(0.008333333333333333 \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(im\_m \cdot im\_m\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \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} \end{array} \]
                im\_m = (fabs.f64 im)
                im\_s = (copysign.f64 #s(literal 1 binary64) im)
                (FPCore (im_s re im_m)
                 :precision binary64
                 (let* ((t_0 (* (exp re) (sin im_m))))
                   (*
                    im_s
                    (if (<= t_0 -0.02)
                      (*
                       im_m
                       (*
                        (fma re (fma re 0.5 1.0) 1.0)
                        (fma im_m (* im_m -0.16666666666666666) 1.0)))
                      (if (<= t_0 0.0)
                        (* im_m (* 0.008333333333333333 (* (* im_m im_m) (* im_m im_m))))
                        (*
                         im_m
                         (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0)))))))
                im\_m = fabs(im);
                im\_s = copysign(1.0, im);
                double code(double im_s, double re, double im_m) {
                	double t_0 = exp(re) * sin(im_m);
                	double tmp;
                	if (t_0 <= -0.02) {
                		tmp = im_m * (fma(re, fma(re, 0.5, 1.0), 1.0) * fma(im_m, (im_m * -0.16666666666666666), 1.0));
                	} else if (t_0 <= 0.0) {
                		tmp = im_m * (0.008333333333333333 * ((im_m * im_m) * (im_m * im_m)));
                	} else {
                		tmp = im_m * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
                	}
                	return im_s * tmp;
                }
                
                im\_m = abs(im)
                im\_s = copysign(1.0, im)
                function code(im_s, re, im_m)
                	t_0 = Float64(exp(re) * sin(im_m))
                	tmp = 0.0
                	if (t_0 <= -0.02)
                		tmp = Float64(im_m * Float64(fma(re, fma(re, 0.5, 1.0), 1.0) * fma(im_m, Float64(im_m * -0.16666666666666666), 1.0)));
                	elseif (t_0 <= 0.0)
                		tmp = Float64(im_m * Float64(0.008333333333333333 * Float64(Float64(im_m * im_m) * Float64(im_m * im_m))));
                	else
                		tmp = Float64(im_m * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0));
                	end
                	return Float64(im_s * tmp)
                end
                
                im\_m = N[Abs[im], $MachinePrecision]
                im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im$95$m], $MachinePrecision]), $MachinePrecision]}, N[(im$95$s * If[LessEqual[t$95$0, -0.02], N[(im$95$m * N[(N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision] * N[(im$95$m * N[(im$95$m * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(im$95$m * N[(0.008333333333333333 * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
                
                \begin{array}{l}
                im\_m = \left|im\right|
                \\
                im\_s = \mathsf{copysign}\left(1, im\right)
                
                \\
                \begin{array}{l}
                t_0 := e^{re} \cdot \sin im\_m\\
                im\_s \cdot \begin{array}{l}
                \mathbf{if}\;t\_0 \leq -0.02:\\
                \;\;\;\;im\_m \cdot \left(\mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right) \cdot \mathsf{fma}\left(im\_m, im\_m \cdot -0.16666666666666666, 1\right)\right)\\
                
                \mathbf{elif}\;t\_0 \leq 0:\\
                \;\;\;\;im\_m \cdot \left(0.008333333333333333 \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(im\_m \cdot im\_m\right)\right)\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;im\_m \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}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if (*.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.f6483.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if -0.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 re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto im \cdot \left(\frac{1}{120} \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right)\right) \]
                    8. *-lowering-*.f6427.0

                      \[\leadsto im \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right)\right) \]
                  11. Simplified27.0%

                    \[\leadsto im \cdot \color{blue}{\left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \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. Simplified60.0%

                      \[\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.f6454.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. Simplified54.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 3 regimes into one program.
                  6. Final simplification37.4%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq -0.02:\\ \;\;\;\;im \cdot \left(\mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right) \cdot \mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right)\right)\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq 0:\\ \;\;\;\;im \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\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: 55.0% accurate, 0.5× speedup?

                  \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := e^{re} \cdot \sin im\_m\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq -0.02:\\ \;\;\;\;\mathsf{fma}\left(im\_m, im\_m \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, im\_m, im\_m\right)\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;im\_m \cdot \left(0.008333333333333333 \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(im\_m \cdot im\_m\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \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} \end{array} \]
                  im\_m = (fabs.f64 im)
                  im\_s = (copysign.f64 #s(literal 1 binary64) im)
                  (FPCore (im_s re im_m)
                   :precision binary64
                   (let* ((t_0 (* (exp re) (sin im_m))))
                     (*
                      im_s
                      (if (<= t_0 -0.02)
                        (* (fma im_m (* im_m -0.16666666666666666) 1.0) (fma re im_m im_m))
                        (if (<= t_0 0.0)
                          (* im_m (* 0.008333333333333333 (* (* im_m im_m) (* im_m im_m))))
                          (*
                           im_m
                           (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0)))))))
                  im\_m = fabs(im);
                  im\_s = copysign(1.0, im);
                  double code(double im_s, double re, double im_m) {
                  	double t_0 = exp(re) * sin(im_m);
                  	double tmp;
                  	if (t_0 <= -0.02) {
                  		tmp = fma(im_m, (im_m * -0.16666666666666666), 1.0) * fma(re, im_m, im_m);
                  	} else if (t_0 <= 0.0) {
                  		tmp = im_m * (0.008333333333333333 * ((im_m * im_m) * (im_m * im_m)));
                  	} else {
                  		tmp = im_m * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
                  	}
                  	return im_s * tmp;
                  }
                  
                  im\_m = abs(im)
                  im\_s = copysign(1.0, im)
                  function code(im_s, re, im_m)
                  	t_0 = Float64(exp(re) * sin(im_m))
                  	tmp = 0.0
                  	if (t_0 <= -0.02)
                  		tmp = Float64(fma(im_m, Float64(im_m * -0.16666666666666666), 1.0) * fma(re, im_m, im_m));
                  	elseif (t_0 <= 0.0)
                  		tmp = Float64(im_m * Float64(0.008333333333333333 * Float64(Float64(im_m * im_m) * Float64(im_m * im_m))));
                  	else
                  		tmp = Float64(im_m * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0));
                  	end
                  	return Float64(im_s * tmp)
                  end
                  
                  im\_m = N[Abs[im], $MachinePrecision]
                  im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                  code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im$95$m], $MachinePrecision]), $MachinePrecision]}, N[(im$95$s * If[LessEqual[t$95$0, -0.02], N[(N[(im$95$m * N[(im$95$m * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(re * im$95$m + im$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(im$95$m * N[(0.008333333333333333 * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  im\_m = \left|im\right|
                  \\
                  im\_s = \mathsf{copysign}\left(1, im\right)
                  
                  \\
                  \begin{array}{l}
                  t_0 := e^{re} \cdot \sin im\_m\\
                  im\_s \cdot \begin{array}{l}
                  \mathbf{if}\;t\_0 \leq -0.02:\\
                  \;\;\;\;\mathsf{fma}\left(im\_m, im\_m \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, im\_m, im\_m\right)\\
                  
                  \mathbf{elif}\;t\_0 \leq 0:\\
                  \;\;\;\;im\_m \cdot \left(0.008333333333333333 \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(im\_m \cdot im\_m\right)\right)\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;im\_m \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}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if (*.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-+.f6458.4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    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 re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto im \cdot \left(\frac{1}{120} \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right)\right) \]
                      8. *-lowering-*.f6427.0

                        \[\leadsto im \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right)\right) \]
                    11. Simplified27.0%

                      \[\leadsto im \cdot \color{blue}{\left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \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. Simplified60.0%

                        \[\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.f6454.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. Simplified54.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 3 regimes into one program.
                    6. Final simplification35.2%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq -0.02:\\ \;\;\;\;\mathsf{fma}\left(im, im \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, im, im\right)\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq 0:\\ \;\;\;\;im \cdot \left(0.008333333333333333 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\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 11: 45.2% accurate, 0.9× speedup?

                    \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im\_m \leq 0.04:\\ \;\;\;\;\mathsf{fma}\left(im\_m, im\_m \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, im\_m, im\_m\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \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} \]
                    im\_m = (fabs.f64 im)
                    im\_s = (copysign.f64 #s(literal 1 binary64) im)
                    (FPCore (im_s re im_m)
                     :precision binary64
                     (*
                      im_s
                      (if (<= (* (exp re) (sin im_m)) 0.04)
                        (* (fma im_m (* im_m -0.16666666666666666) 1.0) (fma re im_m im_m))
                        (* im_m (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0)))))
                    im\_m = fabs(im);
                    im\_s = copysign(1.0, im);
                    double code(double im_s, double re, double im_m) {
                    	double tmp;
                    	if ((exp(re) * sin(im_m)) <= 0.04) {
                    		tmp = fma(im_m, (im_m * -0.16666666666666666), 1.0) * fma(re, im_m, im_m);
                    	} else {
                    		tmp = im_m * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
                    	}
                    	return im_s * tmp;
                    }
                    
                    im\_m = abs(im)
                    im\_s = copysign(1.0, im)
                    function code(im_s, re, im_m)
                    	tmp = 0.0
                    	if (Float64(exp(re) * sin(im_m)) <= 0.04)
                    		tmp = Float64(fma(im_m, Float64(im_m * -0.16666666666666666), 1.0) * fma(re, im_m, im_m));
                    	else
                    		tmp = Float64(im_m * fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0));
                    	end
                    	return Float64(im_s * tmp)
                    end
                    
                    im\_m = N[Abs[im], $MachinePrecision]
                    im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                    code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im$95$m], $MachinePrecision]), $MachinePrecision], 0.04], N[(N[(im$95$m * N[(im$95$m * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(re * im$95$m + im$95$m), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                    
                    \begin{array}{l}
                    im\_m = \left|im\right|
                    \\
                    im\_s = \mathsf{copysign}\left(1, im\right)
                    
                    \\
                    im\_s \cdot \begin{array}{l}
                    \mathbf{if}\;e^{re} \cdot \sin im\_m \leq 0.04:\\
                    \;\;\;\;\mathsf{fma}\left(im\_m, im\_m \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, im\_m, im\_m\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;im\_m \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.0400000000000000008

                      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-+.f6460.1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 0.0400000000000000008 < (*.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. Simplified41.0%

                          \[\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.f6431.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 im \]
                        4. Simplified31.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 im \]
                      5. Recombined 2 regimes into one program.
                      6. Final simplification43.8%

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

                      Alternative 12: 45.1% accurate, 0.9× speedup?

                      \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im\_m \leq 0.04:\\ \;\;\;\;\mathsf{fma}\left(im\_m, im\_m \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, im\_m, im\_m\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \cdot \left(re \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right)\right)\\ \end{array} \end{array} \]
                      im\_m = (fabs.f64 im)
                      im\_s = (copysign.f64 #s(literal 1 binary64) im)
                      (FPCore (im_s re im_m)
                       :precision binary64
                       (*
                        im_s
                        (if (<= (* (exp re) (sin im_m)) 0.04)
                          (* (fma im_m (* im_m -0.16666666666666666) 1.0) (fma re im_m im_m))
                          (* im_m (* re (fma re (fma re 0.16666666666666666 0.5) 1.0))))))
                      im\_m = fabs(im);
                      im\_s = copysign(1.0, im);
                      double code(double im_s, double re, double im_m) {
                      	double tmp;
                      	if ((exp(re) * sin(im_m)) <= 0.04) {
                      		tmp = fma(im_m, (im_m * -0.16666666666666666), 1.0) * fma(re, im_m, im_m);
                      	} else {
                      		tmp = im_m * (re * fma(re, fma(re, 0.16666666666666666, 0.5), 1.0));
                      	}
                      	return im_s * tmp;
                      }
                      
                      im\_m = abs(im)
                      im\_s = copysign(1.0, im)
                      function code(im_s, re, im_m)
                      	tmp = 0.0
                      	if (Float64(exp(re) * sin(im_m)) <= 0.04)
                      		tmp = Float64(fma(im_m, Float64(im_m * -0.16666666666666666), 1.0) * fma(re, im_m, im_m));
                      	else
                      		tmp = Float64(im_m * Float64(re * fma(re, fma(re, 0.16666666666666666, 0.5), 1.0)));
                      	end
                      	return Float64(im_s * tmp)
                      end
                      
                      im\_m = N[Abs[im], $MachinePrecision]
                      im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                      code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im$95$m], $MachinePrecision]), $MachinePrecision], 0.04], N[(N[(im$95$m * N[(im$95$m * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(re * im$95$m + im$95$m), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                      
                      \begin{array}{l}
                      im\_m = \left|im\right|
                      \\
                      im\_s = \mathsf{copysign}\left(1, im\right)
                      
                      \\
                      im\_s \cdot \begin{array}{l}
                      \mathbf{if}\;e^{re} \cdot \sin im\_m \leq 0.04:\\
                      \;\;\;\;\mathsf{fma}\left(im\_m, im\_m \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(re, im\_m, im\_m\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;im\_m \cdot \left(re \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right)\right)\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0400000000000000008

                        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-+.f6460.1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 0.0400000000000000008 < (*.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. Simplified41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        Alternative 13: 44.1% accurate, 0.9× speedup?

                        \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im\_m \leq 0.04:\\ \;\;\;\;im\_m \cdot \mathsf{fma}\left(im\_m, im\_m \cdot -0.16666666666666666, 1\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \cdot \left(re \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right)\right)\\ \end{array} \end{array} \]
                        im\_m = (fabs.f64 im)
                        im\_s = (copysign.f64 #s(literal 1 binary64) im)
                        (FPCore (im_s re im_m)
                         :precision binary64
                         (*
                          im_s
                          (if (<= (* (exp re) (sin im_m)) 0.04)
                            (* im_m (fma im_m (* im_m -0.16666666666666666) 1.0))
                            (* im_m (* re (fma re (fma re 0.16666666666666666 0.5) 1.0))))))
                        im\_m = fabs(im);
                        im\_s = copysign(1.0, im);
                        double code(double im_s, double re, double im_m) {
                        	double tmp;
                        	if ((exp(re) * sin(im_m)) <= 0.04) {
                        		tmp = im_m * fma(im_m, (im_m * -0.16666666666666666), 1.0);
                        	} else {
                        		tmp = im_m * (re * fma(re, fma(re, 0.16666666666666666, 0.5), 1.0));
                        	}
                        	return im_s * tmp;
                        }
                        
                        im\_m = abs(im)
                        im\_s = copysign(1.0, im)
                        function code(im_s, re, im_m)
                        	tmp = 0.0
                        	if (Float64(exp(re) * sin(im_m)) <= 0.04)
                        		tmp = Float64(im_m * fma(im_m, Float64(im_m * -0.16666666666666666), 1.0));
                        	else
                        		tmp = Float64(im_m * Float64(re * fma(re, fma(re, 0.16666666666666666, 0.5), 1.0)));
                        	end
                        	return Float64(im_s * tmp)
                        end
                        
                        im\_m = N[Abs[im], $MachinePrecision]
                        im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                        code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im$95$m], $MachinePrecision]), $MachinePrecision], 0.04], N[(im$95$m * N[(im$95$m * N[(im$95$m * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                        
                        \begin{array}{l}
                        im\_m = \left|im\right|
                        \\
                        im\_s = \mathsf{copysign}\left(1, im\right)
                        
                        \\
                        im\_s \cdot \begin{array}{l}
                        \mathbf{if}\;e^{re} \cdot \sin im\_m \leq 0.04:\\
                        \;\;\;\;im\_m \cdot \mathsf{fma}\left(im\_m, im\_m \cdot -0.16666666666666666, 1\right)\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;im\_m \cdot \left(re \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right)\right)\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0400000000000000008

                          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                          if 0.0400000000000000008 < (*.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. Simplified41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          Alternative 14: 42.8% accurate, 0.9× speedup?

                          \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im\_m \leq 0.04:\\ \;\;\;\;im\_m \cdot \mathsf{fma}\left(im\_m, im\_m \cdot -0.16666666666666666, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot re\right) \cdot \left(im\_m \cdot \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right)\right)\\ \end{array} \end{array} \]
                          im\_m = (fabs.f64 im)
                          im\_s = (copysign.f64 #s(literal 1 binary64) im)
                          (FPCore (im_s re im_m)
                           :precision binary64
                           (*
                            im_s
                            (if (<= (* (exp re) (sin im_m)) 0.04)
                              (* im_m (fma im_m (* im_m -0.16666666666666666) 1.0))
                              (* (* re re) (* im_m (fma re 0.16666666666666666 0.5))))))
                          im\_m = fabs(im);
                          im\_s = copysign(1.0, im);
                          double code(double im_s, double re, double im_m) {
                          	double tmp;
                          	if ((exp(re) * sin(im_m)) <= 0.04) {
                          		tmp = im_m * fma(im_m, (im_m * -0.16666666666666666), 1.0);
                          	} else {
                          		tmp = (re * re) * (im_m * fma(re, 0.16666666666666666, 0.5));
                          	}
                          	return im_s * tmp;
                          }
                          
                          im\_m = abs(im)
                          im\_s = copysign(1.0, im)
                          function code(im_s, re, im_m)
                          	tmp = 0.0
                          	if (Float64(exp(re) * sin(im_m)) <= 0.04)
                          		tmp = Float64(im_m * fma(im_m, Float64(im_m * -0.16666666666666666), 1.0));
                          	else
                          		tmp = Float64(Float64(re * re) * Float64(im_m * fma(re, 0.16666666666666666, 0.5)));
                          	end
                          	return Float64(im_s * tmp)
                          end
                          
                          im\_m = N[Abs[im], $MachinePrecision]
                          im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                          code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im$95$m], $MachinePrecision]), $MachinePrecision], 0.04], N[(im$95$m * N[(im$95$m * N[(im$95$m * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(re * re), $MachinePrecision] * N[(im$95$m * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                          
                          \begin{array}{l}
                          im\_m = \left|im\right|
                          \\
                          im\_s = \mathsf{copysign}\left(1, im\right)
                          
                          \\
                          im\_s \cdot \begin{array}{l}
                          \mathbf{if}\;e^{re} \cdot \sin im\_m \leq 0.04:\\
                          \;\;\;\;im\_m \cdot \mathsf{fma}\left(im\_m, im\_m \cdot -0.16666666666666666, 1\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\left(re \cdot re\right) \cdot \left(im\_m \cdot \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right)\right)\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0400000000000000008

                            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                            if 0.0400000000000000008 < (*.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. Simplified41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            Alternative 15: 42.7% accurate, 0.9× speedup?

                            \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im\_m \leq 0.04:\\ \;\;\;\;im\_m \cdot \mathsf{fma}\left(im\_m, im\_m \cdot -0.16666666666666666, 1\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(im\_m \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right)\\ \end{array} \end{array} \]
                            im\_m = (fabs.f64 im)
                            im\_s = (copysign.f64 #s(literal 1 binary64) im)
                            (FPCore (im_s re im_m)
                             :precision binary64
                             (*
                              im_s
                              (if (<= (* (exp re) (sin im_m)) 0.04)
                                (* im_m (fma im_m (* im_m -0.16666666666666666) 1.0))
                                (* re (* im_m (* 0.16666666666666666 (* re re)))))))
                            im\_m = fabs(im);
                            im\_s = copysign(1.0, im);
                            double code(double im_s, double re, double im_m) {
                            	double tmp;
                            	if ((exp(re) * sin(im_m)) <= 0.04) {
                            		tmp = im_m * fma(im_m, (im_m * -0.16666666666666666), 1.0);
                            	} else {
                            		tmp = re * (im_m * (0.16666666666666666 * (re * re)));
                            	}
                            	return im_s * tmp;
                            }
                            
                            im\_m = abs(im)
                            im\_s = copysign(1.0, im)
                            function code(im_s, re, im_m)
                            	tmp = 0.0
                            	if (Float64(exp(re) * sin(im_m)) <= 0.04)
                            		tmp = Float64(im_m * fma(im_m, Float64(im_m * -0.16666666666666666), 1.0));
                            	else
                            		tmp = Float64(re * Float64(im_m * Float64(0.16666666666666666 * Float64(re * re))));
                            	end
                            	return Float64(im_s * tmp)
                            end
                            
                            im\_m = N[Abs[im], $MachinePrecision]
                            im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                            code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im$95$m], $MachinePrecision]), $MachinePrecision], 0.04], N[(im$95$m * N[(im$95$m * N[(im$95$m * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(re * N[(im$95$m * N[(0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                            
                            \begin{array}{l}
                            im\_m = \left|im\right|
                            \\
                            im\_s = \mathsf{copysign}\left(1, im\right)
                            
                            \\
                            im\_s \cdot \begin{array}{l}
                            \mathbf{if}\;e^{re} \cdot \sin im\_m \leq 0.04:\\
                            \;\;\;\;im\_m \cdot \mathsf{fma}\left(im\_m, im\_m \cdot -0.16666666666666666, 1\right)\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;re \cdot \left(im\_m \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0400000000000000008

                              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                              if 0.0400000000000000008 < (*.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. Simplified41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto re \cdot \left(im \cdot \left(\color{blue}{\left(re \cdot re\right)} \cdot \frac{1}{6}\right)\right) \]
                                  20. *-lowering-*.f6428.3

                                    \[\leadsto re \cdot \left(im \cdot \left(\color{blue}{\left(re \cdot re\right)} \cdot 0.16666666666666666\right)\right) \]
                                7. Simplified28.3%

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

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

                              Alternative 16: 42.3% accurate, 0.9× speedup?

                              \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im\_m \leq 0:\\ \;\;\;\;im\_m \cdot \mathsf{fma}\left(im\_m, im\_m \cdot -0.16666666666666666, 1\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\\ \end{array} \end{array} \]
                              im\_m = (fabs.f64 im)
                              im\_s = (copysign.f64 #s(literal 1 binary64) im)
                              (FPCore (im_s re im_m)
                               :precision binary64
                               (*
                                im_s
                                (if (<= (* (exp re) (sin im_m)) 0.0)
                                  (* im_m (fma im_m (* im_m -0.16666666666666666) 1.0))
                                  (* im_m (fma re (fma re 0.5 1.0) 1.0)))))
                              im\_m = fabs(im);
                              im\_s = copysign(1.0, im);
                              double code(double im_s, double re, double im_m) {
                              	double tmp;
                              	if ((exp(re) * sin(im_m)) <= 0.0) {
                              		tmp = im_m * fma(im_m, (im_m * -0.16666666666666666), 1.0);
                              	} else {
                              		tmp = im_m * fma(re, fma(re, 0.5, 1.0), 1.0);
                              	}
                              	return im_s * tmp;
                              }
                              
                              im\_m = abs(im)
                              im\_s = copysign(1.0, im)
                              function code(im_s, re, im_m)
                              	tmp = 0.0
                              	if (Float64(exp(re) * sin(im_m)) <= 0.0)
                              		tmp = Float64(im_m * fma(im_m, Float64(im_m * -0.16666666666666666), 1.0));
                              	else
                              		tmp = Float64(im_m * fma(re, fma(re, 0.5, 1.0), 1.0));
                              	end
                              	return Float64(im_s * tmp)
                              end
                              
                              im\_m = N[Abs[im], $MachinePrecision]
                              im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                              code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im$95$m], $MachinePrecision]), $MachinePrecision], 0.0], N[(im$95$m * N[(im$95$m * N[(im$95$m * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(re * N[(re * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                              
                              \begin{array}{l}
                              im\_m = \left|im\right|
                              \\
                              im\_s = \mathsf{copysign}\left(1, im\right)
                              
                              \\
                              im\_s \cdot \begin{array}{l}
                              \mathbf{if}\;e^{re} \cdot \sin im\_m \leq 0:\\
                              \;\;\;\;im\_m \cdot \mathsf{fma}\left(im\_m, im\_m \cdot -0.16666666666666666, 1\right)\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;im\_m \cdot \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.5, 1\right), 1\right)\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0

                                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

                                Alternative 17: 41.9% accurate, 0.9× speedup?

                                \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im\_m \leq 0.04:\\ \;\;\;\;im\_m \cdot \mathsf{fma}\left(im\_m, im\_m \cdot -0.16666666666666666, 1\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \cdot \left(0.5 \cdot \left(re \cdot re\right)\right)\\ \end{array} \end{array} \]
                                im\_m = (fabs.f64 im)
                                im\_s = (copysign.f64 #s(literal 1 binary64) im)
                                (FPCore (im_s re im_m)
                                 :precision binary64
                                 (*
                                  im_s
                                  (if (<= (* (exp re) (sin im_m)) 0.04)
                                    (* im_m (fma im_m (* im_m -0.16666666666666666) 1.0))
                                    (* im_m (* 0.5 (* re re))))))
                                im\_m = fabs(im);
                                im\_s = copysign(1.0, im);
                                double code(double im_s, double re, double im_m) {
                                	double tmp;
                                	if ((exp(re) * sin(im_m)) <= 0.04) {
                                		tmp = im_m * fma(im_m, (im_m * -0.16666666666666666), 1.0);
                                	} else {
                                		tmp = im_m * (0.5 * (re * re));
                                	}
                                	return im_s * tmp;
                                }
                                
                                im\_m = abs(im)
                                im\_s = copysign(1.0, im)
                                function code(im_s, re, im_m)
                                	tmp = 0.0
                                	if (Float64(exp(re) * sin(im_m)) <= 0.04)
                                		tmp = Float64(im_m * fma(im_m, Float64(im_m * -0.16666666666666666), 1.0));
                                	else
                                		tmp = Float64(im_m * Float64(0.5 * Float64(re * re)));
                                	end
                                	return Float64(im_s * tmp)
                                end
                                
                                im\_m = N[Abs[im], $MachinePrecision]
                                im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im$95$m], $MachinePrecision]), $MachinePrecision], 0.04], N[(im$95$m * N[(im$95$m * N[(im$95$m * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                                
                                \begin{array}{l}
                                im\_m = \left|im\right|
                                \\
                                im\_s = \mathsf{copysign}\left(1, im\right)
                                
                                \\
                                im\_s \cdot \begin{array}{l}
                                \mathbf{if}\;e^{re} \cdot \sin im\_m \leq 0.04:\\
                                \;\;\;\;im\_m \cdot \mathsf{fma}\left(im\_m, im\_m \cdot -0.16666666666666666, 1\right)\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;im\_m \cdot \left(0.5 \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)) < 0.0400000000000000008

                                  1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  if 0.0400000000000000008 < (*.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. Simplified41.0%

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \left(0.5 \cdot \color{blue}{\left(re \cdot re\right)}\right) \cdot im \]
                                    7. Simplified24.7%

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

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

                                  Alternative 18: 37.2% accurate, 0.9× speedup?

                                  \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im\_m \leq 0.45:\\ \;\;\;\;im\_m\\ \mathbf{else}:\\ \;\;\;\;im\_m \cdot \left(0.5 \cdot \left(re \cdot re\right)\right)\\ \end{array} \end{array} \]
                                  im\_m = (fabs.f64 im)
                                  im\_s = (copysign.f64 #s(literal 1 binary64) im)
                                  (FPCore (im_s re im_m)
                                   :precision binary64
                                   (*
                                    im_s
                                    (if (<= (* (exp re) (sin im_m)) 0.45) im_m (* im_m (* 0.5 (* re re))))))
                                  im\_m = fabs(im);
                                  im\_s = copysign(1.0, im);
                                  double code(double im_s, double re, double im_m) {
                                  	double tmp;
                                  	if ((exp(re) * sin(im_m)) <= 0.45) {
                                  		tmp = im_m;
                                  	} else {
                                  		tmp = im_m * (0.5 * (re * re));
                                  	}
                                  	return im_s * tmp;
                                  }
                                  
                                  im\_m = abs(im)
                                  im\_s = copysign(1.0d0, im)
                                  real(8) function code(im_s, re, im_m)
                                      real(8), intent (in) :: im_s
                                      real(8), intent (in) :: re
                                      real(8), intent (in) :: im_m
                                      real(8) :: tmp
                                      if ((exp(re) * sin(im_m)) <= 0.45d0) then
                                          tmp = im_m
                                      else
                                          tmp = im_m * (0.5d0 * (re * re))
                                      end if
                                      code = im_s * tmp
                                  end function
                                  
                                  im\_m = Math.abs(im);
                                  im\_s = Math.copySign(1.0, im);
                                  public static double code(double im_s, double re, double im_m) {
                                  	double tmp;
                                  	if ((Math.exp(re) * Math.sin(im_m)) <= 0.45) {
                                  		tmp = im_m;
                                  	} else {
                                  		tmp = im_m * (0.5 * (re * re));
                                  	}
                                  	return im_s * tmp;
                                  }
                                  
                                  im\_m = math.fabs(im)
                                  im\_s = math.copysign(1.0, im)
                                  def code(im_s, re, im_m):
                                  	tmp = 0
                                  	if (math.exp(re) * math.sin(im_m)) <= 0.45:
                                  		tmp = im_m
                                  	else:
                                  		tmp = im_m * (0.5 * (re * re))
                                  	return im_s * tmp
                                  
                                  im\_m = abs(im)
                                  im\_s = copysign(1.0, im)
                                  function code(im_s, re, im_m)
                                  	tmp = 0.0
                                  	if (Float64(exp(re) * sin(im_m)) <= 0.45)
                                  		tmp = im_m;
                                  	else
                                  		tmp = Float64(im_m * Float64(0.5 * Float64(re * re)));
                                  	end
                                  	return Float64(im_s * tmp)
                                  end
                                  
                                  im\_m = abs(im);
                                  im\_s = sign(im) * abs(1.0);
                                  function tmp_2 = code(im_s, re, im_m)
                                  	tmp = 0.0;
                                  	if ((exp(re) * sin(im_m)) <= 0.45)
                                  		tmp = im_m;
                                  	else
                                  		tmp = im_m * (0.5 * (re * re));
                                  	end
                                  	tmp_2 = im_s * tmp;
                                  end
                                  
                                  im\_m = N[Abs[im], $MachinePrecision]
                                  im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                  code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im$95$m], $MachinePrecision]), $MachinePrecision], 0.45], im$95$m, N[(im$95$m * N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                                  
                                  \begin{array}{l}
                                  im\_m = \left|im\right|
                                  \\
                                  im\_s = \mathsf{copysign}\left(1, im\right)
                                  
                                  \\
                                  im\_s \cdot \begin{array}{l}
                                  \mathbf{if}\;e^{re} \cdot \sin im\_m \leq 0.45:\\
                                  \;\;\;\;im\_m\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;im\_m \cdot \left(0.5 \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)) < 0.450000000000000011

                                    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. Simplified74.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. Simplified41.4%

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

                                        if 0.450000000000000011 < (*.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. Simplified48.3%

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \left(0.5 \cdot \color{blue}{\left(re \cdot re\right)}\right) \cdot im \]
                                          7. Simplified28.7%

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

                                          \[\leadsto \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 0.45:\\ \;\;\;\;im\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(0.5 \cdot \left(re \cdot re\right)\right)\\ \end{array} \]
                                        7. Add Preprocessing

                                        Alternative 19: 34.4% accurate, 0.9× speedup?

                                        \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im\_m \leq 0.45:\\ \;\;\;\;im\_m\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(0.5 \cdot \left(re \cdot im\_m\right)\right)\\ \end{array} \end{array} \]
                                        im\_m = (fabs.f64 im)
                                        im\_s = (copysign.f64 #s(literal 1 binary64) im)
                                        (FPCore (im_s re im_m)
                                         :precision binary64
                                         (*
                                          im_s
                                          (if (<= (* (exp re) (sin im_m)) 0.45) im_m (* re (* 0.5 (* re im_m))))))
                                        im\_m = fabs(im);
                                        im\_s = copysign(1.0, im);
                                        double code(double im_s, double re, double im_m) {
                                        	double tmp;
                                        	if ((exp(re) * sin(im_m)) <= 0.45) {
                                        		tmp = im_m;
                                        	} else {
                                        		tmp = re * (0.5 * (re * im_m));
                                        	}
                                        	return im_s * tmp;
                                        }
                                        
                                        im\_m = abs(im)
                                        im\_s = copysign(1.0d0, im)
                                        real(8) function code(im_s, re, im_m)
                                            real(8), intent (in) :: im_s
                                            real(8), intent (in) :: re
                                            real(8), intent (in) :: im_m
                                            real(8) :: tmp
                                            if ((exp(re) * sin(im_m)) <= 0.45d0) then
                                                tmp = im_m
                                            else
                                                tmp = re * (0.5d0 * (re * im_m))
                                            end if
                                            code = im_s * tmp
                                        end function
                                        
                                        im\_m = Math.abs(im);
                                        im\_s = Math.copySign(1.0, im);
                                        public static double code(double im_s, double re, double im_m) {
                                        	double tmp;
                                        	if ((Math.exp(re) * Math.sin(im_m)) <= 0.45) {
                                        		tmp = im_m;
                                        	} else {
                                        		tmp = re * (0.5 * (re * im_m));
                                        	}
                                        	return im_s * tmp;
                                        }
                                        
                                        im\_m = math.fabs(im)
                                        im\_s = math.copysign(1.0, im)
                                        def code(im_s, re, im_m):
                                        	tmp = 0
                                        	if (math.exp(re) * math.sin(im_m)) <= 0.45:
                                        		tmp = im_m
                                        	else:
                                        		tmp = re * (0.5 * (re * im_m))
                                        	return im_s * tmp
                                        
                                        im\_m = abs(im)
                                        im\_s = copysign(1.0, im)
                                        function code(im_s, re, im_m)
                                        	tmp = 0.0
                                        	if (Float64(exp(re) * sin(im_m)) <= 0.45)
                                        		tmp = im_m;
                                        	else
                                        		tmp = Float64(re * Float64(0.5 * Float64(re * im_m)));
                                        	end
                                        	return Float64(im_s * tmp)
                                        end
                                        
                                        im\_m = abs(im);
                                        im\_s = sign(im) * abs(1.0);
                                        function tmp_2 = code(im_s, re, im_m)
                                        	tmp = 0.0;
                                        	if ((exp(re) * sin(im_m)) <= 0.45)
                                        		tmp = im_m;
                                        	else
                                        		tmp = re * (0.5 * (re * im_m));
                                        	end
                                        	tmp_2 = im_s * tmp;
                                        end
                                        
                                        im\_m = N[Abs[im], $MachinePrecision]
                                        im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                        code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im$95$m], $MachinePrecision]), $MachinePrecision], 0.45], im$95$m, N[(re * N[(0.5 * N[(re * im$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                                        
                                        \begin{array}{l}
                                        im\_m = \left|im\right|
                                        \\
                                        im\_s = \mathsf{copysign}\left(1, im\right)
                                        
                                        \\
                                        im\_s \cdot \begin{array}{l}
                                        \mathbf{if}\;e^{re} \cdot \sin im\_m \leq 0.45:\\
                                        \;\;\;\;im\_m\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;re \cdot \left(0.5 \cdot \left(re \cdot im\_m\right)\right)\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 2 regimes
                                        2. if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.450000000000000011

                                          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. Simplified74.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. Simplified41.4%

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

                                              if 0.450000000000000011 < (*.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. Simplified48.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              Alternative 20: 100.0% accurate, 1.0× speedup?

                                              \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \left(e^{re} \cdot \sin im\_m\right) \end{array} \]
                                              im\_m = (fabs.f64 im)
                                              im\_s = (copysign.f64 #s(literal 1 binary64) im)
                                              (FPCore (im_s re im_m) :precision binary64 (* im_s (* (exp re) (sin im_m))))
                                              im\_m = fabs(im);
                                              im\_s = copysign(1.0, im);
                                              double code(double im_s, double re, double im_m) {
                                              	return im_s * (exp(re) * sin(im_m));
                                              }
                                              
                                              im\_m = abs(im)
                                              im\_s = copysign(1.0d0, im)
                                              real(8) function code(im_s, re, im_m)
                                                  real(8), intent (in) :: im_s
                                                  real(8), intent (in) :: re
                                                  real(8), intent (in) :: im_m
                                                  code = im_s * (exp(re) * sin(im_m))
                                              end function
                                              
                                              im\_m = Math.abs(im);
                                              im\_s = Math.copySign(1.0, im);
                                              public static double code(double im_s, double re, double im_m) {
                                              	return im_s * (Math.exp(re) * Math.sin(im_m));
                                              }
                                              
                                              im\_m = math.fabs(im)
                                              im\_s = math.copysign(1.0, im)
                                              def code(im_s, re, im_m):
                                              	return im_s * (math.exp(re) * math.sin(im_m))
                                              
                                              im\_m = abs(im)
                                              im\_s = copysign(1.0, im)
                                              function code(im_s, re, im_m)
                                              	return Float64(im_s * Float64(exp(re) * sin(im_m)))
                                              end
                                              
                                              im\_m = abs(im);
                                              im\_s = sign(im) * abs(1.0);
                                              function tmp = code(im_s, re, im_m)
                                              	tmp = im_s * (exp(re) * sin(im_m));
                                              end
                                              
                                              im\_m = N[Abs[im], $MachinePrecision]
                                              im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                              code[im$95$s_, re_, im$95$m_] := N[(im$95$s * N[(N[Exp[re], $MachinePrecision] * N[Sin[im$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                              
                                              \begin{array}{l}
                                              im\_m = \left|im\right|
                                              \\
                                              im\_s = \mathsf{copysign}\left(1, im\right)
                                              
                                              \\
                                              im\_s \cdot \left(e^{re} \cdot \sin im\_m\right)
                                              \end{array}
                                              
                                              Derivation
                                              1. Initial program 100.0%

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

                                              Alternative 21: 30.2% accurate, 17.1× speedup?

                                              \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;im\_m \leq 175:\\ \;\;\;\;im\_m\\ \mathbf{else}:\\ \;\;\;\;re \cdot im\_m\\ \end{array} \end{array} \]
                                              im\_m = (fabs.f64 im)
                                              im\_s = (copysign.f64 #s(literal 1 binary64) im)
                                              (FPCore (im_s re im_m)
                                               :precision binary64
                                               (* im_s (if (<= im_m 175.0) im_m (* re im_m))))
                                              im\_m = fabs(im);
                                              im\_s = copysign(1.0, im);
                                              double code(double im_s, double re, double im_m) {
                                              	double tmp;
                                              	if (im_m <= 175.0) {
                                              		tmp = im_m;
                                              	} else {
                                              		tmp = re * im_m;
                                              	}
                                              	return im_s * tmp;
                                              }
                                              
                                              im\_m = abs(im)
                                              im\_s = copysign(1.0d0, im)
                                              real(8) function code(im_s, re, im_m)
                                                  real(8), intent (in) :: im_s
                                                  real(8), intent (in) :: re
                                                  real(8), intent (in) :: im_m
                                                  real(8) :: tmp
                                                  if (im_m <= 175.0d0) then
                                                      tmp = im_m
                                                  else
                                                      tmp = re * im_m
                                                  end if
                                                  code = im_s * tmp
                                              end function
                                              
                                              im\_m = Math.abs(im);
                                              im\_s = Math.copySign(1.0, im);
                                              public static double code(double im_s, double re, double im_m) {
                                              	double tmp;
                                              	if (im_m <= 175.0) {
                                              		tmp = im_m;
                                              	} else {
                                              		tmp = re * im_m;
                                              	}
                                              	return im_s * tmp;
                                              }
                                              
                                              im\_m = math.fabs(im)
                                              im\_s = math.copysign(1.0, im)
                                              def code(im_s, re, im_m):
                                              	tmp = 0
                                              	if im_m <= 175.0:
                                              		tmp = im_m
                                              	else:
                                              		tmp = re * im_m
                                              	return im_s * tmp
                                              
                                              im\_m = abs(im)
                                              im\_s = copysign(1.0, im)
                                              function code(im_s, re, im_m)
                                              	tmp = 0.0
                                              	if (im_m <= 175.0)
                                              		tmp = im_m;
                                              	else
                                              		tmp = Float64(re * im_m);
                                              	end
                                              	return Float64(im_s * tmp)
                                              end
                                              
                                              im\_m = abs(im);
                                              im\_s = sign(im) * abs(1.0);
                                              function tmp_2 = code(im_s, re, im_m)
                                              	tmp = 0.0;
                                              	if (im_m <= 175.0)
                                              		tmp = im_m;
                                              	else
                                              		tmp = re * im_m;
                                              	end
                                              	tmp_2 = im_s * tmp;
                                              end
                                              
                                              im\_m = N[Abs[im], $MachinePrecision]
                                              im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                              code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[im$95$m, 175.0], im$95$m, N[(re * im$95$m), $MachinePrecision]]), $MachinePrecision]
                                              
                                              \begin{array}{l}
                                              im\_m = \left|im\right|
                                              \\
                                              im\_s = \mathsf{copysign}\left(1, im\right)
                                              
                                              \\
                                              im\_s \cdot \begin{array}{l}
                                              \mathbf{if}\;im\_m \leq 175:\\
                                              \;\;\;\;im\_m\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;re \cdot im\_m\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 2 regimes
                                              2. if im < 175

                                                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. Simplified79.2%

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

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

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

                                                    if 175 < im

                                                    1. Initial program 99.9%

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

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

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

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

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

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

                                                          \[\leadsto \color{blue}{re \cdot im} \]
                                                        2. *-lowering-*.f648.1

                                                          \[\leadsto \color{blue}{re \cdot im} \]
                                                      7. Simplified8.1%

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

                                                    Alternative 22: 30.1% accurate, 22.9× speedup?

                                                    \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \left(im\_m \cdot \left(re + 1\right)\right) \end{array} \]
                                                    im\_m = (fabs.f64 im)
                                                    im\_s = (copysign.f64 #s(literal 1 binary64) im)
                                                    (FPCore (im_s re im_m) :precision binary64 (* im_s (* im_m (+ re 1.0))))
                                                    im\_m = fabs(im);
                                                    im\_s = copysign(1.0, im);
                                                    double code(double im_s, double re, double im_m) {
                                                    	return im_s * (im_m * (re + 1.0));
                                                    }
                                                    
                                                    im\_m = abs(im)
                                                    im\_s = copysign(1.0d0, im)
                                                    real(8) function code(im_s, re, im_m)
                                                        real(8), intent (in) :: im_s
                                                        real(8), intent (in) :: re
                                                        real(8), intent (in) :: im_m
                                                        code = im_s * (im_m * (re + 1.0d0))
                                                    end function
                                                    
                                                    im\_m = Math.abs(im);
                                                    im\_s = Math.copySign(1.0, im);
                                                    public static double code(double im_s, double re, double im_m) {
                                                    	return im_s * (im_m * (re + 1.0));
                                                    }
                                                    
                                                    im\_m = math.fabs(im)
                                                    im\_s = math.copysign(1.0, im)
                                                    def code(im_s, re, im_m):
                                                    	return im_s * (im_m * (re + 1.0))
                                                    
                                                    im\_m = abs(im)
                                                    im\_s = copysign(1.0, im)
                                                    function code(im_s, re, im_m)
                                                    	return Float64(im_s * Float64(im_m * Float64(re + 1.0)))
                                                    end
                                                    
                                                    im\_m = abs(im);
                                                    im\_s = sign(im) * abs(1.0);
                                                    function tmp = code(im_s, re, im_m)
                                                    	tmp = im_s * (im_m * (re + 1.0));
                                                    end
                                                    
                                                    im\_m = N[Abs[im], $MachinePrecision]
                                                    im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                    code[im$95$s_, re_, im$95$m_] := N[(im$95$s * N[(im$95$m * N[(re + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                                    
                                                    \begin{array}{l}
                                                    im\_m = \left|im\right|
                                                    \\
                                                    im\_s = \mathsf{copysign}\left(1, im\right)
                                                    
                                                    \\
                                                    im\_s \cdot \left(im\_m \cdot \left(re + 1\right)\right)
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Initial program 100.0%

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

                                                      \[\leadsto \color{blue}{\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-+.f6458.3

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

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

                                                      \[\leadsto \left(re + 1\right) \cdot \color{blue}{im} \]
                                                    7. Step-by-step derivation
                                                      1. Simplified35.3%

                                                        \[\leadsto \left(re + 1\right) \cdot \color{blue}{im} \]
                                                      2. Final simplification35.3%

                                                        \[\leadsto im \cdot \left(re + 1\right) \]
                                                      3. Add Preprocessing

                                                      Alternative 23: 30.1% accurate, 29.4× speedup?

                                                      \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \mathsf{fma}\left(re, im\_m, im\_m\right) \end{array} \]
                                                      im\_m = (fabs.f64 im)
                                                      im\_s = (copysign.f64 #s(literal 1 binary64) im)
                                                      (FPCore (im_s re im_m) :precision binary64 (* im_s (fma re im_m im_m)))
                                                      im\_m = fabs(im);
                                                      im\_s = copysign(1.0, im);
                                                      double code(double im_s, double re, double im_m) {
                                                      	return im_s * fma(re, im_m, im_m);
                                                      }
                                                      
                                                      im\_m = abs(im)
                                                      im\_s = copysign(1.0, im)
                                                      function code(im_s, re, im_m)
                                                      	return Float64(im_s * fma(re, im_m, im_m))
                                                      end
                                                      
                                                      im\_m = N[Abs[im], $MachinePrecision]
                                                      im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                      code[im$95$s_, re_, im$95$m_] := N[(im$95$s * N[(re * im$95$m + im$95$m), $MachinePrecision]), $MachinePrecision]
                                                      
                                                      \begin{array}{l}
                                                      im\_m = \left|im\right|
                                                      \\
                                                      im\_s = \mathsf{copysign}\left(1, im\right)
                                                      
                                                      \\
                                                      im\_s \cdot \mathsf{fma}\left(re, im\_m, im\_m\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. Simplified69.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. *-commutativeN/A

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

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

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

                                                        Alternative 24: 27.2% accurate, 206.0× speedup?

                                                        \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot im\_m \end{array} \]
                                                        im\_m = (fabs.f64 im)
                                                        im\_s = (copysign.f64 #s(literal 1 binary64) im)
                                                        (FPCore (im_s re im_m) :precision binary64 (* im_s im_m))
                                                        im\_m = fabs(im);
                                                        im\_s = copysign(1.0, im);
                                                        double code(double im_s, double re, double im_m) {
                                                        	return im_s * im_m;
                                                        }
                                                        
                                                        im\_m = abs(im)
                                                        im\_s = copysign(1.0d0, im)
                                                        real(8) function code(im_s, re, im_m)
                                                            real(8), intent (in) :: im_s
                                                            real(8), intent (in) :: re
                                                            real(8), intent (in) :: im_m
                                                            code = im_s * im_m
                                                        end function
                                                        
                                                        im\_m = Math.abs(im);
                                                        im\_s = Math.copySign(1.0, im);
                                                        public static double code(double im_s, double re, double im_m) {
                                                        	return im_s * im_m;
                                                        }
                                                        
                                                        im\_m = math.fabs(im)
                                                        im\_s = math.copysign(1.0, im)
                                                        def code(im_s, re, im_m):
                                                        	return im_s * im_m
                                                        
                                                        im\_m = abs(im)
                                                        im\_s = copysign(1.0, im)
                                                        function code(im_s, re, im_m)
                                                        	return Float64(im_s * im_m)
                                                        end
                                                        
                                                        im\_m = abs(im);
                                                        im\_s = sign(im) * abs(1.0);
                                                        function tmp = code(im_s, re, im_m)
                                                        	tmp = im_s * im_m;
                                                        end
                                                        
                                                        im\_m = N[Abs[im], $MachinePrecision]
                                                        im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                        code[im$95$s_, re_, im$95$m_] := N[(im$95$s * im$95$m), $MachinePrecision]
                                                        
                                                        \begin{array}{l}
                                                        im\_m = \left|im\right|
                                                        \\
                                                        im\_s = \mathsf{copysign}\left(1, im\right)
                                                        
                                                        \\
                                                        im\_s \cdot im\_m
                                                        \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. Simplified69.4%

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

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

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

                                                            Reproduce

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