math.exp on complex, imaginary part

Percentage Accurate: 100.0% → 100.0%
Time: 16.7s
Alternatives: 25
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 25 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 1.0× speedup?

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

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

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

Alternative 2: 90.7% accurate, 0.2× speedup?

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

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

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

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\frac{1}{6} \cdot \color{blue}{{re}^{3}}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \frac{-1}{5040}, \frac{1}{120}\right), \frac{-1}{6}\right), im \cdot \left(im \cdot im\right), im\right) \]
    13. Step-by-step derivation
      1. Applied rewrites65.7%

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

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

      1. Initial program 100.0%

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

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

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

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

      if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 4.99999999999999966e-103 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 \color{blue}{im \cdot e^{re}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

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

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

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

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

    Alternative 3: 62.9% accurate, 0.2× speedup?

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

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{1}{6} \cdot \color{blue}{{re}^{3}}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \frac{-1}{5040}, \frac{1}{120}\right), \frac{-1}{6}\right), im \cdot \left(im \cdot im\right), im\right) \]
      13. Step-by-step derivation
        1. Applied rewrites65.7%

          \[\leadsto \left(0.16666666666666666 \cdot \color{blue}{\left(re \cdot \left(re \cdot re\right)\right)}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), im \cdot \left(im \cdot im\right), im\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. lower-sin.f6499.6

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

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

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

        1. Initial program 100.0%

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

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

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

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

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

          \[\leadsto im + \color{blue}{im \cdot re} \]
        7. Step-by-step derivation
          1. Applied rewrites33.3%

            \[\leadsto \mathsf{fma}\left(im, \color{blue}{re}, im\right) \]
          2. Step-by-step derivation
            1. Applied rewrites36.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, \frac{1}{2} + \frac{1}{6} \cdot re, 1\right)}, 1\right) \cdot \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
              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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
              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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
              7. lower-fma.f6463.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 4: 39.4% accurate, 0.4× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\ t_1 := e^{re} \cdot \sin im\\ \mathbf{if}\;t\_1 \leq -0.02:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), im \cdot \left(im \cdot im\right), im\right) \cdot t\_0\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{im \cdot im - re \cdot \left(re \cdot \left(im \cdot im\right)\right)}{im - re \cdot im}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \mathsf{fma}\left(im \cdot im, im \cdot \mathsf{fma}\left(im \cdot im, 0.008333333333333333, -0.16666666666666666\right), im\right)\\ \end{array} \end{array} \]
          (FPCore (re im)
           :precision binary64
           (let* ((t_0 (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0))
                  (t_1 (* (exp re) (sin im))))
             (if (<= t_1 -0.02)
               (*
                (fma
                 (fma
                  (* im im)
                  (fma (* im im) -0.0001984126984126984 0.008333333333333333)
                  -0.16666666666666666)
                 (* im (* im im))
                 im)
                t_0)
               (if (<= t_1 0.0)
                 (/ (- (* im im) (* re (* re (* im im)))) (- im (* re im)))
                 (*
                  t_0
                  (fma
                   (* im im)
                   (* im (fma (* im im) 0.008333333333333333 -0.16666666666666666))
                   im))))))
          double code(double re, double im) {
          	double t_0 = fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
          	double t_1 = exp(re) * sin(im);
          	double tmp;
          	if (t_1 <= -0.02) {
          		tmp = fma(fma((im * im), fma((im * im), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), (im * (im * im)), im) * t_0;
          	} else if (t_1 <= 0.0) {
          		tmp = ((im * im) - (re * (re * (im * im)))) / (im - (re * im));
          	} else {
          		tmp = t_0 * fma((im * im), (im * fma((im * im), 0.008333333333333333, -0.16666666666666666)), im);
          	}
          	return tmp;
          }
          
          function code(re, im)
          	t_0 = fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0)
          	t_1 = Float64(exp(re) * sin(im))
          	tmp = 0.0
          	if (t_1 <= -0.02)
          		tmp = Float64(fma(fma(Float64(im * im), fma(Float64(im * im), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), Float64(im * Float64(im * im)), im) * t_0);
          	elseif (t_1 <= 0.0)
          		tmp = Float64(Float64(Float64(im * im) - Float64(re * Float64(re * Float64(im * im)))) / Float64(im - Float64(re * im)));
          	else
          		tmp = Float64(t_0 * fma(Float64(im * im), Float64(im * fma(Float64(im * im), 0.008333333333333333, -0.16666666666666666)), im));
          	end
          	return tmp
          end
          
          code[re_, im_] := Block[{t$95$0 = N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -0.02], N[(N[(N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision] + im), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(N[(im * im), $MachinePrecision] - N[(re * N[(re * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(im - N[(re * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(im * im), $MachinePrecision] * N[(im * N[(N[(im * im), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + im), $MachinePrecision]), $MachinePrecision]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\
          t_1 := e^{re} \cdot \sin im\\
          \mathbf{if}\;t\_1 \leq -0.02:\\
          \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), im \cdot \left(im \cdot im\right), im\right) \cdot t\_0\\
          
          \mathbf{elif}\;t\_1 \leq 0:\\
          \;\;\;\;\frac{im \cdot im - re \cdot \left(re \cdot \left(im \cdot im\right)\right)}{im - re \cdot im}\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0 \cdot \mathsf{fma}\left(im \cdot im, im \cdot \mathsf{fma}\left(im \cdot im, 0.008333333333333333, -0.16666666666666666\right), im\right)\\
          
          
          \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 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, \frac{1}{2} + \frac{1}{6} \cdot re, 1\right)}, 1\right) \cdot \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
              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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
              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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
              7. lower-fma.f6440.4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto im + \color{blue}{im \cdot re} \]
            7. Step-by-step derivation
              1. Applied rewrites33.3%

                \[\leadsto \mathsf{fma}\left(im, \color{blue}{re}, im\right) \]
              2. Step-by-step derivation
                1. Applied rewrites36.1%

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

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

                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, \frac{1}{2} + \frac{1}{6} \cdot re, 1\right)}, 1\right) \cdot \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                  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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                  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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                  7. lower-fma.f6451.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 5: 39.2% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, \frac{1}{2} + \frac{1}{6} \cdot re, 1\right)}, 1\right) \cdot \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                  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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                  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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                  7. lower-fma.f6440.4

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\frac{1}{6} \cdot \color{blue}{{re}^{3}}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \frac{-1}{5040}, \frac{1}{120}\right), \frac{-1}{6}\right), im \cdot \left(im \cdot im\right), im\right) \]
                13. Step-by-step derivation
                  1. Applied rewrites42.5%

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

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

                  1. Initial program 100.0%

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

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

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

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

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

                    \[\leadsto im + \color{blue}{im \cdot re} \]
                  7. Step-by-step derivation
                    1. Applied rewrites33.3%

                      \[\leadsto \mathsf{fma}\left(im, \color{blue}{re}, im\right) \]
                    2. Step-by-step derivation
                      1. Applied rewrites36.1%

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

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

                      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, \frac{1}{2} + \frac{1}{6} \cdot re, 1\right)}, 1\right) \cdot \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                        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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                        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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                        7. lower-fma.f6451.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 6: 38.5% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

                        \[\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({im}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {im}^{2}\right) - \frac{1}{6}\right)\right)\right)} \]
                      7. Step-by-step derivation
                        1. lower-*.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({im}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {im}^{2}\right) - \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({im}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {im}^{2}\right) - \frac{1}{6}\right) + 1\right)}\right) \]
                        3. lower-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}, {im}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {im}^{2}\right) - \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}, {im}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {im}^{2}\right) - \frac{1}{6}, 1\right)\right) \]
                        5. lower-*.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}, {im}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {im}^{2}\right) - \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}{{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)\right) \]
                        7. 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 \left(\frac{1}{120} + \frac{-1}{5040} \cdot {im}^{2}\right) + \color{blue}{\frac{-1}{6}}, 1\right)\right) \]
                        8. lower-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}{5040} \cdot {im}^{2}, \frac{-1}{6}\right)}, 1\right)\right) \]
                        9. 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}{5040} \cdot {im}^{2}, \frac{-1}{6}\right), 1\right)\right) \]
                        10. lower-*.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, \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{120} + \frac{-1}{5040} \cdot {im}^{2}, \frac{-1}{6}\right), 1\right)\right) \]
                        11. +-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, \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{-1}{5040} \cdot {im}^{2} + \frac{1}{120}}, \frac{-1}{6}\right), 1\right)\right) \]
                        12. 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(im \cdot im, \frac{-1}{5040} \cdot \color{blue}{\left(im \cdot im\right)} + \frac{1}{120}, \frac{-1}{6}\right), 1\right)\right) \]
                        13. associate-*r*N/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(im \cdot im, \color{blue}{\left(\frac{-1}{5040} \cdot im\right) \cdot im} + \frac{1}{120}, \frac{-1}{6}\right), 1\right)\right) \]
                        14. *-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, \mathsf{fma}\left(im \cdot im, \color{blue}{im \cdot \left(\frac{-1}{5040} \cdot im\right)} + \frac{1}{120}, \frac{-1}{6}\right), 1\right)\right) \]
                        15. lower-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, \mathsf{fma}\left(im \cdot im, \color{blue}{\mathsf{fma}\left(im, \frac{-1}{5040} \cdot im, \frac{1}{120}\right)}, \frac{-1}{6}\right), 1\right)\right) \]
                        16. *-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, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, \color{blue}{im \cdot \frac{-1}{5040}}, \frac{1}{120}\right), \frac{-1}{6}\right), 1\right)\right) \]
                        17. lower-*.f6435.8

                          \[\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(im \cdot im, \mathsf{fma}\left(im, \color{blue}{im \cdot -0.0001984126984126984}, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right) \]
                      8. Applied rewrites35.8%

                        \[\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, \mathsf{fma}\left(im, im \cdot -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\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 im around 0

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

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

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

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

                        \[\leadsto im + \color{blue}{im \cdot re} \]
                      7. Step-by-step derivation
                        1. Applied rewrites33.3%

                          \[\leadsto \mathsf{fma}\left(im, \color{blue}{re}, im\right) \]
                        2. Step-by-step derivation
                          1. Applied rewrites36.1%

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

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

                          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, \frac{1}{2} + \frac{1}{6} \cdot re, 1\right)}, 1\right) \cdot \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                            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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                            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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                            7. lower-fma.f6451.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        Alternative 7: 38.4% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(re, re \cdot \frac{1}{2}, re\right) \cdot \color{blue}{\left(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)\right)} \]
                            3. Step-by-step derivation
                              1. +-commutativeN/A

                                \[\leadsto \mathsf{fma}\left(re, re \cdot \frac{1}{2}, re\right) \cdot \left(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)}\right) \]
                              2. distribute-lft-inN/A

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

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

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

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

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

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

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

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

                              \[\leadsto im + \color{blue}{im \cdot re} \]
                            7. Step-by-step derivation
                              1. Applied rewrites33.3%

                                \[\leadsto \mathsf{fma}\left(im, \color{blue}{re}, im\right) \]
                              2. Step-by-step derivation
                                1. Applied rewrites36.1%

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

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

                                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, \frac{1}{2} + \frac{1}{6} \cdot re, 1\right)}, 1\right) \cdot \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                                  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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                                  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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                                  7. lower-fma.f6451.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              Alternative 8: 39.3% accurate, 0.4× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{re} \cdot \sin im\\ t_1 := \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\ \mathbf{if}\;t\_0 \leq -0.02:\\ \;\;\;\;t\_1 \cdot \mathsf{fma}\left(im, \left(im \cdot im\right) \cdot -0.16666666666666666, im\right)\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\frac{im \cdot im - re \cdot \left(re \cdot \left(im \cdot im\right)\right)}{im - re \cdot im}\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \mathsf{fma}\left(im \cdot im, im \cdot \mathsf{fma}\left(im \cdot im, 0.008333333333333333, -0.16666666666666666\right), im\right)\\ \end{array} \end{array} \]
                              (FPCore (re im)
                               :precision binary64
                               (let* ((t_0 (* (exp re) (sin im)))
                                      (t_1 (fma re (fma re (fma re 0.16666666666666666 0.5) 1.0) 1.0)))
                                 (if (<= t_0 -0.02)
                                   (* t_1 (fma im (* (* im im) -0.16666666666666666) im))
                                   (if (<= t_0 0.0)
                                     (/ (- (* im im) (* re (* re (* im im)))) (- im (* re im)))
                                     (*
                                      t_1
                                      (fma
                                       (* im im)
                                       (* im (fma (* im im) 0.008333333333333333 -0.16666666666666666))
                                       im))))))
                              double code(double re, double im) {
                              	double t_0 = exp(re) * sin(im);
                              	double t_1 = fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0);
                              	double tmp;
                              	if (t_0 <= -0.02) {
                              		tmp = t_1 * fma(im, ((im * im) * -0.16666666666666666), im);
                              	} else if (t_0 <= 0.0) {
                              		tmp = ((im * im) - (re * (re * (im * im)))) / (im - (re * im));
                              	} else {
                              		tmp = t_1 * fma((im * im), (im * fma((im * im), 0.008333333333333333, -0.16666666666666666)), im);
                              	}
                              	return tmp;
                              }
                              
                              function code(re, im)
                              	t_0 = Float64(exp(re) * sin(im))
                              	t_1 = fma(re, fma(re, fma(re, 0.16666666666666666, 0.5), 1.0), 1.0)
                              	tmp = 0.0
                              	if (t_0 <= -0.02)
                              		tmp = Float64(t_1 * fma(im, Float64(Float64(im * im) * -0.16666666666666666), im));
                              	elseif (t_0 <= 0.0)
                              		tmp = Float64(Float64(Float64(im * im) - Float64(re * Float64(re * Float64(im * im)))) / Float64(im - Float64(re * im)));
                              	else
                              		tmp = Float64(t_1 * fma(Float64(im * im), Float64(im * fma(Float64(im * im), 0.008333333333333333, -0.16666666666666666)), im));
                              	end
                              	return tmp
                              end
                              
                              code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(re * N[(re * N[(re * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[t$95$0, -0.02], N[(t$95$1 * N[(im * N[(N[(im * im), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + im), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(N[(im * im), $MachinePrecision] - N[(re * N[(re * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(im - N[(re * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[(im * im), $MachinePrecision] * N[(im * N[(N[(im * im), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + im), $MachinePrecision]), $MachinePrecision]]]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              t_0 := e^{re} \cdot \sin im\\
                              t_1 := \mathsf{fma}\left(re, \mathsf{fma}\left(re, \mathsf{fma}\left(re, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\
                              \mathbf{if}\;t\_0 \leq -0.02:\\
                              \;\;\;\;t\_1 \cdot \mathsf{fma}\left(im, \left(im \cdot im\right) \cdot -0.16666666666666666, im\right)\\
                              
                              \mathbf{elif}\;t\_0 \leq 0:\\
                              \;\;\;\;\frac{im \cdot im - re \cdot \left(re \cdot \left(im \cdot im\right)\right)}{im - re \cdot im}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;t\_1 \cdot \mathsf{fma}\left(im \cdot im, im \cdot \mathsf{fma}\left(im \cdot im, 0.008333333333333333, -0.16666666666666666\right), im\right)\\
                              
                              
                              \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 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, \frac{1}{2} + \frac{1}{6} \cdot re, 1\right)}, 1\right) \cdot \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                                  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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                                  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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                                  7. lower-fma.f6440.4

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

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

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

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

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

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

                                  \[\leadsto im + \color{blue}{im \cdot re} \]
                                7. Step-by-step derivation
                                  1. Applied rewrites33.3%

                                    \[\leadsto \mathsf{fma}\left(im, \color{blue}{re}, im\right) \]
                                  2. Step-by-step derivation
                                    1. Applied rewrites36.1%

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

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

                                    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, \frac{1}{2} + \frac{1}{6} \cdot re, 1\right)}, 1\right) \cdot \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                                      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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                                      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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                                      7. lower-fma.f6451.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  Alternative 9: 38.4% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, \frac{1}{2} + \frac{1}{6} \cdot re, 1\right)}, 1\right) \cdot \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                                      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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                                      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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                                      7. lower-fma.f6440.4

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

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

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

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

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

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

                                      \[\leadsto im + \color{blue}{im \cdot re} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites33.3%

                                        \[\leadsto \mathsf{fma}\left(im, \color{blue}{re}, im\right) \]
                                      2. Step-by-step derivation
                                        1. Applied rewrites36.1%

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

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

                                        1. Initial program 100.0%

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

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

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

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

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

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

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

                                          \[\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. lower-*.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. lower-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. lower-*.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. lower-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. lower-*.f6449.2

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

                                          \[\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)} \]
                                      3. Recombined 3 regimes into one program.
                                      4. Final simplification41.6%

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

                                      Alternative 10: 39.1% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \mathsf{fma}\left(re, \color{blue}{\mathsf{fma}\left(re, \frac{1}{2} + \frac{1}{6} \cdot re, 1\right)}, 1\right) \cdot \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                                          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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                                          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 \mathsf{fma}\left(im, \frac{-1}{6} \cdot \left(im \cdot im\right), im\right) \]
                                          7. lower-fma.f6440.4

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

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

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

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

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

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

                                          \[\leadsto im + \color{blue}{im \cdot re} \]
                                        7. Step-by-step derivation
                                          1. Applied rewrites33.3%

                                            \[\leadsto \mathsf{fma}\left(im, \color{blue}{re}, im\right) \]
                                          2. Step-by-step derivation
                                            1. Applied rewrites36.1%

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

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

                                            1. Initial program 100.0%

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

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

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

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

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

                                              \[\leadsto im \cdot \left(1 + \color{blue}{re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)}\right) \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites47.4%

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

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

                                            Alternative 11: 38.5% accurate, 0.8× speedup?

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

                                              1. Initial program 100.0%

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

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

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

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

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

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

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

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

                                                \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(re, \frac{1}{2}, 1\right), 1\right) \cdot \color{blue}{\left(im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{2}\right)\right)} \]
                                              7. Step-by-step derivation
                                                1. +-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(\frac{-1}{6} \cdot {im}^{2} + 1\right)}\right) \]
                                                2. distribute-lft-inN/A

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

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

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

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

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

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

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

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

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

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

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

                                              1. Initial program 100.0%

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

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

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

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

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

                                                \[\leadsto im \cdot \left(1 + \color{blue}{re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)}\right) \]
                                              7. Step-by-step derivation
                                                1. Applied rewrites47.4%

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

                                              Alternative 12: 26.9% accurate, 0.8× speedup?

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

                                                1. Initial program 100.0%

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

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

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

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

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

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

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

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

                                                  \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(re, \frac{1}{2}, 1\right), 1\right) \cdot \color{blue}{\left(im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{2}\right)\right)} \]
                                                7. Step-by-step derivation
                                                  1. +-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(\frac{-1}{6} \cdot {im}^{2} + 1\right)}\right) \]
                                                  2. distribute-lft-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  1. Initial program 100.0%

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

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

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

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

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

                                                    \[\leadsto im \cdot \left(1 + \color{blue}{re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)}\right) \]
                                                  7. Step-by-step derivation
                                                    1. Applied rewrites47.4%

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

                                                  Alternative 13: 26.8% accurate, 0.8× speedup?

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

                                                    1. Initial program 100.0%

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

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

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

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

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

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

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

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

                                                      \[\leadsto \mathsf{fma}\left(re, \mathsf{fma}\left(re, \frac{1}{2}, 1\right), 1\right) \cdot \color{blue}{\left(im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{2}\right)\right)} \]
                                                    7. Step-by-step derivation
                                                      1. +-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(\frac{-1}{6} \cdot {im}^{2} + 1\right)}\right) \]
                                                      2. distribute-lft-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      1. Initial program 100.0%

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

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

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

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

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

                                                        \[\leadsto im \cdot \left(1 + \color{blue}{re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)}\right) \]
                                                      7. Step-by-step derivation
                                                        1. Applied rewrites47.4%

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

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

                                                      Alternative 14: 35.4% accurate, 0.9× speedup?

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

                                                        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                        1. Initial program 100.0%

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

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

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

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

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

                                                          \[\leadsto im \cdot \left(1 + \color{blue}{re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)}\right) \]
                                                        7. Step-by-step derivation
                                                          1. Applied rewrites47.4%

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

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

                                                        Alternative 15: 35.0% accurate, 0.9× speedup?

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

                                                          1. Initial program 100.0%

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

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

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

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

                                                            \[\leadsto im \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {im}^{2}\right)} \]
                                                          7. Step-by-step derivation
                                                            1. Applied rewrites28.4%

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

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

                                                            1. Initial program 100.0%

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

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

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

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

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

                                                              \[\leadsto im \cdot \left(1 + \color{blue}{re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)}\right) \]
                                                            7. Step-by-step derivation
                                                              1. Applied rewrites47.4%

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

                                                            Alternative 16: 34.5% accurate, 0.9× speedup?

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

                                                              1. Initial program 100.0%

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

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

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

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

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

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

                                                                if 4.00000000000000015e-10 < (*.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 \color{blue}{im \cdot e^{re}} \]
                                                                4. Step-by-step derivation
                                                                  1. lower-*.f64N/A

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

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

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

                                                                  \[\leadsto im \cdot \left(1 + \color{blue}{re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)}\right) \]
                                                                7. Step-by-step derivation
                                                                  1. Applied rewrites17.3%

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

                                                                    \[\leadsto im \cdot \left({re}^{3} \cdot \left(\frac{1}{6} + \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{re} + \frac{1}{{re}^{2}}\right)}\right)\right) \]
                                                                  3. Step-by-step derivation
                                                                    1. Applied rewrites17.6%

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

                                                                  Alternative 17: 34.5% accurate, 0.9× speedup?

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

                                                                    1. Initial program 100.0%

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

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

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

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

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

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

                                                                      if 4.00000000000000015e-10 < (*.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 \color{blue}{im \cdot e^{re}} \]
                                                                      4. Step-by-step derivation
                                                                        1. lower-*.f64N/A

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

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

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

                                                                        \[\leadsto im \cdot \left(1 + \color{blue}{re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)}\right) \]
                                                                      7. Step-by-step derivation
                                                                        1. Applied rewrites17.3%

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

                                                                          \[\leadsto im \cdot \left({re}^{3} \cdot \left(\frac{1}{6} + \color{blue}{\frac{1}{2} \cdot \frac{1}{re}}\right)\right) \]
                                                                        3. Step-by-step derivation
                                                                          1. Applied rewrites17.2%

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

                                                                        Alternative 18: 34.5% accurate, 0.9× speedup?

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

                                                                          1. Initial program 100.0%

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

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

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

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

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

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

                                                                            if 4.00000000000000015e-10 < (*.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 \color{blue}{im \cdot e^{re}} \]
                                                                            4. Step-by-step derivation
                                                                              1. lower-*.f64N/A

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

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

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

                                                                              \[\leadsto im \cdot \left(1 + \color{blue}{re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)}\right) \]
                                                                            7. Step-by-step derivation
                                                                              1. Applied rewrites17.3%

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

                                                                                \[\leadsto im \cdot \left(\frac{1}{6} \cdot {re}^{\color{blue}{3}}\right) \]
                                                                              3. Step-by-step derivation
                                                                                1. Applied rewrites17.3%

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

                                                                              Alternative 19: 33.8% accurate, 0.9× speedup?

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

                                                                                1. Initial program 100.0%

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

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

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

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

                                                                                  \[\leadsto im \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {im}^{2}\right)} \]
                                                                                7. Step-by-step derivation
                                                                                  1. Applied rewrites28.4%

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

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

                                                                                  1. Initial program 100.0%

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

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

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

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

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

                                                                                    \[\leadsto im \cdot \left(1 + \color{blue}{re \cdot \left(1 + \frac{1}{2} \cdot re\right)}\right) \]
                                                                                  7. Step-by-step derivation
                                                                                    1. Applied rewrites46.4%

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

                                                                                  Alternative 20: 33.3% accurate, 0.9× speedup?

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

                                                                                    1. Initial program 100.0%

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

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

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

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

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

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

                                                                                      if 4.00000000000000015e-10 < (*.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 \color{blue}{im \cdot e^{re}} \]
                                                                                      4. Step-by-step derivation
                                                                                        1. lower-*.f64N/A

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

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

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

                                                                                        \[\leadsto im + \color{blue}{re \cdot \left(im + \frac{1}{2} \cdot \left(im \cdot re\right)\right)} \]
                                                                                      7. Step-by-step derivation
                                                                                        1. Applied rewrites10.4%

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

                                                                                          \[\leadsto \frac{1}{2} \cdot \left(im \cdot \color{blue}{{re}^{2}}\right) \]
                                                                                        3. Step-by-step derivation
                                                                                          1. Applied rewrites15.6%

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

                                                                                        Alternative 21: 31.8% accurate, 0.9× speedup?

                                                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq 0.96:\\ \;\;\;\;im \cdot 1\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(0.5 \cdot \left(re \cdot re\right)\right)\\ \end{array} \end{array} \]
                                                                                        (FPCore (re im)
                                                                                         :precision binary64
                                                                                         (if (<= (* (exp re) (sin im)) 0.96) (* im 1.0) (* im (* 0.5 (* re re)))))
                                                                                        double code(double re, double im) {
                                                                                        	double tmp;
                                                                                        	if ((exp(re) * sin(im)) <= 0.96) {
                                                                                        		tmp = im * 1.0;
                                                                                        	} else {
                                                                                        		tmp = im * (0.5 * (re * re));
                                                                                        	}
                                                                                        	return tmp;
                                                                                        }
                                                                                        
                                                                                        real(8) function code(re, im)
                                                                                            real(8), intent (in) :: re
                                                                                            real(8), intent (in) :: im
                                                                                            real(8) :: tmp
                                                                                            if ((exp(re) * sin(im)) <= 0.96d0) then
                                                                                                tmp = im * 1.0d0
                                                                                            else
                                                                                                tmp = im * (0.5d0 * (re * re))
                                                                                            end if
                                                                                            code = tmp
                                                                                        end function
                                                                                        
                                                                                        public static double code(double re, double im) {
                                                                                        	double tmp;
                                                                                        	if ((Math.exp(re) * Math.sin(im)) <= 0.96) {
                                                                                        		tmp = im * 1.0;
                                                                                        	} else {
                                                                                        		tmp = im * (0.5 * (re * re));
                                                                                        	}
                                                                                        	return tmp;
                                                                                        }
                                                                                        
                                                                                        def code(re, im):
                                                                                        	tmp = 0
                                                                                        	if (math.exp(re) * math.sin(im)) <= 0.96:
                                                                                        		tmp = im * 1.0
                                                                                        	else:
                                                                                        		tmp = im * (0.5 * (re * re))
                                                                                        	return tmp
                                                                                        
                                                                                        function code(re, im)
                                                                                        	tmp = 0.0
                                                                                        	if (Float64(exp(re) * sin(im)) <= 0.96)
                                                                                        		tmp = Float64(im * 1.0);
                                                                                        	else
                                                                                        		tmp = Float64(im * Float64(0.5 * Float64(re * re)));
                                                                                        	end
                                                                                        	return tmp
                                                                                        end
                                                                                        
                                                                                        function tmp_2 = code(re, im)
                                                                                        	tmp = 0.0;
                                                                                        	if ((exp(re) * sin(im)) <= 0.96)
                                                                                        		tmp = im * 1.0;
                                                                                        	else
                                                                                        		tmp = im * (0.5 * (re * re));
                                                                                        	end
                                                                                        	tmp_2 = tmp;
                                                                                        end
                                                                                        
                                                                                        code[re_, im_] := If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], 0.96], N[(im * 1.0), $MachinePrecision], N[(im * N[(0.5 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                                                                        
                                                                                        \begin{array}{l}
                                                                                        
                                                                                        \\
                                                                                        \begin{array}{l}
                                                                                        \mathbf{if}\;e^{re} \cdot \sin im \leq 0.96:\\
                                                                                        \;\;\;\;im \cdot 1\\
                                                                                        
                                                                                        \mathbf{else}:\\
                                                                                        \;\;\;\;im \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.95999999999999996

                                                                                          1. Initial program 100.0%

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

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

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

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

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

                                                                                            \[\leadsto im \cdot 1 \]
                                                                                          7. Step-by-step derivation
                                                                                            1. Applied rewrites29.4%

                                                                                              \[\leadsto im \cdot 1 \]

                                                                                            if 0.95999999999999996 < (*.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 \color{blue}{im \cdot e^{re}} \]
                                                                                            4. Step-by-step derivation
                                                                                              1. lower-*.f64N/A

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

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

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

                                                                                              \[\leadsto im + \color{blue}{re \cdot \left(im + \frac{1}{2} \cdot \left(im \cdot re\right)\right)} \]
                                                                                            7. Step-by-step derivation
                                                                                              1. Applied rewrites20.7%

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

                                                                                                \[\leadsto \frac{1}{2} \cdot \left(im \cdot \color{blue}{{re}^{2}}\right) \]
                                                                                              3. Step-by-step derivation
                                                                                                1. Applied rewrites33.6%

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

                                                                                              Alternative 22: 39.2% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                if 0.0100000000000000002 < (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}{\sin im} \]
                                                                                                4. Step-by-step derivation
                                                                                                  1. lower-sin.f6459.6

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

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

                                                                                                  \[\leadsto im \cdot \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)} \]
                                                                                                7. Step-by-step derivation
                                                                                                  1. Applied rewrites8.5%

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

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

                                                                                                Alternative 23: 29.8% accurate, 29.4× speedup?

                                                                                                \[\begin{array}{l} \\ \mathsf{fma}\left(im, re, im\right) \end{array} \]
                                                                                                (FPCore (re im) :precision binary64 (fma im re im))
                                                                                                double code(double re, double im) {
                                                                                                	return fma(im, re, im);
                                                                                                }
                                                                                                
                                                                                                function code(re, im)
                                                                                                	return fma(im, re, im)
                                                                                                end
                                                                                                
                                                                                                code[re_, im_] := N[(im * re + im), $MachinePrecision]
                                                                                                
                                                                                                \begin{array}{l}
                                                                                                
                                                                                                \\
                                                                                                \mathsf{fma}\left(im, re, im\right)
                                                                                                \end{array}
                                                                                                
                                                                                                Derivation
                                                                                                1. Initial program 100.0%

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

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

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

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

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

                                                                                                  \[\leadsto im + \color{blue}{im \cdot re} \]
                                                                                                7. Step-by-step derivation
                                                                                                  1. Applied rewrites27.7%

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

                                                                                                  Alternative 24: 26.7% accurate, 34.3× speedup?

                                                                                                  \[\begin{array}{l} \\ im \cdot 1 \end{array} \]
                                                                                                  (FPCore (re im) :precision binary64 (* im 1.0))
                                                                                                  double code(double re, double im) {
                                                                                                  	return im * 1.0;
                                                                                                  }
                                                                                                  
                                                                                                  real(8) function code(re, im)
                                                                                                      real(8), intent (in) :: re
                                                                                                      real(8), intent (in) :: im
                                                                                                      code = im * 1.0d0
                                                                                                  end function
                                                                                                  
                                                                                                  public static double code(double re, double im) {
                                                                                                  	return im * 1.0;
                                                                                                  }
                                                                                                  
                                                                                                  def code(re, im):
                                                                                                  	return im * 1.0
                                                                                                  
                                                                                                  function code(re, im)
                                                                                                  	return Float64(im * 1.0)
                                                                                                  end
                                                                                                  
                                                                                                  function tmp = code(re, im)
                                                                                                  	tmp = im * 1.0;
                                                                                                  end
                                                                                                  
                                                                                                  code[re_, im_] := N[(im * 1.0), $MachinePrecision]
                                                                                                  
                                                                                                  \begin{array}{l}
                                                                                                  
                                                                                                  \\
                                                                                                  im \cdot 1
                                                                                                  \end{array}
                                                                                                  
                                                                                                  Derivation
                                                                                                  1. Initial program 100.0%

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

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

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

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

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

                                                                                                    \[\leadsto im \cdot 1 \]
                                                                                                  7. Step-by-step derivation
                                                                                                    1. Applied rewrites27.0%

                                                                                                      \[\leadsto im \cdot 1 \]
                                                                                                    2. Add Preprocessing

                                                                                                    Alternative 25: 6.9% accurate, 34.3× speedup?

                                                                                                    \[\begin{array}{l} \\ re \cdot im \end{array} \]
                                                                                                    (FPCore (re im) :precision binary64 (* re im))
                                                                                                    double code(double re, double im) {
                                                                                                    	return re * im;
                                                                                                    }
                                                                                                    
                                                                                                    real(8) function code(re, im)
                                                                                                        real(8), intent (in) :: re
                                                                                                        real(8), intent (in) :: im
                                                                                                        code = re * im
                                                                                                    end function
                                                                                                    
                                                                                                    public static double code(double re, double im) {
                                                                                                    	return re * im;
                                                                                                    }
                                                                                                    
                                                                                                    def code(re, im):
                                                                                                    	return re * im
                                                                                                    
                                                                                                    function code(re, im)
                                                                                                    	return Float64(re * im)
                                                                                                    end
                                                                                                    
                                                                                                    function tmp = code(re, im)
                                                                                                    	tmp = re * im;
                                                                                                    end
                                                                                                    
                                                                                                    code[re_, im_] := N[(re * im), $MachinePrecision]
                                                                                                    
                                                                                                    \begin{array}{l}
                                                                                                    
                                                                                                    \\
                                                                                                    re \cdot im
                                                                                                    \end{array}
                                                                                                    
                                                                                                    Derivation
                                                                                                    1. Initial program 100.0%

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

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

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

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

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

                                                                                                      \[\leadsto im + \color{blue}{im \cdot re} \]
                                                                                                    7. Step-by-step derivation
                                                                                                      1. Applied rewrites27.7%

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

                                                                                                        \[\leadsto im \cdot re \]
                                                                                                      3. Step-by-step derivation
                                                                                                        1. Applied rewrites4.5%

                                                                                                          \[\leadsto im \cdot re \]
                                                                                                        2. Final simplification4.5%

                                                                                                          \[\leadsto re \cdot im \]
                                                                                                        3. Add Preprocessing

                                                                                                        Reproduce

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