math.exp on complex, imaginary part

Percentage Accurate: 100.0% → 100.0%
Time: 9.5s
Alternatives: 22
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 22 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: 97.2% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{re} \cdot im\\ t_1 := \sin im \cdot \left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right)\\ \mathbf{if}\;re \leq -0.1:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;re \leq 1.85 \cdot 10^{-13}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;re \leq 1.05 \cdot 10^{+103}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* (exp re) im))
        (t_1
         (*
          (sin im)
          (+ (* re (+ (* re (+ 0.5 (* re 0.16666666666666666))) 1.0)) 1.0))))
   (if (<= re -0.1)
     t_0
     (if (<= re 1.85e-13) t_1 (if (<= re 1.05e+103) t_0 t_1)))))
double code(double re, double im) {
	double t_0 = exp(re) * im;
	double t_1 = sin(im) * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
	double tmp;
	if (re <= -0.1) {
		tmp = t_0;
	} else if (re <= 1.85e-13) {
		tmp = t_1;
	} else if (re <= 1.05e+103) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = exp(re) * im
    t_1 = sin(im) * ((re * ((re * (0.5d0 + (re * 0.16666666666666666d0))) + 1.0d0)) + 1.0d0)
    if (re <= (-0.1d0)) then
        tmp = t_0
    else if (re <= 1.85d-13) then
        tmp = t_1
    else if (re <= 1.05d+103) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = Math.exp(re) * im;
	double t_1 = Math.sin(im) * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
	double tmp;
	if (re <= -0.1) {
		tmp = t_0;
	} else if (re <= 1.85e-13) {
		tmp = t_1;
	} else if (re <= 1.05e+103) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(re, im):
	t_0 = math.exp(re) * im
	t_1 = math.sin(im) * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0)
	tmp = 0
	if re <= -0.1:
		tmp = t_0
	elif re <= 1.85e-13:
		tmp = t_1
	elif re <= 1.05e+103:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(re, im)
	t_0 = Float64(exp(re) * im)
	t_1 = Float64(sin(im) * Float64(Float64(re * Float64(Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666))) + 1.0)) + 1.0))
	tmp = 0.0
	if (re <= -0.1)
		tmp = t_0;
	elseif (re <= 1.85e-13)
		tmp = t_1;
	elseif (re <= 1.05e+103)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = exp(re) * im;
	t_1 = sin(im) * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
	tmp = 0.0;
	if (re <= -0.1)
		tmp = t_0;
	elseif (re <= 1.85e-13)
		tmp = t_1;
	elseif (re <= 1.05e+103)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[im], $MachinePrecision] * N[(N[(re * N[(N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -0.1], t$95$0, If[LessEqual[re, 1.85e-13], t$95$1, If[LessEqual[re, 1.05e+103], t$95$0, t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;re \leq 1.85 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;re \leq 1.05 \cdot 10^{+103}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if re < -0.10000000000000001 or 1.84999999999999994e-13 < re < 1.0500000000000001e103

    1. Initial program 99.9%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
    4. Step-by-step derivation
      1. Simplified94.8%

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

      if -0.10000000000000001 < re < 1.84999999999999994e-13 or 1.0500000000000001e103 < re

      1. Initial program 100.0%

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

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

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

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

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
        7. *-lowering-*.f6499.8%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
      5. Simplified99.8%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -0.1:\\ \;\;\;\;e^{re} \cdot im\\ \mathbf{elif}\;re \leq 1.85 \cdot 10^{-13}:\\ \;\;\;\;\sin im \cdot \left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right)\\ \mathbf{elif}\;re \leq 1.05 \cdot 10^{+103}:\\ \;\;\;\;e^{re} \cdot im\\ \mathbf{else}:\\ \;\;\;\;\sin im \cdot \left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right)\\ \end{array} \]
    7. Add Preprocessing

    Alternative 3: 96.0% accurate, 1.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{re} \cdot im\\ t_1 := \sin im \cdot \left(re \cdot \left(re \cdot 0.5 + 1\right) + 1\right)\\ \mathbf{if}\;re \leq -580:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;re \leq 1.85 \cdot 10^{-13}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;re \leq 1.1 \cdot 10^{+152}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (re im)
     :precision binary64
     (let* ((t_0 (* (exp re) im))
            (t_1 (* (sin im) (+ (* re (+ (* re 0.5) 1.0)) 1.0))))
       (if (<= re -580.0)
         t_0
         (if (<= re 1.85e-13) t_1 (if (<= re 1.1e+152) t_0 t_1)))))
    double code(double re, double im) {
    	double t_0 = exp(re) * im;
    	double t_1 = sin(im) * ((re * ((re * 0.5) + 1.0)) + 1.0);
    	double tmp;
    	if (re <= -580.0) {
    		tmp = t_0;
    	} else if (re <= 1.85e-13) {
    		tmp = t_1;
    	} else if (re <= 1.1e+152) {
    		tmp = t_0;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    real(8) function code(re, im)
        real(8), intent (in) :: re
        real(8), intent (in) :: im
        real(8) :: t_0
        real(8) :: t_1
        real(8) :: tmp
        t_0 = exp(re) * im
        t_1 = sin(im) * ((re * ((re * 0.5d0) + 1.0d0)) + 1.0d0)
        if (re <= (-580.0d0)) then
            tmp = t_0
        else if (re <= 1.85d-13) then
            tmp = t_1
        else if (re <= 1.1d+152) then
            tmp = t_0
        else
            tmp = t_1
        end if
        code = tmp
    end function
    
    public static double code(double re, double im) {
    	double t_0 = Math.exp(re) * im;
    	double t_1 = Math.sin(im) * ((re * ((re * 0.5) + 1.0)) + 1.0);
    	double tmp;
    	if (re <= -580.0) {
    		tmp = t_0;
    	} else if (re <= 1.85e-13) {
    		tmp = t_1;
    	} else if (re <= 1.1e+152) {
    		tmp = t_0;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(re, im):
    	t_0 = math.exp(re) * im
    	t_1 = math.sin(im) * ((re * ((re * 0.5) + 1.0)) + 1.0)
    	tmp = 0
    	if re <= -580.0:
    		tmp = t_0
    	elif re <= 1.85e-13:
    		tmp = t_1
    	elif re <= 1.1e+152:
    		tmp = t_0
    	else:
    		tmp = t_1
    	return tmp
    
    function code(re, im)
    	t_0 = Float64(exp(re) * im)
    	t_1 = Float64(sin(im) * Float64(Float64(re * Float64(Float64(re * 0.5) + 1.0)) + 1.0))
    	tmp = 0.0
    	if (re <= -580.0)
    		tmp = t_0;
    	elseif (re <= 1.85e-13)
    		tmp = t_1;
    	elseif (re <= 1.1e+152)
    		tmp = t_0;
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(re, im)
    	t_0 = exp(re) * im;
    	t_1 = sin(im) * ((re * ((re * 0.5) + 1.0)) + 1.0);
    	tmp = 0.0;
    	if (re <= -580.0)
    		tmp = t_0;
    	elseif (re <= 1.85e-13)
    		tmp = t_1;
    	elseif (re <= 1.1e+152)
    		tmp = t_0;
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[im], $MachinePrecision] * N[(N[(re * N[(N[(re * 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -580.0], t$95$0, If[LessEqual[re, 1.85e-13], t$95$1, If[LessEqual[re, 1.1e+152], t$95$0, t$95$1]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := e^{re} \cdot im\\
    t_1 := \sin im \cdot \left(re \cdot \left(re \cdot 0.5 + 1\right) + 1\right)\\
    \mathbf{if}\;re \leq -580:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;re \leq 1.85 \cdot 10^{-13}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;re \leq 1.1 \cdot 10^{+152}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if re < -580 or 1.84999999999999994e-13 < re < 1.0999999999999999e152

      1. Initial program 99.9%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
      4. Step-by-step derivation
        1. Simplified91.5%

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

        if -580 < re < 1.84999999999999994e-13 or 1.0999999999999999e152 < re

        1. Initial program 100.0%

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(1 + \frac{1}{2} \cdot re\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
          3. +-lowering-+.f64N/A

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
          5. *-lowering-*.f6498.4%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
        5. Simplified98.4%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -580:\\ \;\;\;\;e^{re} \cdot im\\ \mathbf{elif}\;re \leq 1.85 \cdot 10^{-13}:\\ \;\;\;\;\sin im \cdot \left(re \cdot \left(re \cdot 0.5 + 1\right) + 1\right)\\ \mathbf{elif}\;re \leq 1.1 \cdot 10^{+152}:\\ \;\;\;\;e^{re} \cdot im\\ \mathbf{else}:\\ \;\;\;\;\sin im \cdot \left(re \cdot \left(re \cdot 0.5 + 1\right) + 1\right)\\ \end{array} \]
      7. Add Preprocessing

      Alternative 4: 92.4% accurate, 1.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{re} \cdot im\\ \mathbf{if}\;re \leq -0.18:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;re \leq 1.85 \cdot 10^{-13}:\\ \;\;\;\;\sin im \cdot \left(re + 1\right)\\ \mathbf{elif}\;re \leq 4 \cdot 10^{+110}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot -0.16666666666666666\right) + 1\right)\right)\\ \end{array} \end{array} \]
      (FPCore (re im)
       :precision binary64
       (let* ((t_0 (* (exp re) im)))
         (if (<= re -0.18)
           t_0
           (if (<= re 1.85e-13)
             (* (sin im) (+ re 1.0))
             (if (<= re 4e+110)
               t_0
               (*
                (+ (* re (+ (* re (+ 0.5 (* re 0.16666666666666666))) 1.0)) 1.0)
                (* im (+ (* im (* im -0.16666666666666666)) 1.0))))))))
      double code(double re, double im) {
      	double t_0 = exp(re) * im;
      	double tmp;
      	if (re <= -0.18) {
      		tmp = t_0;
      	} else if (re <= 1.85e-13) {
      		tmp = sin(im) * (re + 1.0);
      	} else if (re <= 4e+110) {
      		tmp = t_0;
      	} else {
      		tmp = ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0) * (im * ((im * (im * -0.16666666666666666)) + 1.0));
      	}
      	return tmp;
      }
      
      real(8) function code(re, im)
          real(8), intent (in) :: re
          real(8), intent (in) :: im
          real(8) :: t_0
          real(8) :: tmp
          t_0 = exp(re) * im
          if (re <= (-0.18d0)) then
              tmp = t_0
          else if (re <= 1.85d-13) then
              tmp = sin(im) * (re + 1.0d0)
          else if (re <= 4d+110) then
              tmp = t_0
          else
              tmp = ((re * ((re * (0.5d0 + (re * 0.16666666666666666d0))) + 1.0d0)) + 1.0d0) * (im * ((im * (im * (-0.16666666666666666d0))) + 1.0d0))
          end if
          code = tmp
      end function
      
      public static double code(double re, double im) {
      	double t_0 = Math.exp(re) * im;
      	double tmp;
      	if (re <= -0.18) {
      		tmp = t_0;
      	} else if (re <= 1.85e-13) {
      		tmp = Math.sin(im) * (re + 1.0);
      	} else if (re <= 4e+110) {
      		tmp = t_0;
      	} else {
      		tmp = ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0) * (im * ((im * (im * -0.16666666666666666)) + 1.0));
      	}
      	return tmp;
      }
      
      def code(re, im):
      	t_0 = math.exp(re) * im
      	tmp = 0
      	if re <= -0.18:
      		tmp = t_0
      	elif re <= 1.85e-13:
      		tmp = math.sin(im) * (re + 1.0)
      	elif re <= 4e+110:
      		tmp = t_0
      	else:
      		tmp = ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0) * (im * ((im * (im * -0.16666666666666666)) + 1.0))
      	return tmp
      
      function code(re, im)
      	t_0 = Float64(exp(re) * im)
      	tmp = 0.0
      	if (re <= -0.18)
      		tmp = t_0;
      	elseif (re <= 1.85e-13)
      		tmp = Float64(sin(im) * Float64(re + 1.0));
      	elseif (re <= 4e+110)
      		tmp = t_0;
      	else
      		tmp = Float64(Float64(Float64(re * Float64(Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666))) + 1.0)) + 1.0) * Float64(im * Float64(Float64(im * Float64(im * -0.16666666666666666)) + 1.0)));
      	end
      	return tmp
      end
      
      function tmp_2 = code(re, im)
      	t_0 = exp(re) * im;
      	tmp = 0.0;
      	if (re <= -0.18)
      		tmp = t_0;
      	elseif (re <= 1.85e-13)
      		tmp = sin(im) * (re + 1.0);
      	elseif (re <= 4e+110)
      		tmp = t_0;
      	else
      		tmp = ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0) * (im * ((im * (im * -0.16666666666666666)) + 1.0));
      	end
      	tmp_2 = tmp;
      end
      
      code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[re, -0.18], t$95$0, If[LessEqual[re, 1.85e-13], N[(N[Sin[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 4e+110], t$95$0, N[(N[(N[(re * N[(N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(im * N[(N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := e^{re} \cdot im\\
      \mathbf{if}\;re \leq -0.18:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;re \leq 1.85 \cdot 10^{-13}:\\
      \;\;\;\;\sin im \cdot \left(re + 1\right)\\
      
      \mathbf{elif}\;re \leq 4 \cdot 10^{+110}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot -0.16666666666666666\right) + 1\right)\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if re < -0.17999999999999999 or 1.84999999999999994e-13 < re < 4.0000000000000001e110

        1. Initial program 99.9%

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
        4. Step-by-step derivation
          1. Simplified93.9%

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

          if -0.17999999999999999 < re < 1.84999999999999994e-13

          1. Initial program 100.0%

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

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

              \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \mathsf{sin.f64}\left(\color{blue}{im}\right)\right) \]
            2. +-lowering-+.f6499.2%

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

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

          if 4.0000000000000001e110 < re

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right) \]
            16. *-lowering-*.f6478.9%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right) \]
          5. Simplified78.9%

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{-1}{6}\right)\right)\right)\right)\right) \]
            7. *-lowering-*.f6478.9%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{-1}{6}\right)\right)\right)\right)\right) \]
          8. Simplified78.9%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -0.18:\\ \;\;\;\;e^{re} \cdot im\\ \mathbf{elif}\;re \leq 1.85 \cdot 10^{-13}:\\ \;\;\;\;\sin im \cdot \left(re + 1\right)\\ \mathbf{elif}\;re \leq 4 \cdot 10^{+110}:\\ \;\;\;\;e^{re} \cdot im\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot -0.16666666666666666\right) + 1\right)\right)\\ \end{array} \]
        7. Add Preprocessing

        Alternative 5: 91.9% accurate, 1.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{re} \cdot im\\ \mathbf{if}\;re \leq -580:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;re \leq 1.85 \cdot 10^{-13}:\\ \;\;\;\;\sin im\\ \mathbf{elif}\;re \leq 4 \cdot 10^{+110}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot -0.16666666666666666\right) + 1\right)\right)\\ \end{array} \end{array} \]
        (FPCore (re im)
         :precision binary64
         (let* ((t_0 (* (exp re) im)))
           (if (<= re -580.0)
             t_0
             (if (<= re 1.85e-13)
               (sin im)
               (if (<= re 4e+110)
                 t_0
                 (*
                  (+ (* re (+ (* re (+ 0.5 (* re 0.16666666666666666))) 1.0)) 1.0)
                  (* im (+ (* im (* im -0.16666666666666666)) 1.0))))))))
        double code(double re, double im) {
        	double t_0 = exp(re) * im;
        	double tmp;
        	if (re <= -580.0) {
        		tmp = t_0;
        	} else if (re <= 1.85e-13) {
        		tmp = sin(im);
        	} else if (re <= 4e+110) {
        		tmp = t_0;
        	} else {
        		tmp = ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0) * (im * ((im * (im * -0.16666666666666666)) + 1.0));
        	}
        	return tmp;
        }
        
        real(8) function code(re, im)
            real(8), intent (in) :: re
            real(8), intent (in) :: im
            real(8) :: t_0
            real(8) :: tmp
            t_0 = exp(re) * im
            if (re <= (-580.0d0)) then
                tmp = t_0
            else if (re <= 1.85d-13) then
                tmp = sin(im)
            else if (re <= 4d+110) then
                tmp = t_0
            else
                tmp = ((re * ((re * (0.5d0 + (re * 0.16666666666666666d0))) + 1.0d0)) + 1.0d0) * (im * ((im * (im * (-0.16666666666666666d0))) + 1.0d0))
            end if
            code = tmp
        end function
        
        public static double code(double re, double im) {
        	double t_0 = Math.exp(re) * im;
        	double tmp;
        	if (re <= -580.0) {
        		tmp = t_0;
        	} else if (re <= 1.85e-13) {
        		tmp = Math.sin(im);
        	} else if (re <= 4e+110) {
        		tmp = t_0;
        	} else {
        		tmp = ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0) * (im * ((im * (im * -0.16666666666666666)) + 1.0));
        	}
        	return tmp;
        }
        
        def code(re, im):
        	t_0 = math.exp(re) * im
        	tmp = 0
        	if re <= -580.0:
        		tmp = t_0
        	elif re <= 1.85e-13:
        		tmp = math.sin(im)
        	elif re <= 4e+110:
        		tmp = t_0
        	else:
        		tmp = ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0) * (im * ((im * (im * -0.16666666666666666)) + 1.0))
        	return tmp
        
        function code(re, im)
        	t_0 = Float64(exp(re) * im)
        	tmp = 0.0
        	if (re <= -580.0)
        		tmp = t_0;
        	elseif (re <= 1.85e-13)
        		tmp = sin(im);
        	elseif (re <= 4e+110)
        		tmp = t_0;
        	else
        		tmp = Float64(Float64(Float64(re * Float64(Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666))) + 1.0)) + 1.0) * Float64(im * Float64(Float64(im * Float64(im * -0.16666666666666666)) + 1.0)));
        	end
        	return tmp
        end
        
        function tmp_2 = code(re, im)
        	t_0 = exp(re) * im;
        	tmp = 0.0;
        	if (re <= -580.0)
        		tmp = t_0;
        	elseif (re <= 1.85e-13)
        		tmp = sin(im);
        	elseif (re <= 4e+110)
        		tmp = t_0;
        	else
        		tmp = ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0) * (im * ((im * (im * -0.16666666666666666)) + 1.0));
        	end
        	tmp_2 = tmp;
        end
        
        code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[re, -580.0], t$95$0, If[LessEqual[re, 1.85e-13], N[Sin[im], $MachinePrecision], If[LessEqual[re, 4e+110], t$95$0, N[(N[(N[(re * N[(N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(im * N[(N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := e^{re} \cdot im\\
        \mathbf{if}\;re \leq -580:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;re \leq 1.85 \cdot 10^{-13}:\\
        \;\;\;\;\sin im\\
        
        \mathbf{elif}\;re \leq 4 \cdot 10^{+110}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot -0.16666666666666666\right) + 1\right)\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if re < -580 or 1.84999999999999994e-13 < re < 4.0000000000000001e110

          1. Initial program 99.9%

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
          4. Step-by-step derivation
            1. Simplified94.8%

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

            if -580 < re < 1.84999999999999994e-13

            1. Initial program 100.0%

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

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

                \[\leadsto \mathsf{sin.f64}\left(im\right) \]
            5. Simplified98.0%

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

            if 4.0000000000000001e110 < re

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right) \]
              16. *-lowering-*.f6478.9%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right) \]
            5. Simplified78.9%

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{-1}{6}\right)\right)\right)\right)\right) \]
              7. *-lowering-*.f6478.9%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{-1}{6}\right)\right)\right)\right)\right) \]
            8. Simplified78.9%

              \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)} \cdot \left(im \cdot \left(1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right) \]
          5. Recombined 3 regimes into one program.
          6. Final simplification94.0%

            \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -580:\\ \;\;\;\;e^{re} \cdot im\\ \mathbf{elif}\;re \leq 1.85 \cdot 10^{-13}:\\ \;\;\;\;\sin im\\ \mathbf{elif}\;re \leq 4 \cdot 10^{+110}:\\ \;\;\;\;e^{re} \cdot im\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot -0.16666666666666666\right) + 1\right)\right)\\ \end{array} \]
          7. Add Preprocessing

          Alternative 6: 67.1% accurate, 1.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := im \cdot \left(im \cdot -0.16666666666666666\right)\\ \mathbf{if}\;re \leq -580:\\ \;\;\;\;\left(re \cdot \left(re \cdot 0.5 + 1\right) + 1\right) \cdot \left(im \cdot t\_0\right)\\ \mathbf{elif}\;re \leq 1050:\\ \;\;\;\;\sin im\\ \mathbf{elif}\;re \leq 1.5 \cdot 10^{+82}:\\ \;\;\;\;im \cdot \left(im \cdot \left(im \cdot \left(-0.16666666666666666 + \left(im \cdot im\right) \cdot 0.008333333333333333\right)\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right) \cdot \left(im \cdot \left(t\_0 + 1\right)\right)\\ \end{array} \end{array} \]
          (FPCore (re im)
           :precision binary64
           (let* ((t_0 (* im (* im -0.16666666666666666))))
             (if (<= re -580.0)
               (* (+ (* re (+ (* re 0.5) 1.0)) 1.0) (* im t_0))
               (if (<= re 1050.0)
                 (sin im)
                 (if (<= re 1.5e+82)
                   (*
                    im
                    (+
                     (*
                      im
                      (* im (+ -0.16666666666666666 (* (* im im) 0.008333333333333333))))
                     1.0))
                   (*
                    (+ (* re (+ (* re (+ 0.5 (* re 0.16666666666666666))) 1.0)) 1.0)
                    (* im (+ t_0 1.0))))))))
          double code(double re, double im) {
          	double t_0 = im * (im * -0.16666666666666666);
          	double tmp;
          	if (re <= -580.0) {
          		tmp = ((re * ((re * 0.5) + 1.0)) + 1.0) * (im * t_0);
          	} else if (re <= 1050.0) {
          		tmp = sin(im);
          	} else if (re <= 1.5e+82) {
          		tmp = im * ((im * (im * (-0.16666666666666666 + ((im * im) * 0.008333333333333333)))) + 1.0);
          	} else {
          		tmp = ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0) * (im * (t_0 + 1.0));
          	}
          	return tmp;
          }
          
          real(8) function code(re, im)
              real(8), intent (in) :: re
              real(8), intent (in) :: im
              real(8) :: t_0
              real(8) :: tmp
              t_0 = im * (im * (-0.16666666666666666d0))
              if (re <= (-580.0d0)) then
                  tmp = ((re * ((re * 0.5d0) + 1.0d0)) + 1.0d0) * (im * t_0)
              else if (re <= 1050.0d0) then
                  tmp = sin(im)
              else if (re <= 1.5d+82) then
                  tmp = im * ((im * (im * ((-0.16666666666666666d0) + ((im * im) * 0.008333333333333333d0)))) + 1.0d0)
              else
                  tmp = ((re * ((re * (0.5d0 + (re * 0.16666666666666666d0))) + 1.0d0)) + 1.0d0) * (im * (t_0 + 1.0d0))
              end if
              code = tmp
          end function
          
          public static double code(double re, double im) {
          	double t_0 = im * (im * -0.16666666666666666);
          	double tmp;
          	if (re <= -580.0) {
          		tmp = ((re * ((re * 0.5) + 1.0)) + 1.0) * (im * t_0);
          	} else if (re <= 1050.0) {
          		tmp = Math.sin(im);
          	} else if (re <= 1.5e+82) {
          		tmp = im * ((im * (im * (-0.16666666666666666 + ((im * im) * 0.008333333333333333)))) + 1.0);
          	} else {
          		tmp = ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0) * (im * (t_0 + 1.0));
          	}
          	return tmp;
          }
          
          def code(re, im):
          	t_0 = im * (im * -0.16666666666666666)
          	tmp = 0
          	if re <= -580.0:
          		tmp = ((re * ((re * 0.5) + 1.0)) + 1.0) * (im * t_0)
          	elif re <= 1050.0:
          		tmp = math.sin(im)
          	elif re <= 1.5e+82:
          		tmp = im * ((im * (im * (-0.16666666666666666 + ((im * im) * 0.008333333333333333)))) + 1.0)
          	else:
          		tmp = ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0) * (im * (t_0 + 1.0))
          	return tmp
          
          function code(re, im)
          	t_0 = Float64(im * Float64(im * -0.16666666666666666))
          	tmp = 0.0
          	if (re <= -580.0)
          		tmp = Float64(Float64(Float64(re * Float64(Float64(re * 0.5) + 1.0)) + 1.0) * Float64(im * t_0));
          	elseif (re <= 1050.0)
          		tmp = sin(im);
          	elseif (re <= 1.5e+82)
          		tmp = Float64(im * Float64(Float64(im * Float64(im * Float64(-0.16666666666666666 + Float64(Float64(im * im) * 0.008333333333333333)))) + 1.0));
          	else
          		tmp = Float64(Float64(Float64(re * Float64(Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666))) + 1.0)) + 1.0) * Float64(im * Float64(t_0 + 1.0)));
          	end
          	return tmp
          end
          
          function tmp_2 = code(re, im)
          	t_0 = im * (im * -0.16666666666666666);
          	tmp = 0.0;
          	if (re <= -580.0)
          		tmp = ((re * ((re * 0.5) + 1.0)) + 1.0) * (im * t_0);
          	elseif (re <= 1050.0)
          		tmp = sin(im);
          	elseif (re <= 1.5e+82)
          		tmp = im * ((im * (im * (-0.16666666666666666 + ((im * im) * 0.008333333333333333)))) + 1.0);
          	else
          		tmp = ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0) * (im * (t_0 + 1.0));
          	end
          	tmp_2 = tmp;
          end
          
          code[re_, im_] := Block[{t$95$0 = N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -580.0], N[(N[(N[(re * N[(N[(re * 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(im * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1050.0], N[Sin[im], $MachinePrecision], If[LessEqual[re, 1.5e+82], N[(im * N[(N[(im * N[(im * N[(-0.16666666666666666 + N[(N[(im * im), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(re * N[(N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(im * N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := im \cdot \left(im \cdot -0.16666666666666666\right)\\
          \mathbf{if}\;re \leq -580:\\
          \;\;\;\;\left(re \cdot \left(re \cdot 0.5 + 1\right) + 1\right) \cdot \left(im \cdot t\_0\right)\\
          
          \mathbf{elif}\;re \leq 1050:\\
          \;\;\;\;\sin im\\
          
          \mathbf{elif}\;re \leq 1.5 \cdot 10^{+82}:\\
          \;\;\;\;im \cdot \left(im \cdot \left(im \cdot \left(-0.16666666666666666 + \left(im \cdot im\right) \cdot 0.008333333333333333\right)\right) + 1\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right) \cdot \left(im \cdot \left(t\_0 + 1\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if re < -580

            1. Initial program 100.0%

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(1 + \frac{1}{2} \cdot re\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
              3. +-lowering-+.f64N/A

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
              5. *-lowering-*.f642.2%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
            5. Simplified2.2%

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right)\right) \]
              5. *-lowering-*.f642.0%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right)\right) \]
            8. Simplified2.0%

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\frac{-1}{6}}\right)\right)\right)\right) \]
              12. *-lowering-*.f6419.9%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{-1}{6}}\right)\right)\right)\right) \]
            11. Simplified19.9%

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

            if -580 < re < 1050

            1. Initial program 99.9%

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

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

                \[\leadsto \mathsf{sin.f64}\left(im\right) \]
            5. Simplified95.7%

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

            if 1050 < re < 1.49999999999999995e82

            1. Initial program 100.0%

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

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

                \[\leadsto \mathsf{sin.f64}\left(im\right) \]
            5. Simplified2.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{120}\right)\right)\right)\right)\right)\right) \]
              14. *-lowering-*.f6456.2%

                \[\leadsto \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{120}\right)\right)\right)\right)\right)\right) \]
            8. Simplified56.2%

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

            if 1.49999999999999995e82 < re

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right) \]
              16. *-lowering-*.f6479.1%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right) \]
            5. Simplified79.1%

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{-1}{6}\right)\right)\right)\right)\right) \]
              7. *-lowering-*.f6474.6%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{-1}{6}\right)\right)\right)\right)\right) \]
            8. Simplified74.6%

              \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)} \cdot \left(im \cdot \left(1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right) \]
          3. Recombined 4 regimes into one program.
          4. Final simplification69.0%

            \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -580:\\ \;\;\;\;\left(re \cdot \left(re \cdot 0.5 + 1\right) + 1\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\ \mathbf{elif}\;re \leq 1050:\\ \;\;\;\;\sin im\\ \mathbf{elif}\;re \leq 1.5 \cdot 10^{+82}:\\ \;\;\;\;im \cdot \left(im \cdot \left(im \cdot \left(-0.16666666666666666 + \left(im \cdot im\right) \cdot 0.008333333333333333\right)\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot -0.16666666666666666\right) + 1\right)\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 7: 42.4% accurate, 6.1× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := im \cdot \left(im \cdot -0.16666666666666666\right)\\ \mathbf{if}\;re \leq -2.8 \cdot 10^{-14}:\\ \;\;\;\;\left(re \cdot \left(re \cdot 0.5 + 1\right) + 1\right) \cdot \left(im \cdot t\_0\right)\\ \mathbf{elif}\;re \leq 1.35 \cdot 10^{+82}:\\ \;\;\;\;im + \left(im \cdot im\right) \cdot \left(im \cdot \left(-0.16666666666666666 + \left(im \cdot im\right) \cdot 0.008333333333333333\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right) \cdot \left(im \cdot \left(t\_0 + 1\right)\right)\\ \end{array} \end{array} \]
          (FPCore (re im)
           :precision binary64
           (let* ((t_0 (* im (* im -0.16666666666666666))))
             (if (<= re -2.8e-14)
               (* (+ (* re (+ (* re 0.5) 1.0)) 1.0) (* im t_0))
               (if (<= re 1.35e+82)
                 (+
                  im
                  (*
                   (* im im)
                   (* im (+ -0.16666666666666666 (* (* im im) 0.008333333333333333)))))
                 (*
                  (+ (* re (+ (* re (+ 0.5 (* re 0.16666666666666666))) 1.0)) 1.0)
                  (* im (+ t_0 1.0)))))))
          double code(double re, double im) {
          	double t_0 = im * (im * -0.16666666666666666);
          	double tmp;
          	if (re <= -2.8e-14) {
          		tmp = ((re * ((re * 0.5) + 1.0)) + 1.0) * (im * t_0);
          	} else if (re <= 1.35e+82) {
          		tmp = im + ((im * im) * (im * (-0.16666666666666666 + ((im * im) * 0.008333333333333333))));
          	} else {
          		tmp = ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0) * (im * (t_0 + 1.0));
          	}
          	return tmp;
          }
          
          real(8) function code(re, im)
              real(8), intent (in) :: re
              real(8), intent (in) :: im
              real(8) :: t_0
              real(8) :: tmp
              t_0 = im * (im * (-0.16666666666666666d0))
              if (re <= (-2.8d-14)) then
                  tmp = ((re * ((re * 0.5d0) + 1.0d0)) + 1.0d0) * (im * t_0)
              else if (re <= 1.35d+82) then
                  tmp = im + ((im * im) * (im * ((-0.16666666666666666d0) + ((im * im) * 0.008333333333333333d0))))
              else
                  tmp = ((re * ((re * (0.5d0 + (re * 0.16666666666666666d0))) + 1.0d0)) + 1.0d0) * (im * (t_0 + 1.0d0))
              end if
              code = tmp
          end function
          
          public static double code(double re, double im) {
          	double t_0 = im * (im * -0.16666666666666666);
          	double tmp;
          	if (re <= -2.8e-14) {
          		tmp = ((re * ((re * 0.5) + 1.0)) + 1.0) * (im * t_0);
          	} else if (re <= 1.35e+82) {
          		tmp = im + ((im * im) * (im * (-0.16666666666666666 + ((im * im) * 0.008333333333333333))));
          	} else {
          		tmp = ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0) * (im * (t_0 + 1.0));
          	}
          	return tmp;
          }
          
          def code(re, im):
          	t_0 = im * (im * -0.16666666666666666)
          	tmp = 0
          	if re <= -2.8e-14:
          		tmp = ((re * ((re * 0.5) + 1.0)) + 1.0) * (im * t_0)
          	elif re <= 1.35e+82:
          		tmp = im + ((im * im) * (im * (-0.16666666666666666 + ((im * im) * 0.008333333333333333))))
          	else:
          		tmp = ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0) * (im * (t_0 + 1.0))
          	return tmp
          
          function code(re, im)
          	t_0 = Float64(im * Float64(im * -0.16666666666666666))
          	tmp = 0.0
          	if (re <= -2.8e-14)
          		tmp = Float64(Float64(Float64(re * Float64(Float64(re * 0.5) + 1.0)) + 1.0) * Float64(im * t_0));
          	elseif (re <= 1.35e+82)
          		tmp = Float64(im + Float64(Float64(im * im) * Float64(im * Float64(-0.16666666666666666 + Float64(Float64(im * im) * 0.008333333333333333)))));
          	else
          		tmp = Float64(Float64(Float64(re * Float64(Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666))) + 1.0)) + 1.0) * Float64(im * Float64(t_0 + 1.0)));
          	end
          	return tmp
          end
          
          function tmp_2 = code(re, im)
          	t_0 = im * (im * -0.16666666666666666);
          	tmp = 0.0;
          	if (re <= -2.8e-14)
          		tmp = ((re * ((re * 0.5) + 1.0)) + 1.0) * (im * t_0);
          	elseif (re <= 1.35e+82)
          		tmp = im + ((im * im) * (im * (-0.16666666666666666 + ((im * im) * 0.008333333333333333))));
          	else
          		tmp = ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0) * (im * (t_0 + 1.0));
          	end
          	tmp_2 = tmp;
          end
          
          code[re_, im_] := Block[{t$95$0 = N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -2.8e-14], N[(N[(N[(re * N[(N[(re * 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(im * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.35e+82], N[(im + N[(N[(im * im), $MachinePrecision] * N[(im * N[(-0.16666666666666666 + N[(N[(im * im), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(re * N[(N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(im * N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := im \cdot \left(im \cdot -0.16666666666666666\right)\\
          \mathbf{if}\;re \leq -2.8 \cdot 10^{-14}:\\
          \;\;\;\;\left(re \cdot \left(re \cdot 0.5 + 1\right) + 1\right) \cdot \left(im \cdot t\_0\right)\\
          
          \mathbf{elif}\;re \leq 1.35 \cdot 10^{+82}:\\
          \;\;\;\;im + \left(im \cdot im\right) \cdot \left(im \cdot \left(-0.16666666666666666 + \left(im \cdot im\right) \cdot 0.008333333333333333\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right) \cdot \left(im \cdot \left(t\_0 + 1\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if re < -2.8000000000000001e-14

            1. Initial program 100.0%

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(1 + \frac{1}{2} \cdot re\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
              3. +-lowering-+.f64N/A

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
              5. *-lowering-*.f645.5%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
            5. Simplified5.5%

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right)\right) \]
              5. *-lowering-*.f642.1%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right)\right) \]
            8. Simplified2.1%

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\frac{-1}{6}}\right)\right)\right)\right) \]
              12. *-lowering-*.f6419.0%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{-1}{6}}\right)\right)\right)\right) \]
            11. Simplified19.0%

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

            if -2.8000000000000001e-14 < re < 1.35e82

            1. Initial program 100.0%

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

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

                \[\leadsto \mathsf{sin.f64}\left(im\right) \]
            5. Simplified85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{120}\right)\right)\right)\right)\right)\right) \]
              14. *-lowering-*.f6450.9%

                \[\leadsto \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{120}\right)\right)\right)\right)\right)\right) \]
            8. Simplified50.9%

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

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

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

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

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

                \[\leadsto \mathsf{+.f64}\left(\left(\left(im \cdot im\right) \cdot \left(im \cdot \left(\frac{-1}{6} + \left(im \cdot im\right) \cdot \frac{1}{120}\right)\right)\right), im\right) \]
              6. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(im \cdot im\right), \left(im \cdot \left(\frac{-1}{6} + \left(im \cdot im\right) \cdot \frac{1}{120}\right)\right)\right), im\right) \]
              7. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(im \cdot \left(\frac{-1}{6} + \left(im \cdot im\right) \cdot \frac{1}{120}\right)\right)\right), im\right) \]
              8. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, \left(\frac{-1}{6} + \left(im \cdot im\right) \cdot \frac{1}{120}\right)\right)\right), im\right) \]
              9. +-lowering-+.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \left(\left(im \cdot im\right) \cdot \frac{1}{120}\right)\right)\right)\right), im\right) \]
              10. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{120}\right)\right)\right)\right), im\right) \]
              11. *-lowering-*.f6450.9%

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{120}\right)\right)\right)\right), im\right) \]
            10. Applied egg-rr50.9%

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

            if 1.35e82 < re

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right) \]
              16. *-lowering-*.f6479.1%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right) \]
            5. Simplified79.1%

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{-1}{6}\right)\right)\right)\right)\right) \]
              7. *-lowering-*.f6474.6%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{-1}{6}\right)\right)\right)\right)\right) \]
            8. Simplified74.6%

              \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)} \cdot \left(im \cdot \left(1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right) \]
          3. Recombined 3 regimes into one program.
          4. Final simplification45.8%

            \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -2.8 \cdot 10^{-14}:\\ \;\;\;\;\left(re \cdot \left(re \cdot 0.5 + 1\right) + 1\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\ \mathbf{elif}\;re \leq 1.35 \cdot 10^{+82}:\\ \;\;\;\;im + \left(im \cdot im\right) \cdot \left(im \cdot \left(-0.16666666666666666 + \left(im \cdot im\right) \cdot 0.008333333333333333\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot -0.16666666666666666\right) + 1\right)\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 8: 42.8% accurate, 7.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := re \cdot \left(re \cdot 0.5 + 1\right) + 1\\ \mathbf{if}\;re \leq -2.8 \cdot 10^{-14}:\\ \;\;\;\;t\_0 \cdot \left(im \cdot \left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\ \mathbf{elif}\;re \leq 10^{+217}:\\ \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\right)\\ \end{array} \end{array} \]
          (FPCore (re im)
           :precision binary64
           (let* ((t_0 (+ (* re (+ (* re 0.5) 1.0)) 1.0)))
             (if (<= re -2.8e-14)
               (* t_0 (* im (* im (* im -0.16666666666666666))))
               (if (<= re 1e+217)
                 (* im (+ (* re (+ (* re (+ 0.5 (* re 0.16666666666666666))) 1.0)) 1.0))
                 (* t_0 (* im (+ (* -0.16666666666666666 (* im im)) 1.0)))))))
          double code(double re, double im) {
          	double t_0 = (re * ((re * 0.5) + 1.0)) + 1.0;
          	double tmp;
          	if (re <= -2.8e-14) {
          		tmp = t_0 * (im * (im * (im * -0.16666666666666666)));
          	} else if (re <= 1e+217) {
          		tmp = im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
          	} else {
          		tmp = t_0 * (im * ((-0.16666666666666666 * (im * im)) + 1.0));
          	}
          	return tmp;
          }
          
          real(8) function code(re, im)
              real(8), intent (in) :: re
              real(8), intent (in) :: im
              real(8) :: t_0
              real(8) :: tmp
              t_0 = (re * ((re * 0.5d0) + 1.0d0)) + 1.0d0
              if (re <= (-2.8d-14)) then
                  tmp = t_0 * (im * (im * (im * (-0.16666666666666666d0))))
              else if (re <= 1d+217) then
                  tmp = im * ((re * ((re * (0.5d0 + (re * 0.16666666666666666d0))) + 1.0d0)) + 1.0d0)
              else
                  tmp = t_0 * (im * (((-0.16666666666666666d0) * (im * im)) + 1.0d0))
              end if
              code = tmp
          end function
          
          public static double code(double re, double im) {
          	double t_0 = (re * ((re * 0.5) + 1.0)) + 1.0;
          	double tmp;
          	if (re <= -2.8e-14) {
          		tmp = t_0 * (im * (im * (im * -0.16666666666666666)));
          	} else if (re <= 1e+217) {
          		tmp = im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
          	} else {
          		tmp = t_0 * (im * ((-0.16666666666666666 * (im * im)) + 1.0));
          	}
          	return tmp;
          }
          
          def code(re, im):
          	t_0 = (re * ((re * 0.5) + 1.0)) + 1.0
          	tmp = 0
          	if re <= -2.8e-14:
          		tmp = t_0 * (im * (im * (im * -0.16666666666666666)))
          	elif re <= 1e+217:
          		tmp = im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0)
          	else:
          		tmp = t_0 * (im * ((-0.16666666666666666 * (im * im)) + 1.0))
          	return tmp
          
          function code(re, im)
          	t_0 = Float64(Float64(re * Float64(Float64(re * 0.5) + 1.0)) + 1.0)
          	tmp = 0.0
          	if (re <= -2.8e-14)
          		tmp = Float64(t_0 * Float64(im * Float64(im * Float64(im * -0.16666666666666666))));
          	elseif (re <= 1e+217)
          		tmp = Float64(im * Float64(Float64(re * Float64(Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666))) + 1.0)) + 1.0));
          	else
          		tmp = Float64(t_0 * Float64(im * Float64(Float64(-0.16666666666666666 * Float64(im * im)) + 1.0)));
          	end
          	return tmp
          end
          
          function tmp_2 = code(re, im)
          	t_0 = (re * ((re * 0.5) + 1.0)) + 1.0;
          	tmp = 0.0;
          	if (re <= -2.8e-14)
          		tmp = t_0 * (im * (im * (im * -0.16666666666666666)));
          	elseif (re <= 1e+217)
          		tmp = im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
          	else
          		tmp = t_0 * (im * ((-0.16666666666666666 * (im * im)) + 1.0));
          	end
          	tmp_2 = tmp;
          end
          
          code[re_, im_] := Block[{t$95$0 = N[(N[(re * N[(N[(re * 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[re, -2.8e-14], N[(t$95$0 * N[(im * N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1e+217], N[(im * N[(N[(re * N[(N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := re \cdot \left(re \cdot 0.5 + 1\right) + 1\\
          \mathbf{if}\;re \leq -2.8 \cdot 10^{-14}:\\
          \;\;\;\;t\_0 \cdot \left(im \cdot \left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\
          
          \mathbf{elif}\;re \leq 10^{+217}:\\
          \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0 \cdot \left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if re < -2.8000000000000001e-14

            1. Initial program 100.0%

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(1 + \frac{1}{2} \cdot re\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
              3. +-lowering-+.f64N/A

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
              5. *-lowering-*.f645.5%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
            5. Simplified5.5%

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right)\right) \]
              5. *-lowering-*.f642.1%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right)\right) \]
            8. Simplified2.1%

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\frac{-1}{6}}\right)\right)\right)\right) \]
              12. *-lowering-*.f6419.0%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{-1}{6}}\right)\right)\right)\right) \]
            11. Simplified19.0%

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

            if -2.8000000000000001e-14 < re < 9.9999999999999996e216

            1. Initial program 100.0%

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
            4. Step-by-step derivation
              1. Simplified57.8%

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), im\right) \]
                7. *-lowering-*.f6451.6%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \frac{1}{6}\right)\right)\right)\right)\right)\right), im\right) \]
              4. Simplified51.6%

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

              if 9.9999999999999996e216 < re

              1. Initial program 100.0%

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(1 + \frac{1}{2} \cdot re\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
                3. +-lowering-+.f64N/A

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
                5. *-lowering-*.f64100.0%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
              5. Simplified100.0%

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right)\right) \]
                5. *-lowering-*.f6489.5%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right)\right) \]
              8. Simplified89.5%

                \[\leadsto \left(1 + re \cdot \left(1 + re \cdot 0.5\right)\right) \cdot \color{blue}{\left(im \cdot \left(1 + -0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right)} \]
            5. Recombined 3 regimes into one program.
            6. Final simplification45.1%

              \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -2.8 \cdot 10^{-14}:\\ \;\;\;\;\left(re \cdot \left(re \cdot 0.5 + 1\right) + 1\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\ \mathbf{elif}\;re \leq 10^{+217}:\\ \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(re \cdot 0.5 + 1\right) + 1\right) \cdot \left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\right)\\ \end{array} \]
            7. Add Preprocessing

            Alternative 9: 42.8% accurate, 8.1× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq -2.8 \cdot 10^{-14}:\\ \;\;\;\;\left(re \cdot \left(re \cdot 0.5 + 1\right) + 1\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\ \mathbf{elif}\;re \leq 2.1 \cdot 10^{+218}:\\ \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\right) \cdot \left(re \cdot \left(re \cdot 0.5\right)\right)\\ \end{array} \end{array} \]
            (FPCore (re im)
             :precision binary64
             (if (<= re -2.8e-14)
               (*
                (+ (* re (+ (* re 0.5) 1.0)) 1.0)
                (* im (* im (* im -0.16666666666666666))))
               (if (<= re 2.1e+218)
                 (* im (+ (* re (+ (* re (+ 0.5 (* re 0.16666666666666666))) 1.0)) 1.0))
                 (* (* im (+ (* -0.16666666666666666 (* im im)) 1.0)) (* re (* re 0.5))))))
            double code(double re, double im) {
            	double tmp;
            	if (re <= -2.8e-14) {
            		tmp = ((re * ((re * 0.5) + 1.0)) + 1.0) * (im * (im * (im * -0.16666666666666666)));
            	} else if (re <= 2.1e+218) {
            		tmp = im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
            	} else {
            		tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * (re * (re * 0.5));
            	}
            	return tmp;
            }
            
            real(8) function code(re, im)
                real(8), intent (in) :: re
                real(8), intent (in) :: im
                real(8) :: tmp
                if (re <= (-2.8d-14)) then
                    tmp = ((re * ((re * 0.5d0) + 1.0d0)) + 1.0d0) * (im * (im * (im * (-0.16666666666666666d0))))
                else if (re <= 2.1d+218) then
                    tmp = im * ((re * ((re * (0.5d0 + (re * 0.16666666666666666d0))) + 1.0d0)) + 1.0d0)
                else
                    tmp = (im * (((-0.16666666666666666d0) * (im * im)) + 1.0d0)) * (re * (re * 0.5d0))
                end if
                code = tmp
            end function
            
            public static double code(double re, double im) {
            	double tmp;
            	if (re <= -2.8e-14) {
            		tmp = ((re * ((re * 0.5) + 1.0)) + 1.0) * (im * (im * (im * -0.16666666666666666)));
            	} else if (re <= 2.1e+218) {
            		tmp = im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
            	} else {
            		tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * (re * (re * 0.5));
            	}
            	return tmp;
            }
            
            def code(re, im):
            	tmp = 0
            	if re <= -2.8e-14:
            		tmp = ((re * ((re * 0.5) + 1.0)) + 1.0) * (im * (im * (im * -0.16666666666666666)))
            	elif re <= 2.1e+218:
            		tmp = im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0)
            	else:
            		tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * (re * (re * 0.5))
            	return tmp
            
            function code(re, im)
            	tmp = 0.0
            	if (re <= -2.8e-14)
            		tmp = Float64(Float64(Float64(re * Float64(Float64(re * 0.5) + 1.0)) + 1.0) * Float64(im * Float64(im * Float64(im * -0.16666666666666666))));
            	elseif (re <= 2.1e+218)
            		tmp = Float64(im * Float64(Float64(re * Float64(Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666))) + 1.0)) + 1.0));
            	else
            		tmp = Float64(Float64(im * Float64(Float64(-0.16666666666666666 * Float64(im * im)) + 1.0)) * Float64(re * Float64(re * 0.5)));
            	end
            	return tmp
            end
            
            function tmp_2 = code(re, im)
            	tmp = 0.0;
            	if (re <= -2.8e-14)
            		tmp = ((re * ((re * 0.5) + 1.0)) + 1.0) * (im * (im * (im * -0.16666666666666666)));
            	elseif (re <= 2.1e+218)
            		tmp = im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
            	else
            		tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * (re * (re * 0.5));
            	end
            	tmp_2 = tmp;
            end
            
            code[re_, im_] := If[LessEqual[re, -2.8e-14], N[(N[(N[(re * N[(N[(re * 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(im * N[(im * N[(im * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 2.1e+218], N[(im * N[(N[(re * N[(N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(re * N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;re \leq -2.8 \cdot 10^{-14}:\\
            \;\;\;\;\left(re \cdot \left(re \cdot 0.5 + 1\right) + 1\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\
            
            \mathbf{elif}\;re \leq 2.1 \cdot 10^{+218}:\\
            \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\right) \cdot \left(re \cdot \left(re \cdot 0.5\right)\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if re < -2.8000000000000001e-14

              1. Initial program 100.0%

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(1 + \frac{1}{2} \cdot re\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
                3. +-lowering-+.f64N/A

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
                5. *-lowering-*.f645.5%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
              5. Simplified5.5%

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right)\right) \]
                5. *-lowering-*.f642.1%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right)\right) \]
              8. Simplified2.1%

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\frac{-1}{6}}\right)\right)\right)\right) \]
                12. *-lowering-*.f6419.0%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{-1}{6}}\right)\right)\right)\right) \]
              11. Simplified19.0%

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

              if -2.8000000000000001e-14 < re < 2.0999999999999999e218

              1. Initial program 100.0%

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
              4. Step-by-step derivation
                1. Simplified57.8%

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), im\right) \]
                  7. *-lowering-*.f6451.6%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \frac{1}{6}\right)\right)\right)\right)\right)\right), im\right) \]
                4. Simplified51.6%

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

                if 2.0999999999999999e218 < re

                1. Initial program 100.0%

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(1 + \frac{1}{2} \cdot re\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
                  3. +-lowering-+.f64N/A

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
                  5. *-lowering-*.f64100.0%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
                5. Simplified100.0%

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

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right)\right) \]
                  5. *-lowering-*.f6489.5%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right)\right) \]
                8. Simplified89.5%

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

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

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \left(re \cdot \frac{1}{2}\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right)\right) \]
                  6. *-lowering-*.f6489.5%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right)\right) \]
                11. Simplified89.5%

                  \[\leadsto \color{blue}{\left(re \cdot \left(re \cdot 0.5\right)\right)} \cdot \left(im \cdot \left(1 + -0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right) \]
              5. Recombined 3 regimes into one program.
              6. Final simplification45.1%

                \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -2.8 \cdot 10^{-14}:\\ \;\;\;\;\left(re \cdot \left(re \cdot 0.5 + 1\right) + 1\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\ \mathbf{elif}\;re \leq 2.1 \cdot 10^{+218}:\\ \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\right) \cdot \left(re \cdot \left(re \cdot 0.5\right)\right)\\ \end{array} \]
              7. Add Preprocessing

              Alternative 10: 42.3% accurate, 8.1× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq -2.8 \cdot 10^{-14}:\\ \;\;\;\;\left(im \cdot im\right) \cdot \left(im \cdot \left(-0.16666666666666666 + \left(re \cdot \left(re \cdot 0.5 + 1\right)\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{elif}\;re \leq 10^{+217}:\\ \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\right) \cdot \left(re \cdot \left(re \cdot 0.5\right)\right)\\ \end{array} \end{array} \]
              (FPCore (re im)
               :precision binary64
               (if (<= re -2.8e-14)
                 (*
                  (* im im)
                  (*
                   im
                   (+
                    -0.16666666666666666
                    (* (* re (+ (* re 0.5) 1.0)) -0.16666666666666666))))
                 (if (<= re 1e+217)
                   (* im (+ (* re (+ (* re (+ 0.5 (* re 0.16666666666666666))) 1.0)) 1.0))
                   (* (* im (+ (* -0.16666666666666666 (* im im)) 1.0)) (* re (* re 0.5))))))
              double code(double re, double im) {
              	double tmp;
              	if (re <= -2.8e-14) {
              		tmp = (im * im) * (im * (-0.16666666666666666 + ((re * ((re * 0.5) + 1.0)) * -0.16666666666666666)));
              	} else if (re <= 1e+217) {
              		tmp = im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
              	} else {
              		tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * (re * (re * 0.5));
              	}
              	return tmp;
              }
              
              real(8) function code(re, im)
                  real(8), intent (in) :: re
                  real(8), intent (in) :: im
                  real(8) :: tmp
                  if (re <= (-2.8d-14)) then
                      tmp = (im * im) * (im * ((-0.16666666666666666d0) + ((re * ((re * 0.5d0) + 1.0d0)) * (-0.16666666666666666d0))))
                  else if (re <= 1d+217) then
                      tmp = im * ((re * ((re * (0.5d0 + (re * 0.16666666666666666d0))) + 1.0d0)) + 1.0d0)
                  else
                      tmp = (im * (((-0.16666666666666666d0) * (im * im)) + 1.0d0)) * (re * (re * 0.5d0))
                  end if
                  code = tmp
              end function
              
              public static double code(double re, double im) {
              	double tmp;
              	if (re <= -2.8e-14) {
              		tmp = (im * im) * (im * (-0.16666666666666666 + ((re * ((re * 0.5) + 1.0)) * -0.16666666666666666)));
              	} else if (re <= 1e+217) {
              		tmp = im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
              	} else {
              		tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * (re * (re * 0.5));
              	}
              	return tmp;
              }
              
              def code(re, im):
              	tmp = 0
              	if re <= -2.8e-14:
              		tmp = (im * im) * (im * (-0.16666666666666666 + ((re * ((re * 0.5) + 1.0)) * -0.16666666666666666)))
              	elif re <= 1e+217:
              		tmp = im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0)
              	else:
              		tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * (re * (re * 0.5))
              	return tmp
              
              function code(re, im)
              	tmp = 0.0
              	if (re <= -2.8e-14)
              		tmp = Float64(Float64(im * im) * Float64(im * Float64(-0.16666666666666666 + Float64(Float64(re * Float64(Float64(re * 0.5) + 1.0)) * -0.16666666666666666))));
              	elseif (re <= 1e+217)
              		tmp = Float64(im * Float64(Float64(re * Float64(Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666))) + 1.0)) + 1.0));
              	else
              		tmp = Float64(Float64(im * Float64(Float64(-0.16666666666666666 * Float64(im * im)) + 1.0)) * Float64(re * Float64(re * 0.5)));
              	end
              	return tmp
              end
              
              function tmp_2 = code(re, im)
              	tmp = 0.0;
              	if (re <= -2.8e-14)
              		tmp = (im * im) * (im * (-0.16666666666666666 + ((re * ((re * 0.5) + 1.0)) * -0.16666666666666666)));
              	elseif (re <= 1e+217)
              		tmp = im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
              	else
              		tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * (re * (re * 0.5));
              	end
              	tmp_2 = tmp;
              end
              
              code[re_, im_] := If[LessEqual[re, -2.8e-14], N[(N[(im * im), $MachinePrecision] * N[(im * N[(-0.16666666666666666 + N[(N[(re * N[(N[(re * 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1e+217], N[(im * N[(N[(re * N[(N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(re * N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;re \leq -2.8 \cdot 10^{-14}:\\
              \;\;\;\;\left(im \cdot im\right) \cdot \left(im \cdot \left(-0.16666666666666666 + \left(re \cdot \left(re \cdot 0.5 + 1\right)\right) \cdot -0.16666666666666666\right)\right)\\
              
              \mathbf{elif}\;re \leq 10^{+217}:\\
              \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\right) \cdot \left(re \cdot \left(re \cdot 0.5\right)\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if re < -2.8000000000000001e-14

                1. Initial program 100.0%

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(1 + \frac{1}{2} \cdot re\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
                  3. +-lowering-+.f64N/A

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
                  5. *-lowering-*.f645.5%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
                5. Simplified5.5%

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

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right)\right) \]
                  5. *-lowering-*.f642.1%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right)\right) \]
                8. Simplified2.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right)\right)\right) \]
                  19. *-lowering-*.f6417.8%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right)\right)\right) \]
                11. Simplified17.8%

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

                if -2.8000000000000001e-14 < re < 9.9999999999999996e216

                1. Initial program 100.0%

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                4. Step-by-step derivation
                  1. Simplified57.8%

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), im\right) \]
                    7. *-lowering-*.f6451.6%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \frac{1}{6}\right)\right)\right)\right)\right)\right), im\right) \]
                  4. Simplified51.6%

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

                  if 9.9999999999999996e216 < re

                  1. Initial program 100.0%

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(1 + \frac{1}{2} \cdot re\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
                    3. +-lowering-+.f64N/A

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
                    5. *-lowering-*.f64100.0%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
                  5. Simplified100.0%

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

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

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right)\right) \]
                    5. *-lowering-*.f6489.5%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right)\right) \]
                  8. Simplified89.5%

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

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

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

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \left(re \cdot \frac{1}{2}\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right)\right) \]
                    6. *-lowering-*.f6489.5%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right)\right) \]
                  11. Simplified89.5%

                    \[\leadsto \color{blue}{\left(re \cdot \left(re \cdot 0.5\right)\right)} \cdot \left(im \cdot \left(1 + -0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right) \]
                5. Recombined 3 regimes into one program.
                6. Final simplification44.8%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -2.8 \cdot 10^{-14}:\\ \;\;\;\;\left(im \cdot im\right) \cdot \left(im \cdot \left(-0.16666666666666666 + \left(re \cdot \left(re \cdot 0.5 + 1\right)\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{elif}\;re \leq 10^{+217}:\\ \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\right) \cdot \left(re \cdot \left(re \cdot 0.5\right)\right)\\ \end{array} \]
                7. Add Preprocessing

                Alternative 11: 40.8% accurate, 8.1× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq -4 \cdot 10^{-20}:\\ \;\;\;\;\frac{re + re \cdot re}{\frac{re}{im}}\\ \mathbf{elif}\;re \leq 4.8 \cdot 10^{+218}:\\ \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\right) \cdot \left(re \cdot \left(re \cdot 0.5\right)\right)\\ \end{array} \end{array} \]
                (FPCore (re im)
                 :precision binary64
                 (if (<= re -4e-20)
                   (/ (+ re (* re re)) (/ re im))
                   (if (<= re 4.8e+218)
                     (* im (+ (* re (+ (* re (+ 0.5 (* re 0.16666666666666666))) 1.0)) 1.0))
                     (* (* im (+ (* -0.16666666666666666 (* im im)) 1.0)) (* re (* re 0.5))))))
                double code(double re, double im) {
                	double tmp;
                	if (re <= -4e-20) {
                		tmp = (re + (re * re)) / (re / im);
                	} else if (re <= 4.8e+218) {
                		tmp = im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
                	} else {
                		tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * (re * (re * 0.5));
                	}
                	return tmp;
                }
                
                real(8) function code(re, im)
                    real(8), intent (in) :: re
                    real(8), intent (in) :: im
                    real(8) :: tmp
                    if (re <= (-4d-20)) then
                        tmp = (re + (re * re)) / (re / im)
                    else if (re <= 4.8d+218) then
                        tmp = im * ((re * ((re * (0.5d0 + (re * 0.16666666666666666d0))) + 1.0d0)) + 1.0d0)
                    else
                        tmp = (im * (((-0.16666666666666666d0) * (im * im)) + 1.0d0)) * (re * (re * 0.5d0))
                    end if
                    code = tmp
                end function
                
                public static double code(double re, double im) {
                	double tmp;
                	if (re <= -4e-20) {
                		tmp = (re + (re * re)) / (re / im);
                	} else if (re <= 4.8e+218) {
                		tmp = im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
                	} else {
                		tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * (re * (re * 0.5));
                	}
                	return tmp;
                }
                
                def code(re, im):
                	tmp = 0
                	if re <= -4e-20:
                		tmp = (re + (re * re)) / (re / im)
                	elif re <= 4.8e+218:
                		tmp = im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0)
                	else:
                		tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * (re * (re * 0.5))
                	return tmp
                
                function code(re, im)
                	tmp = 0.0
                	if (re <= -4e-20)
                		tmp = Float64(Float64(re + Float64(re * re)) / Float64(re / im));
                	elseif (re <= 4.8e+218)
                		tmp = Float64(im * Float64(Float64(re * Float64(Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666))) + 1.0)) + 1.0));
                	else
                		tmp = Float64(Float64(im * Float64(Float64(-0.16666666666666666 * Float64(im * im)) + 1.0)) * Float64(re * Float64(re * 0.5)));
                	end
                	return tmp
                end
                
                function tmp_2 = code(re, im)
                	tmp = 0.0;
                	if (re <= -4e-20)
                		tmp = (re + (re * re)) / (re / im);
                	elseif (re <= 4.8e+218)
                		tmp = im * ((re * ((re * (0.5 + (re * 0.16666666666666666))) + 1.0)) + 1.0);
                	else
                		tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * (re * (re * 0.5));
                	end
                	tmp_2 = tmp;
                end
                
                code[re_, im_] := If[LessEqual[re, -4e-20], N[(N[(re + N[(re * re), $MachinePrecision]), $MachinePrecision] / N[(re / im), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 4.8e+218], N[(im * N[(N[(re * N[(N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(re * N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;re \leq -4 \cdot 10^{-20}:\\
                \;\;\;\;\frac{re + re \cdot re}{\frac{re}{im}}\\
                
                \mathbf{elif}\;re \leq 4.8 \cdot 10^{+218}:\\
                \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\right) \cdot \left(re \cdot \left(re \cdot 0.5\right)\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if re < -3.99999999999999978e-20

                  1. Initial program 100.0%

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                  4. Step-by-step derivation
                    1. Simplified93.4%

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

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

                        \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), im\right) \]
                      2. +-lowering-+.f642.7%

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), im\right) \]
                    4. Simplified2.7%

                      \[\leadsto \color{blue}{\left(re + 1\right)} \cdot im \]
                    5. Applied egg-rr12.4%

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

                    if -3.99999999999999978e-20 < re < 4.79999999999999961e218

                    1. Initial program 100.0%

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                    4. Step-by-step derivation
                      1. Simplified58.2%

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), im\right) \]
                        7. *-lowering-*.f6451.9%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \frac{1}{6}\right)\right)\right)\right)\right)\right), im\right) \]
                      4. Simplified51.9%

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

                      if 4.79999999999999961e218 < re

                      1. Initial program 100.0%

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(1 + \frac{1}{2} \cdot re\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
                        3. +-lowering-+.f64N/A

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
                        5. *-lowering-*.f64100.0%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
                      5. Simplified100.0%

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

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right)\right) \]
                        5. *-lowering-*.f6489.5%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right)\right) \]
                      8. Simplified89.5%

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

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

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \left(re \cdot \frac{1}{2}\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right)\right) \]
                        6. *-lowering-*.f6489.5%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right)\right) \]
                      11. Simplified89.5%

                        \[\leadsto \color{blue}{\left(re \cdot \left(re \cdot 0.5\right)\right)} \cdot \left(im \cdot \left(1 + -0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right) \]
                    5. Recombined 3 regimes into one program.
                    6. Final simplification43.3%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -4 \cdot 10^{-20}:\\ \;\;\;\;\frac{re + re \cdot re}{\frac{re}{im}}\\ \mathbf{elif}\;re \leq 4.8 \cdot 10^{+218}:\\ \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(0.5 + re \cdot 0.16666666666666666\right) + 1\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\right) \cdot \left(re \cdot \left(re \cdot 0.5\right)\right)\\ \end{array} \]
                    7. Add Preprocessing

                    Alternative 12: 40.6% accurate, 8.1× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 1050:\\ \;\;\;\;\frac{re + re \cdot re}{\frac{re}{im}}\\ \mathbf{elif}\;re \leq 2.2 \cdot 10^{+218}:\\ \;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(im \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\right) \cdot \left(re \cdot \left(re \cdot 0.5\right)\right)\\ \end{array} \end{array} \]
                    (FPCore (re im)
                     :precision binary64
                     (if (<= re 1050.0)
                       (/ (+ re (* re re)) (/ re im))
                       (if (<= re 2.2e+218)
                         (* (* re (* re re)) (* im (+ 0.16666666666666666 (/ 0.5 re))))
                         (* (* im (+ (* -0.16666666666666666 (* im im)) 1.0)) (* re (* re 0.5))))))
                    double code(double re, double im) {
                    	double tmp;
                    	if (re <= 1050.0) {
                    		tmp = (re + (re * re)) / (re / im);
                    	} else if (re <= 2.2e+218) {
                    		tmp = (re * (re * re)) * (im * (0.16666666666666666 + (0.5 / re)));
                    	} else {
                    		tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * (re * (re * 0.5));
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(re, im)
                        real(8), intent (in) :: re
                        real(8), intent (in) :: im
                        real(8) :: tmp
                        if (re <= 1050.0d0) then
                            tmp = (re + (re * re)) / (re / im)
                        else if (re <= 2.2d+218) then
                            tmp = (re * (re * re)) * (im * (0.16666666666666666d0 + (0.5d0 / re)))
                        else
                            tmp = (im * (((-0.16666666666666666d0) * (im * im)) + 1.0d0)) * (re * (re * 0.5d0))
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double re, double im) {
                    	double tmp;
                    	if (re <= 1050.0) {
                    		tmp = (re + (re * re)) / (re / im);
                    	} else if (re <= 2.2e+218) {
                    		tmp = (re * (re * re)) * (im * (0.16666666666666666 + (0.5 / re)));
                    	} else {
                    		tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * (re * (re * 0.5));
                    	}
                    	return tmp;
                    }
                    
                    def code(re, im):
                    	tmp = 0
                    	if re <= 1050.0:
                    		tmp = (re + (re * re)) / (re / im)
                    	elif re <= 2.2e+218:
                    		tmp = (re * (re * re)) * (im * (0.16666666666666666 + (0.5 / re)))
                    	else:
                    		tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * (re * (re * 0.5))
                    	return tmp
                    
                    function code(re, im)
                    	tmp = 0.0
                    	if (re <= 1050.0)
                    		tmp = Float64(Float64(re + Float64(re * re)) / Float64(re / im));
                    	elseif (re <= 2.2e+218)
                    		tmp = Float64(Float64(re * Float64(re * re)) * Float64(im * Float64(0.16666666666666666 + Float64(0.5 / re))));
                    	else
                    		tmp = Float64(Float64(im * Float64(Float64(-0.16666666666666666 * Float64(im * im)) + 1.0)) * Float64(re * Float64(re * 0.5)));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(re, im)
                    	tmp = 0.0;
                    	if (re <= 1050.0)
                    		tmp = (re + (re * re)) / (re / im);
                    	elseif (re <= 2.2e+218)
                    		tmp = (re * (re * re)) * (im * (0.16666666666666666 + (0.5 / re)));
                    	else
                    		tmp = (im * ((-0.16666666666666666 * (im * im)) + 1.0)) * (re * (re * 0.5));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[re_, im_] := If[LessEqual[re, 1050.0], N[(N[(re + N[(re * re), $MachinePrecision]), $MachinePrecision] / N[(re / im), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 2.2e+218], N[(N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(im * N[(0.16666666666666666 + N[(0.5 / re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(re * N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;re \leq 1050:\\
                    \;\;\;\;\frac{re + re \cdot re}{\frac{re}{im}}\\
                    
                    \mathbf{elif}\;re \leq 2.2 \cdot 10^{+218}:\\
                    \;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(im \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\right) \cdot \left(re \cdot \left(re \cdot 0.5\right)\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if re < 1050

                      1. Initial program 100.0%

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

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                      4. Step-by-step derivation
                        1. Simplified67.7%

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

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

                            \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), im\right) \]
                          2. +-lowering-+.f6432.8%

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), im\right) \]
                        4. Simplified32.8%

                          \[\leadsto \color{blue}{\left(re + 1\right)} \cdot im \]
                        5. Applied egg-rr36.4%

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

                        if 1050 < re < 2.2e218

                        1. Initial program 100.0%

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                        4. Step-by-step derivation
                          1. Simplified76.2%

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), im\right) \]
                            7. *-lowering-*.f6453.4%

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \frac{1}{6}\right)\right)\right)\right)\right)\right), im\right) \]
                          4. Simplified53.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{6}, \left(\frac{\frac{1}{2}}{re}\right)\right)\right)\right) \]
                            18. /-lowering-/.f6453.4%

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\frac{1}{2}, \color{blue}{re}\right)\right)\right)\right) \]
                          7. Simplified53.4%

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

                          if 2.2e218 < re

                          1. Initial program 100.0%

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

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

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

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(1 + \frac{1}{2} \cdot re\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
                            3. +-lowering-+.f64N/A

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

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
                            5. *-lowering-*.f64100.0%

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(im\right)\right) \]
                          5. Simplified100.0%

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

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

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

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

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

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right)\right) \]
                            5. *-lowering-*.f6489.5%

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right)\right) \]
                          8. Simplified89.5%

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

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

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

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

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

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

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \left(re \cdot \frac{1}{2}\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right)\right) \]
                            6. *-lowering-*.f6489.5%

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right)\right) \]
                          11. Simplified89.5%

                            \[\leadsto \color{blue}{\left(re \cdot \left(re \cdot 0.5\right)\right)} \cdot \left(im \cdot \left(1 + -0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right) \]
                        5. Recombined 3 regimes into one program.
                        6. Final simplification43.1%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 1050:\\ \;\;\;\;\frac{re + re \cdot re}{\frac{re}{im}}\\ \mathbf{elif}\;re \leq 2.2 \cdot 10^{+218}:\\ \;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(im \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\right) \cdot \left(re \cdot \left(re \cdot 0.5\right)\right)\\ \end{array} \]
                        7. Add Preprocessing

                        Alternative 13: 40.1% accurate, 10.7× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq -4.2 \cdot 10^{-22}:\\ \;\;\;\;\left(re \cdot re\right) \cdot \frac{im}{re}\\ \mathbf{elif}\;re \leq 9.5 \cdot 10^{+41}:\\ \;\;\;\;im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right)\\ \end{array} \end{array} \]
                        (FPCore (re im)
                         :precision binary64
                         (if (<= re -4.2e-22)
                           (* (* re re) (/ im re))
                           (if (<= re 9.5e+41)
                             (* im (+ (* -0.16666666666666666 (* im im)) 1.0))
                             (* im (* re (* 0.16666666666666666 (* re re)))))))
                        double code(double re, double im) {
                        	double tmp;
                        	if (re <= -4.2e-22) {
                        		tmp = (re * re) * (im / re);
                        	} else if (re <= 9.5e+41) {
                        		tmp = im * ((-0.16666666666666666 * (im * im)) + 1.0);
                        	} else {
                        		tmp = im * (re * (0.16666666666666666 * (re * re)));
                        	}
                        	return tmp;
                        }
                        
                        real(8) function code(re, im)
                            real(8), intent (in) :: re
                            real(8), intent (in) :: im
                            real(8) :: tmp
                            if (re <= (-4.2d-22)) then
                                tmp = (re * re) * (im / re)
                            else if (re <= 9.5d+41) then
                                tmp = im * (((-0.16666666666666666d0) * (im * im)) + 1.0d0)
                            else
                                tmp = im * (re * (0.16666666666666666d0 * (re * re)))
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double re, double im) {
                        	double tmp;
                        	if (re <= -4.2e-22) {
                        		tmp = (re * re) * (im / re);
                        	} else if (re <= 9.5e+41) {
                        		tmp = im * ((-0.16666666666666666 * (im * im)) + 1.0);
                        	} else {
                        		tmp = im * (re * (0.16666666666666666 * (re * re)));
                        	}
                        	return tmp;
                        }
                        
                        def code(re, im):
                        	tmp = 0
                        	if re <= -4.2e-22:
                        		tmp = (re * re) * (im / re)
                        	elif re <= 9.5e+41:
                        		tmp = im * ((-0.16666666666666666 * (im * im)) + 1.0)
                        	else:
                        		tmp = im * (re * (0.16666666666666666 * (re * re)))
                        	return tmp
                        
                        function code(re, im)
                        	tmp = 0.0
                        	if (re <= -4.2e-22)
                        		tmp = Float64(Float64(re * re) * Float64(im / re));
                        	elseif (re <= 9.5e+41)
                        		tmp = Float64(im * Float64(Float64(-0.16666666666666666 * Float64(im * im)) + 1.0));
                        	else
                        		tmp = Float64(im * Float64(re * Float64(0.16666666666666666 * Float64(re * re))));
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(re, im)
                        	tmp = 0.0;
                        	if (re <= -4.2e-22)
                        		tmp = (re * re) * (im / re);
                        	elseif (re <= 9.5e+41)
                        		tmp = im * ((-0.16666666666666666 * (im * im)) + 1.0);
                        	else
                        		tmp = im * (re * (0.16666666666666666 * (re * re)));
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[re_, im_] := If[LessEqual[re, -4.2e-22], N[(N[(re * re), $MachinePrecision] * N[(im / re), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 9.5e+41], N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;re \leq -4.2 \cdot 10^{-22}:\\
                        \;\;\;\;\left(re \cdot re\right) \cdot \frac{im}{re}\\
                        
                        \mathbf{elif}\;re \leq 9.5 \cdot 10^{+41}:\\
                        \;\;\;\;im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right)\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 3 regimes
                        2. if re < -4.20000000000000016e-22

                          1. Initial program 100.0%

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                          4. Step-by-step derivation
                            1. Simplified92.2%

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

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

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \frac{1}{2}\right)\right)\right)\right), im\right) \]
                              5. *-lowering-*.f642.1%

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), im\right) \]
                            4. Simplified2.1%

                              \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot 0.5\right)\right)} \cdot im \]
                            5. Taylor expanded in re around inf

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

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

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

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, \frac{1}{2}\right), \left(\frac{\color{blue}{im}}{re}\right)\right)\right) \]
                              7. /-lowering-/.f642.2%

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, \frac{1}{2}\right), \mathsf{/.f64}\left(im, \color{blue}{re}\right)\right)\right) \]
                            7. Simplified2.2%

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

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \color{blue}{\left(\frac{im}{re}\right)}\right) \]
                            9. Step-by-step derivation
                              1. /-lowering-/.f649.8%

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{/.f64}\left(im, \color{blue}{re}\right)\right) \]
                            10. Simplified9.8%

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

                            if -4.20000000000000016e-22 < re < 9.4999999999999996e41

                            1. Initial program 100.0%

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

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

                                \[\leadsto \mathsf{sin.f64}\left(im\right) \]
                            5. Simplified90.9%

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

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

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                              5. *-lowering-*.f6449.9%

                                \[\leadsto \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                            8. Simplified49.9%

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

                            if 9.4999999999999996e41 < re

                            1. Initial program 100.0%

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

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                            4. Step-by-step derivation
                              1. Simplified71.2%

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

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

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

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

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

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

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

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), im\right) \]
                                7. *-lowering-*.f6463.7%

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \frac{1}{6}\right)\right)\right)\right)\right)\right), im\right) \]
                              4. Simplified63.7%

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

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

                                  \[\leadsto \mathsf{*.f64}\left(\left({re}^{3} \cdot \frac{1}{6}\right), im\right) \]
                                2. cube-multN/A

                                  \[\leadsto \mathsf{*.f64}\left(\left(\left(re \cdot \left(re \cdot re\right)\right) \cdot \frac{1}{6}\right), im\right) \]
                                3. unpow2N/A

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

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

                                  \[\leadsto \mathsf{*.f64}\left(\left(re \cdot \left(\frac{1}{6} \cdot {re}^{2}\right)\right), im\right) \]
                                6. unpow2N/A

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

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

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

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \left(\frac{1}{6} \cdot \left(re \cdot re\right)\right)\right), im\right) \]
                                10. unpow2N/A

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

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\frac{1}{6}, \left({re}^{2}\right)\right)\right), im\right) \]
                                12. unpow2N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\frac{1}{6}, \left(re \cdot re\right)\right)\right), im\right) \]
                                13. *-lowering-*.f6463.7%

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(re, re\right)\right)\right), im\right) \]
                              7. Simplified63.7%

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

                              \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -4.2 \cdot 10^{-22}:\\ \;\;\;\;\left(re \cdot re\right) \cdot \frac{im}{re}\\ \mathbf{elif}\;re \leq 9.5 \cdot 10^{+41}:\\ \;\;\;\;im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right)\right)\right)\\ \end{array} \]
                            7. Add Preprocessing

                            Alternative 14: 37.9% accurate, 10.7× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq -4.2 \cdot 10^{-22}:\\ \;\;\;\;\left(re \cdot re\right) \cdot \frac{im}{re}\\ \mathbf{elif}\;re \leq 3.6 \cdot 10^{+42}:\\ \;\;\;\;im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot 0.5\right)\\ \end{array} \end{array} \]
                            (FPCore (re im)
                             :precision binary64
                             (if (<= re -4.2e-22)
                               (* (* re re) (/ im re))
                               (if (<= re 3.6e+42)
                                 (* im (+ (* -0.16666666666666666 (* im im)) 1.0))
                                 (* (* re re) (* im 0.5)))))
                            double code(double re, double im) {
                            	double tmp;
                            	if (re <= -4.2e-22) {
                            		tmp = (re * re) * (im / re);
                            	} else if (re <= 3.6e+42) {
                            		tmp = im * ((-0.16666666666666666 * (im * im)) + 1.0);
                            	} else {
                            		tmp = (re * re) * (im * 0.5);
                            	}
                            	return tmp;
                            }
                            
                            real(8) function code(re, im)
                                real(8), intent (in) :: re
                                real(8), intent (in) :: im
                                real(8) :: tmp
                                if (re <= (-4.2d-22)) then
                                    tmp = (re * re) * (im / re)
                                else if (re <= 3.6d+42) then
                                    tmp = im * (((-0.16666666666666666d0) * (im * im)) + 1.0d0)
                                else
                                    tmp = (re * re) * (im * 0.5d0)
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double re, double im) {
                            	double tmp;
                            	if (re <= -4.2e-22) {
                            		tmp = (re * re) * (im / re);
                            	} else if (re <= 3.6e+42) {
                            		tmp = im * ((-0.16666666666666666 * (im * im)) + 1.0);
                            	} else {
                            		tmp = (re * re) * (im * 0.5);
                            	}
                            	return tmp;
                            }
                            
                            def code(re, im):
                            	tmp = 0
                            	if re <= -4.2e-22:
                            		tmp = (re * re) * (im / re)
                            	elif re <= 3.6e+42:
                            		tmp = im * ((-0.16666666666666666 * (im * im)) + 1.0)
                            	else:
                            		tmp = (re * re) * (im * 0.5)
                            	return tmp
                            
                            function code(re, im)
                            	tmp = 0.0
                            	if (re <= -4.2e-22)
                            		tmp = Float64(Float64(re * re) * Float64(im / re));
                            	elseif (re <= 3.6e+42)
                            		tmp = Float64(im * Float64(Float64(-0.16666666666666666 * Float64(im * im)) + 1.0));
                            	else
                            		tmp = Float64(Float64(re * re) * Float64(im * 0.5));
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(re, im)
                            	tmp = 0.0;
                            	if (re <= -4.2e-22)
                            		tmp = (re * re) * (im / re);
                            	elseif (re <= 3.6e+42)
                            		tmp = im * ((-0.16666666666666666 * (im * im)) + 1.0);
                            	else
                            		tmp = (re * re) * (im * 0.5);
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[re_, im_] := If[LessEqual[re, -4.2e-22], N[(N[(re * re), $MachinePrecision] * N[(im / re), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 3.6e+42], N[(im * N[(N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(re * re), $MachinePrecision] * N[(im * 0.5), $MachinePrecision]), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;re \leq -4.2 \cdot 10^{-22}:\\
                            \;\;\;\;\left(re \cdot re\right) \cdot \frac{im}{re}\\
                            
                            \mathbf{elif}\;re \leq 3.6 \cdot 10^{+42}:\\
                            \;\;\;\;im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot 0.5\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if re < -4.20000000000000016e-22

                              1. Initial program 100.0%

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

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                              4. Step-by-step derivation
                                1. Simplified92.2%

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

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

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

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

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

                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \frac{1}{2}\right)\right)\right)\right), im\right) \]
                                  5. *-lowering-*.f642.1%

                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), im\right) \]
                                4. Simplified2.1%

                                  \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot 0.5\right)\right)} \cdot im \]
                                5. Taylor expanded in re around inf

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

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

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

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

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

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

                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, \frac{1}{2}\right), \left(\frac{\color{blue}{im}}{re}\right)\right)\right) \]
                                  7. /-lowering-/.f642.2%

                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, \frac{1}{2}\right), \mathsf{/.f64}\left(im, \color{blue}{re}\right)\right)\right) \]
                                7. Simplified2.2%

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

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \color{blue}{\left(\frac{im}{re}\right)}\right) \]
                                9. Step-by-step derivation
                                  1. /-lowering-/.f649.8%

                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{/.f64}\left(im, \color{blue}{re}\right)\right) \]
                                10. Simplified9.8%

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

                                if -4.20000000000000016e-22 < re < 3.6000000000000001e42

                                1. Initial program 100.0%

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

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

                                    \[\leadsto \mathsf{sin.f64}\left(im\right) \]
                                5. Simplified90.9%

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

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

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

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

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

                                    \[\leadsto \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                                  5. *-lowering-*.f6449.9%

                                    \[\leadsto \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                                8. Simplified49.9%

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

                                if 3.6000000000000001e42 < re

                                1. Initial program 100.0%

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

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                                4. Step-by-step derivation
                                  1. Simplified71.2%

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

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

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

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

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

                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \frac{1}{2}\right)\right)\right)\right), im\right) \]
                                    5. *-lowering-*.f6456.6%

                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), im\right) \]
                                  4. Simplified56.6%

                                    \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot 0.5\right)\right)} \cdot im \]
                                  5. Taylor expanded in re around inf

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

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

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

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

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

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

                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, \frac{1}{2}\right), \left(\frac{\color{blue}{im}}{re}\right)\right)\right) \]
                                    7. /-lowering-/.f6456.6%

                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, \frac{1}{2}\right), \mathsf{/.f64}\left(im, \color{blue}{re}\right)\right)\right) \]
                                  7. Simplified56.6%

                                    \[\leadsto \color{blue}{\left(re \cdot re\right) \cdot \left(im \cdot 0.5 + \frac{im}{re}\right)} \]
                                  8. Taylor expanded in re around inf

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

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

                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(im, \color{blue}{\frac{1}{2}}\right)\right) \]
                                  10. Simplified56.6%

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

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -4.2 \cdot 10^{-22}:\\ \;\;\;\;\left(re \cdot re\right) \cdot \frac{im}{re}\\ \mathbf{elif}\;re \leq 3.6 \cdot 10^{+42}:\\ \;\;\;\;im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot 0.5\right)\\ \end{array} \]
                                7. Add Preprocessing

                                Alternative 15: 40.8% accurate, 11.3× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 1050:\\ \;\;\;\;\frac{re + re \cdot re}{\frac{re}{im}}\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(im \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\\ \end{array} \end{array} \]
                                (FPCore (re im)
                                 :precision binary64
                                 (if (<= re 1050.0)
                                   (/ (+ re (* re re)) (/ re im))
                                   (* (* re (* re re)) (* im (+ 0.16666666666666666 (/ 0.5 re))))))
                                double code(double re, double im) {
                                	double tmp;
                                	if (re <= 1050.0) {
                                		tmp = (re + (re * re)) / (re / im);
                                	} else {
                                		tmp = (re * (re * re)) * (im * (0.16666666666666666 + (0.5 / re)));
                                	}
                                	return tmp;
                                }
                                
                                real(8) function code(re, im)
                                    real(8), intent (in) :: re
                                    real(8), intent (in) :: im
                                    real(8) :: tmp
                                    if (re <= 1050.0d0) then
                                        tmp = (re + (re * re)) / (re / im)
                                    else
                                        tmp = (re * (re * re)) * (im * (0.16666666666666666d0 + (0.5d0 / re)))
                                    end if
                                    code = tmp
                                end function
                                
                                public static double code(double re, double im) {
                                	double tmp;
                                	if (re <= 1050.0) {
                                		tmp = (re + (re * re)) / (re / im);
                                	} else {
                                		tmp = (re * (re * re)) * (im * (0.16666666666666666 + (0.5 / re)));
                                	}
                                	return tmp;
                                }
                                
                                def code(re, im):
                                	tmp = 0
                                	if re <= 1050.0:
                                		tmp = (re + (re * re)) / (re / im)
                                	else:
                                		tmp = (re * (re * re)) * (im * (0.16666666666666666 + (0.5 / re)))
                                	return tmp
                                
                                function code(re, im)
                                	tmp = 0.0
                                	if (re <= 1050.0)
                                		tmp = Float64(Float64(re + Float64(re * re)) / Float64(re / im));
                                	else
                                		tmp = Float64(Float64(re * Float64(re * re)) * Float64(im * Float64(0.16666666666666666 + Float64(0.5 / re))));
                                	end
                                	return tmp
                                end
                                
                                function tmp_2 = code(re, im)
                                	tmp = 0.0;
                                	if (re <= 1050.0)
                                		tmp = (re + (re * re)) / (re / im);
                                	else
                                		tmp = (re * (re * re)) * (im * (0.16666666666666666 + (0.5 / re)));
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[re_, im_] := If[LessEqual[re, 1050.0], N[(N[(re + N[(re * re), $MachinePrecision]), $MachinePrecision] / N[(re / im), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(im * N[(0.16666666666666666 + N[(0.5 / re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;re \leq 1050:\\
                                \;\;\;\;\frac{re + re \cdot re}{\frac{re}{im}}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(im \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if re < 1050

                                  1. Initial program 100.0%

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

                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                                  4. Step-by-step derivation
                                    1. Simplified67.7%

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

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

                                        \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), im\right) \]
                                      2. +-lowering-+.f6432.8%

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), im\right) \]
                                    4. Simplified32.8%

                                      \[\leadsto \color{blue}{\left(re + 1\right)} \cdot im \]
                                    5. Applied egg-rr36.4%

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

                                    if 1050 < re

                                    1. Initial program 100.0%

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

                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                                    4. Step-by-step derivation
                                      1. Simplified72.1%

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

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

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

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

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

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

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

                                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), im\right) \]
                                        7. *-lowering-*.f6456.4%

                                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \frac{1}{6}\right)\right)\right)\right)\right)\right), im\right) \]
                                      4. Simplified56.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{6}, \left(\frac{\frac{1}{2}}{re}\right)\right)\right)\right) \]
                                        18. /-lowering-/.f6456.4%

                                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\frac{1}{2}, \color{blue}{re}\right)\right)\right)\right) \]
                                      7. Simplified56.4%

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

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 1050:\\ \;\;\;\;\frac{re + re \cdot re}{\frac{re}{im}}\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(im \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\\ \end{array} \]
                                    7. Add Preprocessing

                                    Alternative 16: 38.0% accurate, 11.9× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq -2.8 \cdot 10^{-14}:\\ \;\;\;\;\left(re \cdot re\right) \cdot \frac{im}{re}\\ \mathbf{elif}\;re \leq 1050:\\ \;\;\;\;im + re \cdot im\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot 0.5\right)\\ \end{array} \end{array} \]
                                    (FPCore (re im)
                                     :precision binary64
                                     (if (<= re -2.8e-14)
                                       (* (* re re) (/ im re))
                                       (if (<= re 1050.0) (+ im (* re im)) (* (* re re) (* im 0.5)))))
                                    double code(double re, double im) {
                                    	double tmp;
                                    	if (re <= -2.8e-14) {
                                    		tmp = (re * re) * (im / re);
                                    	} else if (re <= 1050.0) {
                                    		tmp = im + (re * im);
                                    	} else {
                                    		tmp = (re * re) * (im * 0.5);
                                    	}
                                    	return tmp;
                                    }
                                    
                                    real(8) function code(re, im)
                                        real(8), intent (in) :: re
                                        real(8), intent (in) :: im
                                        real(8) :: tmp
                                        if (re <= (-2.8d-14)) then
                                            tmp = (re * re) * (im / re)
                                        else if (re <= 1050.0d0) then
                                            tmp = im + (re * im)
                                        else
                                            tmp = (re * re) * (im * 0.5d0)
                                        end if
                                        code = tmp
                                    end function
                                    
                                    public static double code(double re, double im) {
                                    	double tmp;
                                    	if (re <= -2.8e-14) {
                                    		tmp = (re * re) * (im / re);
                                    	} else if (re <= 1050.0) {
                                    		tmp = im + (re * im);
                                    	} else {
                                    		tmp = (re * re) * (im * 0.5);
                                    	}
                                    	return tmp;
                                    }
                                    
                                    def code(re, im):
                                    	tmp = 0
                                    	if re <= -2.8e-14:
                                    		tmp = (re * re) * (im / re)
                                    	elif re <= 1050.0:
                                    		tmp = im + (re * im)
                                    	else:
                                    		tmp = (re * re) * (im * 0.5)
                                    	return tmp
                                    
                                    function code(re, im)
                                    	tmp = 0.0
                                    	if (re <= -2.8e-14)
                                    		tmp = Float64(Float64(re * re) * Float64(im / re));
                                    	elseif (re <= 1050.0)
                                    		tmp = Float64(im + Float64(re * im));
                                    	else
                                    		tmp = Float64(Float64(re * re) * Float64(im * 0.5));
                                    	end
                                    	return tmp
                                    end
                                    
                                    function tmp_2 = code(re, im)
                                    	tmp = 0.0;
                                    	if (re <= -2.8e-14)
                                    		tmp = (re * re) * (im / re);
                                    	elseif (re <= 1050.0)
                                    		tmp = im + (re * im);
                                    	else
                                    		tmp = (re * re) * (im * 0.5);
                                    	end
                                    	tmp_2 = tmp;
                                    end
                                    
                                    code[re_, im_] := If[LessEqual[re, -2.8e-14], N[(N[(re * re), $MachinePrecision] * N[(im / re), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1050.0], N[(im + N[(re * im), $MachinePrecision]), $MachinePrecision], N[(N[(re * re), $MachinePrecision] * N[(im * 0.5), $MachinePrecision]), $MachinePrecision]]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    \mathbf{if}\;re \leq -2.8 \cdot 10^{-14}:\\
                                    \;\;\;\;\left(re \cdot re\right) \cdot \frac{im}{re}\\
                                    
                                    \mathbf{elif}\;re \leq 1050:\\
                                    \;\;\;\;im + re \cdot im\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot 0.5\right)\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 3 regimes
                                    2. if re < -2.8000000000000001e-14

                                      1. Initial program 100.0%

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

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                                      4. Step-by-step derivation
                                        1. Simplified94.6%

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

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

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

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

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

                                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \frac{1}{2}\right)\right)\right)\right), im\right) \]
                                          5. *-lowering-*.f642.0%

                                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), im\right) \]
                                        4. Simplified2.0%

                                          \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot 0.5\right)\right)} \cdot im \]
                                        5. Taylor expanded in re around inf

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

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

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

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

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

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

                                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, \frac{1}{2}\right), \left(\frac{\color{blue}{im}}{re}\right)\right)\right) \]
                                          7. /-lowering-/.f642.2%

                                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, \frac{1}{2}\right), \mathsf{/.f64}\left(im, \color{blue}{re}\right)\right)\right) \]
                                        7. Simplified2.2%

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

                                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \color{blue}{\left(\frac{im}{re}\right)}\right) \]
                                        9. Step-by-step derivation
                                          1. /-lowering-/.f6410.1%

                                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{/.f64}\left(im, \color{blue}{re}\right)\right) \]
                                        10. Simplified10.1%

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

                                        if -2.8000000000000001e-14 < re < 1050

                                        1. Initial program 99.9%

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

                                          \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                                        4. Step-by-step derivation
                                          1. Simplified51.5%

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

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

                                              \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), im\right) \]
                                            2. +-lowering-+.f6450.9%

                                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), im\right) \]
                                          4. Simplified50.9%

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

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

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

                                              \[\leadsto \mathsf{+.f64}\left(\left(im \cdot re\right), im\right) \]
                                            4. *-lowering-*.f6450.9%

                                              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, re\right), im\right) \]
                                          6. Applied egg-rr50.9%

                                            \[\leadsto \color{blue}{im \cdot re + im} \]

                                          if 1050 < re

                                          1. Initial program 100.0%

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

                                            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                                          4. Step-by-step derivation
                                            1. Simplified72.1%

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

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

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

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

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

                                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \frac{1}{2}\right)\right)\right)\right), im\right) \]
                                              5. *-lowering-*.f6448.8%

                                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), im\right) \]
                                            4. Simplified48.8%

                                              \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot 0.5\right)\right)} \cdot im \]
                                            5. Taylor expanded in re around inf

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

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

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

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

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

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

                                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, \frac{1}{2}\right), \left(\frac{\color{blue}{im}}{re}\right)\right)\right) \]
                                              7. /-lowering-/.f6448.8%

                                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, \frac{1}{2}\right), \mathsf{/.f64}\left(im, \color{blue}{re}\right)\right)\right) \]
                                            7. Simplified48.8%

                                              \[\leadsto \color{blue}{\left(re \cdot re\right) \cdot \left(im \cdot 0.5 + \frac{im}{re}\right)} \]
                                            8. Taylor expanded in re around inf

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

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

                                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(im, \color{blue}{\frac{1}{2}}\right)\right) \]
                                            10. Simplified48.8%

                                              \[\leadsto \left(re \cdot re\right) \cdot \color{blue}{\left(im \cdot 0.5\right)} \]
                                          5. Recombined 3 regimes into one program.
                                          6. Final simplification38.8%

                                            \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -2.8 \cdot 10^{-14}:\\ \;\;\;\;\left(re \cdot re\right) \cdot \frac{im}{re}\\ \mathbf{elif}\;re \leq 1050:\\ \;\;\;\;im + re \cdot im\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot 0.5\right)\\ \end{array} \]
                                          7. Add Preprocessing

                                          Alternative 17: 40.8% accurate, 12.7× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 1050:\\ \;\;\;\;\frac{re + re \cdot re}{\frac{re}{im}}\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(\left(0.5 + re \cdot 0.16666666666666666\right) \cdot \left(re \cdot re\right)\right)\\ \end{array} \end{array} \]
                                          (FPCore (re im)
                                           :precision binary64
                                           (if (<= re 1050.0)
                                             (/ (+ re (* re re)) (/ re im))
                                             (* im (* (+ 0.5 (* re 0.16666666666666666)) (* re re)))))
                                          double code(double re, double im) {
                                          	double tmp;
                                          	if (re <= 1050.0) {
                                          		tmp = (re + (re * re)) / (re / im);
                                          	} else {
                                          		tmp = im * ((0.5 + (re * 0.16666666666666666)) * (re * re));
                                          	}
                                          	return tmp;
                                          }
                                          
                                          real(8) function code(re, im)
                                              real(8), intent (in) :: re
                                              real(8), intent (in) :: im
                                              real(8) :: tmp
                                              if (re <= 1050.0d0) then
                                                  tmp = (re + (re * re)) / (re / im)
                                              else
                                                  tmp = im * ((0.5d0 + (re * 0.16666666666666666d0)) * (re * re))
                                              end if
                                              code = tmp
                                          end function
                                          
                                          public static double code(double re, double im) {
                                          	double tmp;
                                          	if (re <= 1050.0) {
                                          		tmp = (re + (re * re)) / (re / im);
                                          	} else {
                                          		tmp = im * ((0.5 + (re * 0.16666666666666666)) * (re * re));
                                          	}
                                          	return tmp;
                                          }
                                          
                                          def code(re, im):
                                          	tmp = 0
                                          	if re <= 1050.0:
                                          		tmp = (re + (re * re)) / (re / im)
                                          	else:
                                          		tmp = im * ((0.5 + (re * 0.16666666666666666)) * (re * re))
                                          	return tmp
                                          
                                          function code(re, im)
                                          	tmp = 0.0
                                          	if (re <= 1050.0)
                                          		tmp = Float64(Float64(re + Float64(re * re)) / Float64(re / im));
                                          	else
                                          		tmp = Float64(im * Float64(Float64(0.5 + Float64(re * 0.16666666666666666)) * Float64(re * re)));
                                          	end
                                          	return tmp
                                          end
                                          
                                          function tmp_2 = code(re, im)
                                          	tmp = 0.0;
                                          	if (re <= 1050.0)
                                          		tmp = (re + (re * re)) / (re / im);
                                          	else
                                          		tmp = im * ((0.5 + (re * 0.16666666666666666)) * (re * re));
                                          	end
                                          	tmp_2 = tmp;
                                          end
                                          
                                          code[re_, im_] := If[LessEqual[re, 1050.0], N[(N[(re + N[(re * re), $MachinePrecision]), $MachinePrecision] / N[(re / im), $MachinePrecision]), $MachinePrecision], N[(im * N[(N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;re \leq 1050:\\
                                          \;\;\;\;\frac{re + re \cdot re}{\frac{re}{im}}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;im \cdot \left(\left(0.5 + re \cdot 0.16666666666666666\right) \cdot \left(re \cdot re\right)\right)\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 2 regimes
                                          2. if re < 1050

                                            1. Initial program 100.0%

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

                                              \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                                            4. Step-by-step derivation
                                              1. Simplified67.7%

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

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

                                                  \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), im\right) \]
                                                2. +-lowering-+.f6432.8%

                                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), im\right) \]
                                              4. Simplified32.8%

                                                \[\leadsto \color{blue}{\left(re + 1\right)} \cdot im \]
                                              5. Applied egg-rr36.4%

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

                                              if 1050 < re

                                              1. Initial program 100.0%

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

                                                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                                              4. Step-by-step derivation
                                                1. Simplified72.1%

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

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

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

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

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

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

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

                                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), im\right) \]
                                                  7. *-lowering-*.f6456.4%

                                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \frac{1}{6}\right)\right)\right)\right)\right)\right), im\right) \]
                                                4. Simplified56.4%

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

                                                  \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left({re}^{3} \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)}, im\right) \]
                                                6. Step-by-step derivation
                                                  1. cube-multN/A

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

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

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

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

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

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

                                                    \[\leadsto \mathsf{*.f64}\left(\left(re \cdot \left(\frac{1}{6} \cdot {re}^{2} + \frac{1}{2} \cdot \left(\left(\frac{1}{re} \cdot re\right) \cdot re\right)\right)\right), im\right) \]
                                                  8. lft-mult-inverseN/A

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

                                                    \[\leadsto \mathsf{*.f64}\left(\left(re \cdot \left(\frac{1}{6} \cdot {re}^{2} + \frac{1}{2} \cdot re\right)\right), im\right) \]
                                                  10. unpow2N/A

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

                                                    \[\leadsto \mathsf{*.f64}\left(\left(re \cdot \left(\left(\frac{1}{6} \cdot re\right) \cdot re + \frac{1}{2} \cdot re\right)\right), im\right) \]
                                                  12. distribute-rgt-inN/A

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

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

                                                    \[\leadsto \mathsf{*.f64}\left(\left(\left(re \cdot re\right) \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right), im\right) \]
                                                  15. unpow2N/A

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

                                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({re}^{2}\right), \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right), im\right) \]
                                                  17. unpow2N/A

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

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

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

                                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right), im\right) \]
                                                  21. *-lowering-*.f6456.4%

                                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \frac{1}{6}\right)\right)\right), im\right) \]
                                                7. Simplified56.4%

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

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 1050:\\ \;\;\;\;\frac{re + re \cdot re}{\frac{re}{im}}\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(\left(0.5 + re \cdot 0.16666666666666666\right) \cdot \left(re \cdot re\right)\right)\\ \end{array} \]
                                              7. Add Preprocessing

                                              Alternative 18: 37.4% accurate, 16.9× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 1050:\\ \;\;\;\;im + re \cdot im\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot 0.5\right)\\ \end{array} \end{array} \]
                                              (FPCore (re im)
                                               :precision binary64
                                               (if (<= re 1050.0) (+ im (* re im)) (* (* re re) (* im 0.5))))
                                              double code(double re, double im) {
                                              	double tmp;
                                              	if (re <= 1050.0) {
                                              		tmp = im + (re * im);
                                              	} else {
                                              		tmp = (re * re) * (im * 0.5);
                                              	}
                                              	return tmp;
                                              }
                                              
                                              real(8) function code(re, im)
                                                  real(8), intent (in) :: re
                                                  real(8), intent (in) :: im
                                                  real(8) :: tmp
                                                  if (re <= 1050.0d0) then
                                                      tmp = im + (re * im)
                                                  else
                                                      tmp = (re * re) * (im * 0.5d0)
                                                  end if
                                                  code = tmp
                                              end function
                                              
                                              public static double code(double re, double im) {
                                              	double tmp;
                                              	if (re <= 1050.0) {
                                              		tmp = im + (re * im);
                                              	} else {
                                              		tmp = (re * re) * (im * 0.5);
                                              	}
                                              	return tmp;
                                              }
                                              
                                              def code(re, im):
                                              	tmp = 0
                                              	if re <= 1050.0:
                                              		tmp = im + (re * im)
                                              	else:
                                              		tmp = (re * re) * (im * 0.5)
                                              	return tmp
                                              
                                              function code(re, im)
                                              	tmp = 0.0
                                              	if (re <= 1050.0)
                                              		tmp = Float64(im + Float64(re * im));
                                              	else
                                              		tmp = Float64(Float64(re * re) * Float64(im * 0.5));
                                              	end
                                              	return tmp
                                              end
                                              
                                              function tmp_2 = code(re, im)
                                              	tmp = 0.0;
                                              	if (re <= 1050.0)
                                              		tmp = im + (re * im);
                                              	else
                                              		tmp = (re * re) * (im * 0.5);
                                              	end
                                              	tmp_2 = tmp;
                                              end
                                              
                                              code[re_, im_] := If[LessEqual[re, 1050.0], N[(im + N[(re * im), $MachinePrecision]), $MachinePrecision], N[(N[(re * re), $MachinePrecision] * N[(im * 0.5), $MachinePrecision]), $MachinePrecision]]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              \mathbf{if}\;re \leq 1050:\\
                                              \;\;\;\;im + re \cdot im\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot 0.5\right)\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 2 regimes
                                              2. if re < 1050

                                                1. Initial program 100.0%

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

                                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                                                4. Step-by-step derivation
                                                  1. Simplified67.7%

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

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

                                                      \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), im\right) \]
                                                    2. +-lowering-+.f6432.8%

                                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), im\right) \]
                                                  4. Simplified32.8%

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

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

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

                                                      \[\leadsto \mathsf{+.f64}\left(\left(im \cdot re\right), im\right) \]
                                                    4. *-lowering-*.f6432.8%

                                                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, re\right), im\right) \]
                                                  6. Applied egg-rr32.8%

                                                    \[\leadsto \color{blue}{im \cdot re + im} \]

                                                  if 1050 < re

                                                  1. Initial program 100.0%

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

                                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                                                  4. Step-by-step derivation
                                                    1. Simplified72.1%

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

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

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

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

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

                                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \frac{1}{2}\right)\right)\right)\right), im\right) \]
                                                      5. *-lowering-*.f6448.8%

                                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), im\right) \]
                                                    4. Simplified48.8%

                                                      \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot 0.5\right)\right)} \cdot im \]
                                                    5. Taylor expanded in re around inf

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

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

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

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

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

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

                                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, \frac{1}{2}\right), \left(\frac{\color{blue}{im}}{re}\right)\right)\right) \]
                                                      7. /-lowering-/.f6448.8%

                                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, \frac{1}{2}\right), \mathsf{/.f64}\left(im, \color{blue}{re}\right)\right)\right) \]
                                                    7. Simplified48.8%

                                                      \[\leadsto \color{blue}{\left(re \cdot re\right) \cdot \left(im \cdot 0.5 + \frac{im}{re}\right)} \]
                                                    8. Taylor expanded in re around inf

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

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

                                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(im, \color{blue}{\frac{1}{2}}\right)\right) \]
                                                    10. Simplified48.8%

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

                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 1050:\\ \;\;\;\;im + re \cdot im\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot re\right) \cdot \left(im \cdot 0.5\right)\\ \end{array} \]
                                                  7. Add Preprocessing

                                                  Alternative 19: 27.9% accurate, 25.3× speedup?

                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 1.25 \cdot 10^{+36}:\\ \;\;\;\;im\\ \mathbf{else}:\\ \;\;\;\;re \cdot im\\ \end{array} \end{array} \]
                                                  (FPCore (re im) :precision binary64 (if (<= im 1.25e+36) im (* re im)))
                                                  double code(double re, double im) {
                                                  	double tmp;
                                                  	if (im <= 1.25e+36) {
                                                  		tmp = im;
                                                  	} else {
                                                  		tmp = re * im;
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  real(8) function code(re, im)
                                                      real(8), intent (in) :: re
                                                      real(8), intent (in) :: im
                                                      real(8) :: tmp
                                                      if (im <= 1.25d+36) then
                                                          tmp = im
                                                      else
                                                          tmp = re * im
                                                      end if
                                                      code = tmp
                                                  end function
                                                  
                                                  public static double code(double re, double im) {
                                                  	double tmp;
                                                  	if (im <= 1.25e+36) {
                                                  		tmp = im;
                                                  	} else {
                                                  		tmp = re * im;
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  def code(re, im):
                                                  	tmp = 0
                                                  	if im <= 1.25e+36:
                                                  		tmp = im
                                                  	else:
                                                  		tmp = re * im
                                                  	return tmp
                                                  
                                                  function code(re, im)
                                                  	tmp = 0.0
                                                  	if (im <= 1.25e+36)
                                                  		tmp = im;
                                                  	else
                                                  		tmp = Float64(re * im);
                                                  	end
                                                  	return tmp
                                                  end
                                                  
                                                  function tmp_2 = code(re, im)
                                                  	tmp = 0.0;
                                                  	if (im <= 1.25e+36)
                                                  		tmp = im;
                                                  	else
                                                  		tmp = re * im;
                                                  	end
                                                  	tmp_2 = tmp;
                                                  end
                                                  
                                                  code[re_, im_] := If[LessEqual[im, 1.25e+36], im, N[(re * im), $MachinePrecision]]
                                                  
                                                  \begin{array}{l}
                                                  
                                                  \\
                                                  \begin{array}{l}
                                                  \mathbf{if}\;im \leq 1.25 \cdot 10^{+36}:\\
                                                  \;\;\;\;im\\
                                                  
                                                  \mathbf{else}:\\
                                                  \;\;\;\;re \cdot im\\
                                                  
                                                  
                                                  \end{array}
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 2 regimes
                                                  2. if im < 1.24999999999999994e36

                                                    1. Initial program 100.0%

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

                                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                                                    4. Step-by-step derivation
                                                      1. Simplified75.9%

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

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

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

                                                        if 1.24999999999999994e36 < im

                                                        1. Initial program 100.0%

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

                                                          \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                                                        4. Step-by-step derivation
                                                          1. Simplified44.1%

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

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

                                                              \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), im\right) \]
                                                            2. +-lowering-+.f648.9%

                                                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), im\right) \]
                                                          4. Simplified8.9%

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

                                                            \[\leadsto \mathsf{*.f64}\left(\color{blue}{re}, im\right) \]
                                                          6. Step-by-step derivation
                                                            1. Simplified9.2%

                                                              \[\leadsto \color{blue}{re} \cdot im \]
                                                          7. Recombined 2 regimes into one program.
                                                          8. Add Preprocessing

                                                          Alternative 20: 29.8% accurate, 40.6× speedup?

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

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

                                                            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                                                          4. Step-by-step derivation
                                                            1. Simplified68.7%

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

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

                                                                \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), im\right) \]
                                                              2. +-lowering-+.f6429.5%

                                                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), im\right) \]
                                                            4. Simplified29.5%

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

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

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

                                                                \[\leadsto \mathsf{+.f64}\left(\left(im \cdot re\right), im\right) \]
                                                              4. *-lowering-*.f6429.5%

                                                                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, re\right), im\right) \]
                                                            6. Applied egg-rr29.5%

                                                              \[\leadsto \color{blue}{im \cdot re + im} \]
                                                            7. Final simplification29.5%

                                                              \[\leadsto im + re \cdot im \]
                                                            8. Add Preprocessing

                                                            Alternative 21: 29.8% accurate, 40.6× speedup?

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

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

                                                              \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                                                            4. Step-by-step derivation
                                                              1. Simplified68.7%

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

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

                                                                  \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), im\right) \]
                                                                2. +-lowering-+.f6429.5%

                                                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), im\right) \]
                                                              4. Simplified29.5%

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

                                                                \[\leadsto im \cdot \left(re + 1\right) \]
                                                              6. Add Preprocessing

                                                              Alternative 22: 26.2% accurate, 203.0× speedup?

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

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

                                                                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \color{blue}{im}\right) \]
                                                              4. Step-by-step derivation
                                                                1. Simplified68.7%

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

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

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

                                                                  Reproduce

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