math.exp on complex, imaginary part

Percentage Accurate: 100.0% → 100.0%
Time: 6.5s
Alternatives: 14
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 14 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: 75.1% accurate, 0.2× speedup?

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;e^{re} \cdot im\\


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.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\right)} \cdot \sin im \]
    4. Step-by-step derivation
      1. lower-+.f64100.0

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

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

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

    1. Initial program 100.0%

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

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

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

      \[\leadsto \color{blue}{\sin im} \]
    6. Step-by-step derivation
      1. Applied rewrites7.6%

        \[\leadsto \sin \left(-\left(im + \mathsf{PI}\left(\right)\right)\right) \]
      2. Taylor expanded in im around 0

        \[\leadsto \sin \left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right) \]
      3. Step-by-step derivation
        1. Applied rewrites64.1%

          \[\leadsto 0 \]

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

        1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, re, 0.5\right), re, 1\right), re, 1\right)} \cdot \sin im \]
        6. Step-by-step derivation
          1. Applied rewrites99.1%

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

            \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot re, re, 1 + re\right) \cdot \sin im \]
          3. Step-by-step derivation
            1. Applied rewrites98.8%

              \[\leadsto \mathsf{fma}\left(0.5 \cdot re, re, 1 + re\right) \cdot \sin 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 \color{blue}{im \cdot e^{re}} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{e^{re} \cdot im} \]
              2. lower-*.f64N/A

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

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

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

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

          Alternative 3: 75.1% accurate, 0.2× speedup?

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

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if -inf.0 < (*.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\right)} \cdot \sin im \]
            4. Step-by-step derivation
              1. lower-+.f64100.0

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

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

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

            1. Initial program 100.0%

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

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

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

              \[\leadsto \color{blue}{\sin im} \]
            6. Step-by-step derivation
              1. Applied rewrites7.6%

                \[\leadsto \sin \left(-\left(im + \mathsf{PI}\left(\right)\right)\right) \]
              2. Taylor expanded in im around 0

                \[\leadsto \sin \left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right) \]
              3. Step-by-step derivation
                1. Applied rewrites64.1%

                  \[\leadsto 0 \]

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

                1. Initial program 99.9%

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

                  \[\leadsto \color{blue}{\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. *-commutativeN/A

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

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

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

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

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(0.5, re, 1\right), re, 1\right)} \cdot \sin 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 \color{blue}{im \cdot e^{re}} \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \color{blue}{e^{re} \cdot im} \]
                  2. lower-*.f64N/A

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

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

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

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

              Alternative 4: 86.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(1 + re\right) \cdot \mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)\\ \mathbf{elif}\;t\_0 \leq -0.02 \lor \neg \left(t\_0 \leq 10^{-78} \lor \neg \left(t\_0 \leq 1\right)\right):\\ \;\;\;\;\left(1 + re\right) \cdot \sin im\\ \mathbf{else}:\\ \;\;\;\;e^{re} \cdot im\\ \end{array} \end{array} \]
              (FPCore (re im)
               :precision binary64
               (let* ((t_0 (* (exp re) (sin im))))
                 (if (<= t_0 (- INFINITY))
                   (* (+ 1.0 re) (fma (pow im 3.0) -0.16666666666666666 im))
                   (if (or (<= t_0 -0.02) (not (or (<= t_0 1e-78) (not (<= t_0 1.0)))))
                     (* (+ 1.0 re) (sin im))
                     (* (exp re) im)))))
              double code(double re, double im) {
              	double t_0 = exp(re) * sin(im);
              	double tmp;
              	if (t_0 <= -((double) INFINITY)) {
              		tmp = (1.0 + re) * fma(pow(im, 3.0), -0.16666666666666666, im);
              	} else if ((t_0 <= -0.02) || !((t_0 <= 1e-78) || !(t_0 <= 1.0))) {
              		tmp = (1.0 + re) * sin(im);
              	} else {
              		tmp = exp(re) * 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(1.0 + re) * fma((im ^ 3.0), -0.16666666666666666, im));
              	elseif ((t_0 <= -0.02) || !((t_0 <= 1e-78) || !(t_0 <= 1.0)))
              		tmp = Float64(Float64(1.0 + re) * sin(im));
              	else
              		tmp = Float64(exp(re) * 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[(1.0 + re), $MachinePrecision] * N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666 + im), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$0, -0.02], N[Not[Or[LessEqual[t$95$0, 1e-78], N[Not[LessEqual[t$95$0, 1.0]], $MachinePrecision]]], $MachinePrecision]], N[(N[(1.0 + re), $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := e^{re} \cdot \sin im\\
              \mathbf{if}\;t\_0 \leq -\infty:\\
              \;\;\;\;\left(1 + re\right) \cdot \mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)\\
              
              \mathbf{elif}\;t\_0 \leq -0.02 \lor \neg \left(t\_0 \leq 10^{-78} \lor \neg \left(t\_0 \leq 1\right)\right):\\
              \;\;\;\;\left(1 + re\right) \cdot \sin im\\
              
              \mathbf{else}:\\
              \;\;\;\;e^{re} \cdot im\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -inf.0

                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                1. Initial program 100.0%

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

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

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

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

                if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 9.99999999999999999e-79 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. *-commutativeN/A

                    \[\leadsto \color{blue}{e^{re} \cdot im} \]
                  2. lower-*.f64N/A

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

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

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

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

              Alternative 5: 86.2% accurate, 0.2× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{re} \cdot \sin im\\ \mathbf{if}\;t\_0 \leq -\infty:\\ \;\;\;\;{im}^{3} \cdot -0.16666666666666666\\ \mathbf{elif}\;t\_0 \leq -0.02 \lor \neg \left(t\_0 \leq 10^{-78} \lor \neg \left(t\_0 \leq 1\right)\right):\\ \;\;\;\;\left(1 + re\right) \cdot \sin im\\ \mathbf{else}:\\ \;\;\;\;e^{re} \cdot im\\ \end{array} \end{array} \]
              (FPCore (re im)
               :precision binary64
               (let* ((t_0 (* (exp re) (sin im))))
                 (if (<= t_0 (- INFINITY))
                   (* (pow im 3.0) -0.16666666666666666)
                   (if (or (<= t_0 -0.02) (not (or (<= t_0 1e-78) (not (<= t_0 1.0)))))
                     (* (+ 1.0 re) (sin im))
                     (* (exp re) im)))))
              double code(double re, double im) {
              	double t_0 = exp(re) * sin(im);
              	double tmp;
              	if (t_0 <= -((double) INFINITY)) {
              		tmp = pow(im, 3.0) * -0.16666666666666666;
              	} else if ((t_0 <= -0.02) || !((t_0 <= 1e-78) || !(t_0 <= 1.0))) {
              		tmp = (1.0 + re) * sin(im);
              	} else {
              		tmp = exp(re) * im;
              	}
              	return tmp;
              }
              
              public static double code(double re, double im) {
              	double t_0 = Math.exp(re) * Math.sin(im);
              	double tmp;
              	if (t_0 <= -Double.POSITIVE_INFINITY) {
              		tmp = Math.pow(im, 3.0) * -0.16666666666666666;
              	} else if ((t_0 <= -0.02) || !((t_0 <= 1e-78) || !(t_0 <= 1.0))) {
              		tmp = (1.0 + re) * Math.sin(im);
              	} else {
              		tmp = Math.exp(re) * im;
              	}
              	return tmp;
              }
              
              def code(re, im):
              	t_0 = math.exp(re) * math.sin(im)
              	tmp = 0
              	if t_0 <= -math.inf:
              		tmp = math.pow(im, 3.0) * -0.16666666666666666
              	elif (t_0 <= -0.02) or not ((t_0 <= 1e-78) or not (t_0 <= 1.0)):
              		tmp = (1.0 + re) * math.sin(im)
              	else:
              		tmp = math.exp(re) * im
              	return tmp
              
              function code(re, im)
              	t_0 = Float64(exp(re) * sin(im))
              	tmp = 0.0
              	if (t_0 <= Float64(-Inf))
              		tmp = Float64((im ^ 3.0) * -0.16666666666666666);
              	elseif ((t_0 <= -0.02) || !((t_0 <= 1e-78) || !(t_0 <= 1.0)))
              		tmp = Float64(Float64(1.0 + re) * sin(im));
              	else
              		tmp = Float64(exp(re) * im);
              	end
              	return tmp
              end
              
              function tmp_2 = code(re, im)
              	t_0 = exp(re) * sin(im);
              	tmp = 0.0;
              	if (t_0 <= -Inf)
              		tmp = (im ^ 3.0) * -0.16666666666666666;
              	elseif ((t_0 <= -0.02) || ~(((t_0 <= 1e-78) || ~((t_0 <= 1.0)))))
              		tmp = (1.0 + re) * sin(im);
              	else
              		tmp = exp(re) * im;
              	end
              	tmp_2 = 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[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision], If[Or[LessEqual[t$95$0, -0.02], N[Not[Or[LessEqual[t$95$0, 1e-78], N[Not[LessEqual[t$95$0, 1.0]], $MachinePrecision]]], $MachinePrecision]], N[(N[(1.0 + re), $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision], N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := e^{re} \cdot \sin im\\
              \mathbf{if}\;t\_0 \leq -\infty:\\
              \;\;\;\;{im}^{3} \cdot -0.16666666666666666\\
              
              \mathbf{elif}\;t\_0 \leq -0.02 \lor \neg \left(t\_0 \leq 10^{-78} \lor \neg \left(t\_0 \leq 1\right)\right):\\
              \;\;\;\;\left(1 + re\right) \cdot \sin im\\
              
              \mathbf{else}:\\
              \;\;\;\;e^{re} \cdot im\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -inf.0

                1. Initial program 100.0%

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

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

                    \[\leadsto \color{blue}{\sin im} \]
                5. Applied rewrites2.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 rewrites15.5%

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

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

                      \[\leadsto {im}^{3} \cdot -0.16666666666666666 \]

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

                    1. Initial program 100.0%

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

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

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

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

                    if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 9.99999999999999999e-79 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. *-commutativeN/A

                        \[\leadsto \color{blue}{e^{re} \cdot im} \]
                      2. lower-*.f64N/A

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

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

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

                    \[\leadsto \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq -\infty:\\ \;\;\;\;{im}^{3} \cdot -0.16666666666666666\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq -0.02 \lor \neg \left(e^{re} \cdot \sin im \leq 10^{-78} \lor \neg \left(e^{re} \cdot \sin im \leq 1\right)\right):\\ \;\;\;\;\left(1 + re\right) \cdot \sin im\\ \mathbf{else}:\\ \;\;\;\;e^{re} \cdot im\\ \end{array} \]
                  6. Add Preprocessing

                  Alternative 6: 86.0% accurate, 0.2× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{re} \cdot \sin im\\ \mathbf{if}\;t\_0 \leq -\infty:\\ \;\;\;\;{im}^{3} \cdot -0.16666666666666666\\ \mathbf{elif}\;t\_0 \leq -0.02 \lor \neg \left(t\_0 \leq 5 \cdot 10^{-7} \lor \neg \left(t\_0 \leq 1\right)\right):\\ \;\;\;\;\sin im\\ \mathbf{else}:\\ \;\;\;\;e^{re} \cdot im\\ \end{array} \end{array} \]
                  (FPCore (re im)
                   :precision binary64
                   (let* ((t_0 (* (exp re) (sin im))))
                     (if (<= t_0 (- INFINITY))
                       (* (pow im 3.0) -0.16666666666666666)
                       (if (or (<= t_0 -0.02) (not (or (<= t_0 5e-7) (not (<= t_0 1.0)))))
                         (sin im)
                         (* (exp re) im)))))
                  double code(double re, double im) {
                  	double t_0 = exp(re) * sin(im);
                  	double tmp;
                  	if (t_0 <= -((double) INFINITY)) {
                  		tmp = pow(im, 3.0) * -0.16666666666666666;
                  	} else if ((t_0 <= -0.02) || !((t_0 <= 5e-7) || !(t_0 <= 1.0))) {
                  		tmp = sin(im);
                  	} else {
                  		tmp = exp(re) * im;
                  	}
                  	return tmp;
                  }
                  
                  public static double code(double re, double im) {
                  	double t_0 = Math.exp(re) * Math.sin(im);
                  	double tmp;
                  	if (t_0 <= -Double.POSITIVE_INFINITY) {
                  		tmp = Math.pow(im, 3.0) * -0.16666666666666666;
                  	} else if ((t_0 <= -0.02) || !((t_0 <= 5e-7) || !(t_0 <= 1.0))) {
                  		tmp = Math.sin(im);
                  	} else {
                  		tmp = Math.exp(re) * im;
                  	}
                  	return tmp;
                  }
                  
                  def code(re, im):
                  	t_0 = math.exp(re) * math.sin(im)
                  	tmp = 0
                  	if t_0 <= -math.inf:
                  		tmp = math.pow(im, 3.0) * -0.16666666666666666
                  	elif (t_0 <= -0.02) or not ((t_0 <= 5e-7) or not (t_0 <= 1.0)):
                  		tmp = math.sin(im)
                  	else:
                  		tmp = math.exp(re) * im
                  	return tmp
                  
                  function code(re, im)
                  	t_0 = Float64(exp(re) * sin(im))
                  	tmp = 0.0
                  	if (t_0 <= Float64(-Inf))
                  		tmp = Float64((im ^ 3.0) * -0.16666666666666666);
                  	elseif ((t_0 <= -0.02) || !((t_0 <= 5e-7) || !(t_0 <= 1.0)))
                  		tmp = sin(im);
                  	else
                  		tmp = Float64(exp(re) * im);
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(re, im)
                  	t_0 = exp(re) * sin(im);
                  	tmp = 0.0;
                  	if (t_0 <= -Inf)
                  		tmp = (im ^ 3.0) * -0.16666666666666666;
                  	elseif ((t_0 <= -0.02) || ~(((t_0 <= 5e-7) || ~((t_0 <= 1.0)))))
                  		tmp = sin(im);
                  	else
                  		tmp = exp(re) * im;
                  	end
                  	tmp_2 = 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[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision], If[Or[LessEqual[t$95$0, -0.02], N[Not[Or[LessEqual[t$95$0, 5e-7], N[Not[LessEqual[t$95$0, 1.0]], $MachinePrecision]]], $MachinePrecision]], N[Sin[im], $MachinePrecision], N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := e^{re} \cdot \sin im\\
                  \mathbf{if}\;t\_0 \leq -\infty:\\
                  \;\;\;\;{im}^{3} \cdot -0.16666666666666666\\
                  
                  \mathbf{elif}\;t\_0 \leq -0.02 \lor \neg \left(t\_0 \leq 5 \cdot 10^{-7} \lor \neg \left(t\_0 \leq 1\right)\right):\\
                  \;\;\;\;\sin im\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;e^{re} \cdot im\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -inf.0

                    1. Initial program 100.0%

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

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

                        \[\leadsto \color{blue}{\sin im} \]
                    5. Applied rewrites2.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 rewrites15.5%

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

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

                          \[\leadsto {im}^{3} \cdot -0.16666666666666666 \]

                        if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004 or 4.99999999999999977e-7 < (*.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.f6497.4

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

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

                        if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 4.99999999999999977e-7 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. *-commutativeN/A

                            \[\leadsto \color{blue}{e^{re} \cdot im} \]
                          2. lower-*.f64N/A

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

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

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin im \leq -\infty:\\ \;\;\;\;{im}^{3} \cdot -0.16666666666666666\\ \mathbf{elif}\;e^{re} \cdot \sin im \leq -0.02 \lor \neg \left(e^{re} \cdot \sin im \leq 5 \cdot 10^{-7} \lor \neg \left(e^{re} \cdot \sin im \leq 1\right)\right):\\ \;\;\;\;\sin im\\ \mathbf{else}:\\ \;\;\;\;e^{re} \cdot im\\ \end{array} \]
                      6. Add Preprocessing

                      Alternative 7: 86.0% accurate, 0.2× speedup?

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

                        1. Initial program 100.0%

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

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

                            \[\leadsto \color{blue}{\sin im} \]
                        5. Applied rewrites2.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 rewrites15.5%

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

                              \[\leadsto \mathsf{fma}\left(\left(im \cdot im\right) \cdot im, -0.16666666666666666, im\right) \]
                            2. Step-by-step derivation
                              1. Applied rewrites15.5%

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

                              if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.0200000000000000004 or 4.99999999999999977e-7 < (*.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.f6497.4

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

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

                              if -0.0200000000000000004 < (*.f64 (exp.f64 re) (sin.f64 im)) < 4.99999999999999977e-7 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. *-commutativeN/A

                                  \[\leadsto \color{blue}{e^{re} \cdot im} \]
                                2. lower-*.f64N/A

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

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

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

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

                            Alternative 8: 38.6% accurate, 1.0× speedup?

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

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

                                \[\leadsto \color{blue}{\sin im} \]
                              6. Step-by-step derivation
                                1. Applied rewrites5.7%

                                  \[\leadsto \sin \left(-\left(im + \mathsf{PI}\left(\right)\right)\right) \]
                                2. Taylor expanded in im around 0

                                  \[\leadsto \sin \left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right) \]
                                3. Step-by-step derivation
                                  1. Applied rewrites44.0%

                                    \[\leadsto 0 \]

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

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

                                    \[\leadsto \color{blue}{\sin im} \]
                                  6. Step-by-step derivation
                                    1. Applied rewrites3.9%

                                      \[\leadsto \sin \left(-\left(im + \mathsf{PI}\left(\right)\right)\right) \]
                                    2. Taylor expanded in im around 0

                                      \[\leadsto \sin \left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right) + \color{blue}{-1 \cdot \left(im \cdot \cos \left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)\right)} \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites38.9%

                                        \[\leadsto im \]
                                    4. Recombined 2 regimes into one program.
                                    5. Add Preprocessing

                                    Alternative 9: 96.7% accurate, 1.5× speedup?

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

                                      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.f644.3

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

                                        \[\leadsto \color{blue}{\sin im} \]
                                      6. Step-by-step derivation
                                        1. Applied rewrites3.2%

                                          \[\leadsto \sin \left(-\left(im + \mathsf{PI}\left(\right)\right)\right) \]
                                        2. Taylor expanded in im around 0

                                          \[\leadsto \sin \left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right) \]
                                        3. Step-by-step derivation
                                          1. Applied rewrites100.0%

                                            \[\leadsto 0 \]

                                          if -44 < re < 5.2e-22

                                          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, re, 0.5\right), re, 1\right), re, 1\right)} \cdot \sin im \]
                                          6. Step-by-step derivation
                                            1. Applied rewrites99.5%

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

                                              \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot re, re, 1 + re\right) \cdot \sin im \]
                                            3. Step-by-step derivation
                                              1. Applied rewrites99.3%

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

                                              if 5.2e-22 < re < 1.49999999999999997e101

                                              1. Initial program 99.8%

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

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

                                                  \[\leadsto \color{blue}{e^{re} \cdot im} \]
                                                2. lower-*.f64N/A

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

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

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

                                              if 1.49999999999999997e101 < re

                                              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \mathsf{fma}\left(\frac{1}{6} \cdot {re}^{2}, re, 1\right) \cdot \sin im \]
                                              7. Step-by-step derivation
                                                1. Applied rewrites97.5%

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

                                              Alternative 10: 91.6% accurate, 1.6× speedup?

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

                                                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.f644.3

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

                                                  \[\leadsto \color{blue}{\sin im} \]
                                                6. Step-by-step derivation
                                                  1. Applied rewrites3.2%

                                                    \[\leadsto \sin \left(-\left(im + \mathsf{PI}\left(\right)\right)\right) \]
                                                  2. Taylor expanded in im around 0

                                                    \[\leadsto \sin \left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right) \]
                                                  3. Step-by-step derivation
                                                    1. Applied rewrites100.0%

                                                      \[\leadsto 0 \]

                                                    if -1.5800000000000001 < re

                                                    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, re, 0.5\right), re, 1\right), re, 1\right)} \cdot \sin im \]
                                                    6. Step-by-step derivation
                                                      1. Applied rewrites93.7%

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

                                                    Alternative 11: 91.6% accurate, 1.6× speedup?

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

                                                      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.f644.3

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

                                                        \[\leadsto \color{blue}{\sin im} \]
                                                      6. Step-by-step derivation
                                                        1. Applied rewrites3.2%

                                                          \[\leadsto \sin \left(-\left(im + \mathsf{PI}\left(\right)\right)\right) \]
                                                        2. Taylor expanded in im around 0

                                                          \[\leadsto \sin \left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right) \]
                                                        3. Step-by-step derivation
                                                          1. Applied rewrites100.0%

                                                            \[\leadsto 0 \]

                                                          if -1.5800000000000001 < re

                                                          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

                                                        Alternative 12: 54.1% accurate, 1.7× speedup?

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

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

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

                                                            \[\leadsto \color{blue}{\sin im} \]
                                                          6. Step-by-step derivation
                                                            1. Applied rewrites3.1%

                                                              \[\leadsto \sin \left(-\left(im + \mathsf{PI}\left(\right)\right)\right) \]
                                                            2. Taylor expanded in im around 0

                                                              \[\leadsto \sin \left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right) \]
                                                            3. Step-by-step derivation
                                                              1. Applied rewrites97.1%

                                                                \[\leadsto 0 \]

                                                              if 0.99950000000000006 < (exp.f64 re)

                                                              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.f6475.5

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

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

                                                                  \[\leadsto \mathsf{fma}\left({im}^{3}, \color{blue}{-0.16666666666666666}, im\right) \]
                                                                2. Step-by-step derivation
                                                                  1. Applied rewrites47.9%

                                                                    \[\leadsto \mathsf{fma}\left(\left(im \cdot im\right) \cdot im, -0.16666666666666666, im\right) \]
                                                                  2. Step-by-step derivation
                                                                    1. Applied rewrites47.9%

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

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

                                                                  Alternative 13: 78.5% accurate, 1.8× speedup?

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

                                                                    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.f644.3

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

                                                                      \[\leadsto \color{blue}{\sin im} \]
                                                                    6. Step-by-step derivation
                                                                      1. Applied rewrites3.2%

                                                                        \[\leadsto \sin \left(-\left(im + \mathsf{PI}\left(\right)\right)\right) \]
                                                                      2. Taylor expanded in im around 0

                                                                        \[\leadsto \sin \left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right) \]
                                                                      3. Step-by-step derivation
                                                                        1. Applied rewrites100.0%

                                                                          \[\leadsto 0 \]

                                                                        if -44 < re < 1.45e21

                                                                        1. Initial program 100.0%

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

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

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

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

                                                                        if 1.45e21 < re

                                                                        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.f642.7

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

                                                                          \[\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}^{3}, \color{blue}{-0.16666666666666666}, im\right) \]
                                                                          2. Step-by-step derivation
                                                                            1. Applied rewrites28.4%

                                                                              \[\leadsto \mathsf{fma}\left(\left(im \cdot im\right) \cdot im, -0.16666666666666666, im\right) \]
                                                                            2. Step-by-step derivation
                                                                              1. Applied rewrites28.4%

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

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

                                                                            Alternative 14: 27.6% accurate, 206.0× speedup?

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

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

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

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

                                                                              \[\leadsto \color{blue}{\sin im} \]
                                                                            6. Step-by-step derivation
                                                                              1. Applied rewrites5.0%

                                                                                \[\leadsto \sin \left(-\left(im + \mathsf{PI}\left(\right)\right)\right) \]
                                                                              2. Taylor expanded in im around 0

                                                                                \[\leadsto \sin \left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right) \]
                                                                              3. Step-by-step derivation
                                                                                1. Applied rewrites27.7%

                                                                                  \[\leadsto 0 \]
                                                                                2. Add Preprocessing

                                                                                Reproduce

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