math.exp on complex, imaginary part

Percentage Accurate: 100.0% → 100.0%
Time: 20.8s
Alternatives: 24
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 24 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 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: 92.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{re} \cdot im\\ \mathbf{if}\;e^{re} \leq 0.9995:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;e^{re} \leq 1.05:\\ \;\;\;\;\sin im\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* (exp re) im)))
   (if (<= (exp re) 0.9995) t_0 (if (<= (exp re) 1.05) (sin im) t_0))))
double code(double re, double im) {
	double t_0 = exp(re) * im;
	double tmp;
	if (exp(re) <= 0.9995) {
		tmp = t_0;
	} else if (exp(re) <= 1.05) {
		tmp = sin(im);
	} else {
		tmp = t_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 (exp(re) <= 0.9995d0) then
        tmp = t_0
    else if (exp(re) <= 1.05d0) then
        tmp = sin(im)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = Math.exp(re) * im;
	double tmp;
	if (Math.exp(re) <= 0.9995) {
		tmp = t_0;
	} else if (Math.exp(re) <= 1.05) {
		tmp = Math.sin(im);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(re, im):
	t_0 = math.exp(re) * im
	tmp = 0
	if math.exp(re) <= 0.9995:
		tmp = t_0
	elif math.exp(re) <= 1.05:
		tmp = math.sin(im)
	else:
		tmp = t_0
	return tmp
function code(re, im)
	t_0 = Float64(exp(re) * im)
	tmp = 0.0
	if (exp(re) <= 0.9995)
		tmp = t_0;
	elseif (exp(re) <= 1.05)
		tmp = sin(im);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = exp(re) * im;
	tmp = 0.0;
	if (exp(re) <= 0.9995)
		tmp = t_0;
	elseif (exp(re) <= 1.05)
		tmp = sin(im);
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[N[Exp[re], $MachinePrecision], 0.9995], t$95$0, If[LessEqual[N[Exp[re], $MachinePrecision], 1.05], N[Sin[im], $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := e^{re} \cdot im\\
\mathbf{if}\;e^{re} \leq 0.9995:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;e^{re} \leq 1.05:\\
\;\;\;\;\sin im\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (exp.f64 re) < 0.99950000000000006 or 1.05000000000000004 < (exp.f64 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. Simplified92.1%

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

      if 0.99950000000000006 < (exp.f64 re) < 1.05000000000000004

      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.f6499.1%

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

        \[\leadsto \color{blue}{\sin im} \]
    5. Recombined 2 regimes into one program.
    6. Add Preprocessing

    Alternative 3: 97.7% accurate, 1.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{re} \cdot im\\ t_1 := \sin im \cdot \left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)\\ \mathbf{if}\;re \leq -0.038:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;re \leq 0.047:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;re \leq 1.02 \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)
              (+ 1.0 (* re (+ 1.0 (* re (+ 0.5 (* re 0.16666666666666666)))))))))
       (if (<= re -0.038)
         t_0
         (if (<= re 0.047) t_1 (if (<= re 1.02e+103) t_0 t_1)))))
    double code(double re, double im) {
    	double t_0 = exp(re) * im;
    	double t_1 = sin(im) * (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666))))));
    	double tmp;
    	if (re <= -0.038) {
    		tmp = t_0;
    	} else if (re <= 0.047) {
    		tmp = t_1;
    	} else if (re <= 1.02e+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) * (1.0d0 + (re * (1.0d0 + (re * (0.5d0 + (re * 0.16666666666666666d0))))))
        if (re <= (-0.038d0)) then
            tmp = t_0
        else if (re <= 0.047d0) then
            tmp = t_1
        else if (re <= 1.02d+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) * (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666))))));
    	double tmp;
    	if (re <= -0.038) {
    		tmp = t_0;
    	} else if (re <= 0.047) {
    		tmp = t_1;
    	} else if (re <= 1.02e+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) * (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666))))))
    	tmp = 0
    	if re <= -0.038:
    		tmp = t_0
    	elif re <= 0.047:
    		tmp = t_1
    	elif re <= 1.02e+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(1.0 + Float64(re * Float64(1.0 + Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666)))))))
    	tmp = 0.0
    	if (re <= -0.038)
    		tmp = t_0;
    	elseif (re <= 0.047)
    		tmp = t_1;
    	elseif (re <= 1.02e+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) * (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666))))));
    	tmp = 0.0;
    	if (re <= -0.038)
    		tmp = t_0;
    	elseif (re <= 0.047)
    		tmp = t_1;
    	elseif (re <= 1.02e+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[(1.0 + N[(re * N[(1.0 + N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -0.038], t$95$0, If[LessEqual[re, 0.047], t$95$1, If[LessEqual[re, 1.02e+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(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)\\
    \mathbf{if}\;re \leq -0.038:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;re \leq 0.047:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;re \leq 1.02 \cdot 10^{+103}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if re < -0.0379999999999999991 or 0.047 < re < 1.01999999999999991e103

      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. Simplified95.1%

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

        if -0.0379999999999999991 < re < 0.047 or 1.01999999999999991e103 < 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.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{sin.f64}\left(im\right)\right) \]
        5. Simplified99.6%

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

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

      Alternative 4: 96.6% accurate, 1.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{re} \cdot im\\ t_1 := \sin im \cdot \left(1 + re \cdot \left(1 + re \cdot 0.5\right)\right)\\ \mathbf{if}\;re \leq -0.015:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;re \leq 0.034:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;re \leq 1.85 \cdot 10^{+154}:\\ \;\;\;\;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) (+ 1.0 (* re (+ 1.0 (* re 0.5)))))))
         (if (<= re -0.015)
           t_0
           (if (<= re 0.034) t_1 (if (<= re 1.85e+154) t_0 t_1)))))
      double code(double re, double im) {
      	double t_0 = exp(re) * im;
      	double t_1 = sin(im) * (1.0 + (re * (1.0 + (re * 0.5))));
      	double tmp;
      	if (re <= -0.015) {
      		tmp = t_0;
      	} else if (re <= 0.034) {
      		tmp = t_1;
      	} else if (re <= 1.85e+154) {
      		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) * (1.0d0 + (re * (1.0d0 + (re * 0.5d0))))
          if (re <= (-0.015d0)) then
              tmp = t_0
          else if (re <= 0.034d0) then
              tmp = t_1
          else if (re <= 1.85d+154) 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) * (1.0 + (re * (1.0 + (re * 0.5))));
      	double tmp;
      	if (re <= -0.015) {
      		tmp = t_0;
      	} else if (re <= 0.034) {
      		tmp = t_1;
      	} else if (re <= 1.85e+154) {
      		tmp = t_0;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(re, im):
      	t_0 = math.exp(re) * im
      	t_1 = math.sin(im) * (1.0 + (re * (1.0 + (re * 0.5))))
      	tmp = 0
      	if re <= -0.015:
      		tmp = t_0
      	elif re <= 0.034:
      		tmp = t_1
      	elif re <= 1.85e+154:
      		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(1.0 + Float64(re * Float64(1.0 + Float64(re * 0.5)))))
      	tmp = 0.0
      	if (re <= -0.015)
      		tmp = t_0;
      	elseif (re <= 0.034)
      		tmp = t_1;
      	elseif (re <= 1.85e+154)
      		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) * (1.0 + (re * (1.0 + (re * 0.5))));
      	tmp = 0.0;
      	if (re <= -0.015)
      		tmp = t_0;
      	elseif (re <= 0.034)
      		tmp = t_1;
      	elseif (re <= 1.85e+154)
      		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[(1.0 + N[(re * N[(1.0 + N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -0.015], t$95$0, If[LessEqual[re, 0.034], t$95$1, If[LessEqual[re, 1.85e+154], t$95$0, t$95$1]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := e^{re} \cdot im\\
      t_1 := \sin im \cdot \left(1 + re \cdot \left(1 + re \cdot 0.5\right)\right)\\
      \mathbf{if}\;re \leq -0.015:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;re \leq 0.034:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;re \leq 1.85 \cdot 10^{+154}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if re < -0.014999999999999999 or 0.034000000000000002 < re < 1.84999999999999997e154

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

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

          if -0.014999999999999999 < re < 0.034000000000000002 or 1.84999999999999997e154 < 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-*.f6499.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. Simplified99.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 simplification97.3%

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

        Alternative 5: 92.9% accurate, 1.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{re} \cdot im\\ \mathbf{if}\;re \leq -0.00036:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;re \leq 0.024:\\ \;\;\;\;\sin im \cdot \left(re + 1\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
        (FPCore (re im)
         :precision binary64
         (let* ((t_0 (* (exp re) im)))
           (if (<= re -0.00036) t_0 (if (<= re 0.024) (* (sin im) (+ re 1.0)) t_0))))
        double code(double re, double im) {
        	double t_0 = exp(re) * im;
        	double tmp;
        	if (re <= -0.00036) {
        		tmp = t_0;
        	} else if (re <= 0.024) {
        		tmp = sin(im) * (re + 1.0);
        	} else {
        		tmp = t_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.00036d0)) then
                tmp = t_0
            else if (re <= 0.024d0) then
                tmp = sin(im) * (re + 1.0d0)
            else
                tmp = t_0
            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.00036) {
        		tmp = t_0;
        	} else if (re <= 0.024) {
        		tmp = Math.sin(im) * (re + 1.0);
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        def code(re, im):
        	t_0 = math.exp(re) * im
        	tmp = 0
        	if re <= -0.00036:
        		tmp = t_0
        	elif re <= 0.024:
        		tmp = math.sin(im) * (re + 1.0)
        	else:
        		tmp = t_0
        	return tmp
        
        function code(re, im)
        	t_0 = Float64(exp(re) * im)
        	tmp = 0.0
        	if (re <= -0.00036)
        		tmp = t_0;
        	elseif (re <= 0.024)
        		tmp = Float64(sin(im) * Float64(re + 1.0));
        	else
        		tmp = t_0;
        	end
        	return tmp
        end
        
        function tmp_2 = code(re, im)
        	t_0 = exp(re) * im;
        	tmp = 0.0;
        	if (re <= -0.00036)
        		tmp = t_0;
        	elseif (re <= 0.024)
        		tmp = sin(im) * (re + 1.0);
        	else
        		tmp = t_0;
        	end
        	tmp_2 = tmp;
        end
        
        code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * im), $MachinePrecision]}, If[LessEqual[re, -0.00036], t$95$0, If[LessEqual[re, 0.024], N[(N[Sin[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := e^{re} \cdot im\\
        \mathbf{if}\;re \leq -0.00036:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;re \leq 0.024:\\
        \;\;\;\;\sin im \cdot \left(re + 1\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if re < -3.60000000000000023e-4 or 0.024 < 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. Simplified92.1%

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

            if -3.60000000000000023e-4 < re < 0.024

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

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

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -0.00036:\\ \;\;\;\;e^{re} \cdot im\\ \mathbf{elif}\;re \leq 0.024:\\ \;\;\;\;\sin im \cdot \left(re + 1\right)\\ \mathbf{else}:\\ \;\;\;\;e^{re} \cdot im\\ \end{array} \]
          7. Add Preprocessing

          Alternative 6: 73.7% accurate, 1.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 + re \cdot 0.16666666666666666\\ t_1 := 1 + re \cdot t\_0\\ t_2 := re \cdot t\_1\\ t_3 := t\_0 \cdot \left(re \cdot re\right)\\ \mathbf{if}\;re \leq -48000000000000:\\ \;\;\;\;\left(re + 1\right) \cdot \left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right)\\ \mathbf{elif}\;re \leq 0.024:\\ \;\;\;\;\sin im\\ \mathbf{elif}\;re \leq 1.15 \cdot 10^{+51}:\\ \;\;\;\;\frac{im \cdot \left(1 + t\_2 \cdot \left(\left(re \cdot re\right) \cdot \left(t\_1 \cdot t\_1\right)\right)\right)}{1 + t\_2 \cdot \left(t\_2 + -1\right)}\\ \mathbf{elif}\;re \leq 1.02 \cdot 10^{+103}:\\ \;\;\;\;im \cdot \left(1 + \frac{re \cdot re - t\_3 \cdot t\_3}{re - t\_3}\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right)\right)\\ \end{array} \end{array} \]
          (FPCore (re im)
           :precision binary64
           (let* ((t_0 (+ 0.5 (* re 0.16666666666666666)))
                  (t_1 (+ 1.0 (* re t_0)))
                  (t_2 (* re t_1))
                  (t_3 (* t_0 (* re re))))
             (if (<= re -48000000000000.0)
               (* (+ re 1.0) (* im (* -0.16666666666666666 (* im im))))
               (if (<= re 0.024)
                 (sin im)
                 (if (<= re 1.15e+51)
                   (/
                    (* im (+ 1.0 (* t_2 (* (* re re) (* t_1 t_1)))))
                    (+ 1.0 (* t_2 (+ t_2 -1.0))))
                   (if (<= re 1.02e+103)
                     (* im (+ 1.0 (/ (- (* re re) (* t_3 t_3)) (- re t_3))))
                     (* im (* re (* re (* re 0.16666666666666666))))))))))
          double code(double re, double im) {
          	double t_0 = 0.5 + (re * 0.16666666666666666);
          	double t_1 = 1.0 + (re * t_0);
          	double t_2 = re * t_1;
          	double t_3 = t_0 * (re * re);
          	double tmp;
          	if (re <= -48000000000000.0) {
          		tmp = (re + 1.0) * (im * (-0.16666666666666666 * (im * im)));
          	} else if (re <= 0.024) {
          		tmp = sin(im);
          	} else if (re <= 1.15e+51) {
          		tmp = (im * (1.0 + (t_2 * ((re * re) * (t_1 * t_1))))) / (1.0 + (t_2 * (t_2 + -1.0)));
          	} else if (re <= 1.02e+103) {
          		tmp = im * (1.0 + (((re * re) - (t_3 * t_3)) / (re - t_3)));
          	} else {
          		tmp = im * (re * (re * (re * 0.16666666666666666)));
          	}
          	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) :: t_2
              real(8) :: t_3
              real(8) :: tmp
              t_0 = 0.5d0 + (re * 0.16666666666666666d0)
              t_1 = 1.0d0 + (re * t_0)
              t_2 = re * t_1
              t_3 = t_0 * (re * re)
              if (re <= (-48000000000000.0d0)) then
                  tmp = (re + 1.0d0) * (im * ((-0.16666666666666666d0) * (im * im)))
              else if (re <= 0.024d0) then
                  tmp = sin(im)
              else if (re <= 1.15d+51) then
                  tmp = (im * (1.0d0 + (t_2 * ((re * re) * (t_1 * t_1))))) / (1.0d0 + (t_2 * (t_2 + (-1.0d0))))
              else if (re <= 1.02d+103) then
                  tmp = im * (1.0d0 + (((re * re) - (t_3 * t_3)) / (re - t_3)))
              else
                  tmp = im * (re * (re * (re * 0.16666666666666666d0)))
              end if
              code = tmp
          end function
          
          public static double code(double re, double im) {
          	double t_0 = 0.5 + (re * 0.16666666666666666);
          	double t_1 = 1.0 + (re * t_0);
          	double t_2 = re * t_1;
          	double t_3 = t_0 * (re * re);
          	double tmp;
          	if (re <= -48000000000000.0) {
          		tmp = (re + 1.0) * (im * (-0.16666666666666666 * (im * im)));
          	} else if (re <= 0.024) {
          		tmp = Math.sin(im);
          	} else if (re <= 1.15e+51) {
          		tmp = (im * (1.0 + (t_2 * ((re * re) * (t_1 * t_1))))) / (1.0 + (t_2 * (t_2 + -1.0)));
          	} else if (re <= 1.02e+103) {
          		tmp = im * (1.0 + (((re * re) - (t_3 * t_3)) / (re - t_3)));
          	} else {
          		tmp = im * (re * (re * (re * 0.16666666666666666)));
          	}
          	return tmp;
          }
          
          def code(re, im):
          	t_0 = 0.5 + (re * 0.16666666666666666)
          	t_1 = 1.0 + (re * t_0)
          	t_2 = re * t_1
          	t_3 = t_0 * (re * re)
          	tmp = 0
          	if re <= -48000000000000.0:
          		tmp = (re + 1.0) * (im * (-0.16666666666666666 * (im * im)))
          	elif re <= 0.024:
          		tmp = math.sin(im)
          	elif re <= 1.15e+51:
          		tmp = (im * (1.0 + (t_2 * ((re * re) * (t_1 * t_1))))) / (1.0 + (t_2 * (t_2 + -1.0)))
          	elif re <= 1.02e+103:
          		tmp = im * (1.0 + (((re * re) - (t_3 * t_3)) / (re - t_3)))
          	else:
          		tmp = im * (re * (re * (re * 0.16666666666666666)))
          	return tmp
          
          function code(re, im)
          	t_0 = Float64(0.5 + Float64(re * 0.16666666666666666))
          	t_1 = Float64(1.0 + Float64(re * t_0))
          	t_2 = Float64(re * t_1)
          	t_3 = Float64(t_0 * Float64(re * re))
          	tmp = 0.0
          	if (re <= -48000000000000.0)
          		tmp = Float64(Float64(re + 1.0) * Float64(im * Float64(-0.16666666666666666 * Float64(im * im))));
          	elseif (re <= 0.024)
          		tmp = sin(im);
          	elseif (re <= 1.15e+51)
          		tmp = Float64(Float64(im * Float64(1.0 + Float64(t_2 * Float64(Float64(re * re) * Float64(t_1 * t_1))))) / Float64(1.0 + Float64(t_2 * Float64(t_2 + -1.0))));
          	elseif (re <= 1.02e+103)
          		tmp = Float64(im * Float64(1.0 + Float64(Float64(Float64(re * re) - Float64(t_3 * t_3)) / Float64(re - t_3))));
          	else
          		tmp = Float64(im * Float64(re * Float64(re * Float64(re * 0.16666666666666666))));
          	end
          	return tmp
          end
          
          function tmp_2 = code(re, im)
          	t_0 = 0.5 + (re * 0.16666666666666666);
          	t_1 = 1.0 + (re * t_0);
          	t_2 = re * t_1;
          	t_3 = t_0 * (re * re);
          	tmp = 0.0;
          	if (re <= -48000000000000.0)
          		tmp = (re + 1.0) * (im * (-0.16666666666666666 * (im * im)));
          	elseif (re <= 0.024)
          		tmp = sin(im);
          	elseif (re <= 1.15e+51)
          		tmp = (im * (1.0 + (t_2 * ((re * re) * (t_1 * t_1))))) / (1.0 + (t_2 * (t_2 + -1.0)));
          	elseif (re <= 1.02e+103)
          		tmp = im * (1.0 + (((re * re) - (t_3 * t_3)) / (re - t_3)));
          	else
          		tmp = im * (re * (re * (re * 0.16666666666666666)));
          	end
          	tmp_2 = tmp;
          end
          
          code[re_, im_] := Block[{t$95$0 = N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(re * t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(re * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 * N[(re * re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -48000000000000.0], N[(N[(re + 1.0), $MachinePrecision] * N[(im * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 0.024], N[Sin[im], $MachinePrecision], If[LessEqual[re, 1.15e+51], N[(N[(im * N[(1.0 + N[(t$95$2 * N[(N[(re * re), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(t$95$2 * N[(t$95$2 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.02e+103], N[(im * N[(1.0 + N[(N[(N[(re * re), $MachinePrecision] - N[(t$95$3 * t$95$3), $MachinePrecision]), $MachinePrecision] / N[(re - t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(re * N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := 0.5 + re \cdot 0.16666666666666666\\
          t_1 := 1 + re \cdot t\_0\\
          t_2 := re \cdot t\_1\\
          t_3 := t\_0 \cdot \left(re \cdot re\right)\\
          \mathbf{if}\;re \leq -48000000000000:\\
          \;\;\;\;\left(re + 1\right) \cdot \left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right)\\
          
          \mathbf{elif}\;re \leq 0.024:\\
          \;\;\;\;\sin im\\
          
          \mathbf{elif}\;re \leq 1.15 \cdot 10^{+51}:\\
          \;\;\;\;\frac{im \cdot \left(1 + t\_2 \cdot \left(\left(re \cdot re\right) \cdot \left(t\_1 \cdot t\_1\right)\right)\right)}{1 + t\_2 \cdot \left(t\_2 + -1\right)}\\
          
          \mathbf{elif}\;re \leq 1.02 \cdot 10^{+103}:\\
          \;\;\;\;im \cdot \left(1 + \frac{re \cdot re - t\_3 \cdot t\_3}{re - t\_3}\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 5 regimes
          2. if re < -4.8e13

            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. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
              12. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
              13. *-lowering-*.f6465.8%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
            5. Simplified65.8%

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

              \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\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) \]
            7. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \mathsf{*.f64}\left(\left(re + 1\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) \]
              2. +-lowering-+.f642.6%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\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) \]
            8. Simplified2.6%

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

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

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

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

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

            if -4.8e13 < re < 0.024

            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.f6495.3%

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

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

            if 0.024 < re < 1.15000000000000003e51

            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.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-*.f647.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. Simplified7.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. Step-by-step derivation
                1. flip3-+N/A

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

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

                  \[\leadsto \mathsf{/.f64}\left(\left(\left({1}^{3} + {\left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + re \cdot \frac{1}{6}\right)\right)\right)}^{3}\right) \cdot im\right), \color{blue}{\left(1 \cdot 1 + \left(\left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + re \cdot \frac{1}{6}\right)\right)\right) \cdot \left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + re \cdot \frac{1}{6}\right)\right)\right) - 1 \cdot \left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + re \cdot \frac{1}{6}\right)\right)\right)\right)\right)}\right) \]
              6. Applied egg-rr39.3%

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

              if 1.15000000000000003e51 < re < 1.01999999999999991e103

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

                  \[\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-*.f6428.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. Simplified28.9%

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(re \cdot re - \left(\left(re \cdot \left(\frac{1}{2} + re \cdot \frac{1}{6}\right)\right) \cdot re\right) \cdot \left(\left(re \cdot \left(\frac{1}{2} + re \cdot \frac{1}{6}\right)\right) \cdot re\right)\right), \left(re - \left(re \cdot \left(\frac{1}{2} + re \cdot \frac{1}{6}\right)\right) \cdot re\right)\right)\right), im\right) \]
                6. Applied egg-rr100.0%

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

                if 1.01999999999999991e103 < 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. Simplified85.0%

                    \[\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-*.f6485.0%

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

                    \[\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. cube-multN/A

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -48000000000000:\\ \;\;\;\;\left(re + 1\right) \cdot \left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right)\\ \mathbf{elif}\;re \leq 0.024:\\ \;\;\;\;\sin im\\ \mathbf{elif}\;re \leq 1.15 \cdot 10^{+51}:\\ \;\;\;\;\frac{im \cdot \left(1 + \left(re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right) \cdot \left(\left(re \cdot re\right) \cdot \left(\left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right) \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)\right)\right)}{1 + \left(re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right) \cdot \left(re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right) + -1\right)}\\ \mathbf{elif}\;re \leq 1.02 \cdot 10^{+103}:\\ \;\;\;\;im \cdot \left(1 + \frac{re \cdot re - \left(\left(0.5 + re \cdot 0.16666666666666666\right) \cdot \left(re \cdot re\right)\right) \cdot \left(\left(0.5 + re \cdot 0.16666666666666666\right) \cdot \left(re \cdot re\right)\right)}{re - \left(0.5 + re \cdot 0.16666666666666666\right) \cdot \left(re \cdot re\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right)\right)\\ \end{array} \]
                7. Add Preprocessing

                Alternative 7: 50.9% accurate, 2.6× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 + re \cdot 0.16666666666666666\\ t_1 := 1 + re \cdot t\_0\\ t_2 := re \cdot t\_1\\ t_3 := t\_0 \cdot \left(re \cdot re\right)\\ \mathbf{if}\;re \leq -600000:\\ \;\;\;\;\left(re + 1\right) \cdot \left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right)\\ \mathbf{elif}\;re \leq 1.15 \cdot 10^{+51}:\\ \;\;\;\;\frac{im \cdot \left(1 + t\_2 \cdot \left(\left(re \cdot re\right) \cdot \left(t\_1 \cdot t\_1\right)\right)\right)}{1 + t\_2 \cdot \left(t\_2 + -1\right)}\\ \mathbf{elif}\;re \leq 1.02 \cdot 10^{+103}:\\ \;\;\;\;im \cdot \left(1 + \frac{re \cdot re - t\_3 \cdot t\_3}{re - t\_3}\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right)\right)\\ \end{array} \end{array} \]
                (FPCore (re im)
                 :precision binary64
                 (let* ((t_0 (+ 0.5 (* re 0.16666666666666666)))
                        (t_1 (+ 1.0 (* re t_0)))
                        (t_2 (* re t_1))
                        (t_3 (* t_0 (* re re))))
                   (if (<= re -600000.0)
                     (* (+ re 1.0) (* im (* -0.16666666666666666 (* im im))))
                     (if (<= re 1.15e+51)
                       (/
                        (* im (+ 1.0 (* t_2 (* (* re re) (* t_1 t_1)))))
                        (+ 1.0 (* t_2 (+ t_2 -1.0))))
                       (if (<= re 1.02e+103)
                         (* im (+ 1.0 (/ (- (* re re) (* t_3 t_3)) (- re t_3))))
                         (* im (* re (* re (* re 0.16666666666666666)))))))))
                double code(double re, double im) {
                	double t_0 = 0.5 + (re * 0.16666666666666666);
                	double t_1 = 1.0 + (re * t_0);
                	double t_2 = re * t_1;
                	double t_3 = t_0 * (re * re);
                	double tmp;
                	if (re <= -600000.0) {
                		tmp = (re + 1.0) * (im * (-0.16666666666666666 * (im * im)));
                	} else if (re <= 1.15e+51) {
                		tmp = (im * (1.0 + (t_2 * ((re * re) * (t_1 * t_1))))) / (1.0 + (t_2 * (t_2 + -1.0)));
                	} else if (re <= 1.02e+103) {
                		tmp = im * (1.0 + (((re * re) - (t_3 * t_3)) / (re - t_3)));
                	} else {
                		tmp = im * (re * (re * (re * 0.16666666666666666)));
                	}
                	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) :: t_2
                    real(8) :: t_3
                    real(8) :: tmp
                    t_0 = 0.5d0 + (re * 0.16666666666666666d0)
                    t_1 = 1.0d0 + (re * t_0)
                    t_2 = re * t_1
                    t_3 = t_0 * (re * re)
                    if (re <= (-600000.0d0)) then
                        tmp = (re + 1.0d0) * (im * ((-0.16666666666666666d0) * (im * im)))
                    else if (re <= 1.15d+51) then
                        tmp = (im * (1.0d0 + (t_2 * ((re * re) * (t_1 * t_1))))) / (1.0d0 + (t_2 * (t_2 + (-1.0d0))))
                    else if (re <= 1.02d+103) then
                        tmp = im * (1.0d0 + (((re * re) - (t_3 * t_3)) / (re - t_3)))
                    else
                        tmp = im * (re * (re * (re * 0.16666666666666666d0)))
                    end if
                    code = tmp
                end function
                
                public static double code(double re, double im) {
                	double t_0 = 0.5 + (re * 0.16666666666666666);
                	double t_1 = 1.0 + (re * t_0);
                	double t_2 = re * t_1;
                	double t_3 = t_0 * (re * re);
                	double tmp;
                	if (re <= -600000.0) {
                		tmp = (re + 1.0) * (im * (-0.16666666666666666 * (im * im)));
                	} else if (re <= 1.15e+51) {
                		tmp = (im * (1.0 + (t_2 * ((re * re) * (t_1 * t_1))))) / (1.0 + (t_2 * (t_2 + -1.0)));
                	} else if (re <= 1.02e+103) {
                		tmp = im * (1.0 + (((re * re) - (t_3 * t_3)) / (re - t_3)));
                	} else {
                		tmp = im * (re * (re * (re * 0.16666666666666666)));
                	}
                	return tmp;
                }
                
                def code(re, im):
                	t_0 = 0.5 + (re * 0.16666666666666666)
                	t_1 = 1.0 + (re * t_0)
                	t_2 = re * t_1
                	t_3 = t_0 * (re * re)
                	tmp = 0
                	if re <= -600000.0:
                		tmp = (re + 1.0) * (im * (-0.16666666666666666 * (im * im)))
                	elif re <= 1.15e+51:
                		tmp = (im * (1.0 + (t_2 * ((re * re) * (t_1 * t_1))))) / (1.0 + (t_2 * (t_2 + -1.0)))
                	elif re <= 1.02e+103:
                		tmp = im * (1.0 + (((re * re) - (t_3 * t_3)) / (re - t_3)))
                	else:
                		tmp = im * (re * (re * (re * 0.16666666666666666)))
                	return tmp
                
                function code(re, im)
                	t_0 = Float64(0.5 + Float64(re * 0.16666666666666666))
                	t_1 = Float64(1.0 + Float64(re * t_0))
                	t_2 = Float64(re * t_1)
                	t_3 = Float64(t_0 * Float64(re * re))
                	tmp = 0.0
                	if (re <= -600000.0)
                		tmp = Float64(Float64(re + 1.0) * Float64(im * Float64(-0.16666666666666666 * Float64(im * im))));
                	elseif (re <= 1.15e+51)
                		tmp = Float64(Float64(im * Float64(1.0 + Float64(t_2 * Float64(Float64(re * re) * Float64(t_1 * t_1))))) / Float64(1.0 + Float64(t_2 * Float64(t_2 + -1.0))));
                	elseif (re <= 1.02e+103)
                		tmp = Float64(im * Float64(1.0 + Float64(Float64(Float64(re * re) - Float64(t_3 * t_3)) / Float64(re - t_3))));
                	else
                		tmp = Float64(im * Float64(re * Float64(re * Float64(re * 0.16666666666666666))));
                	end
                	return tmp
                end
                
                function tmp_2 = code(re, im)
                	t_0 = 0.5 + (re * 0.16666666666666666);
                	t_1 = 1.0 + (re * t_0);
                	t_2 = re * t_1;
                	t_3 = t_0 * (re * re);
                	tmp = 0.0;
                	if (re <= -600000.0)
                		tmp = (re + 1.0) * (im * (-0.16666666666666666 * (im * im)));
                	elseif (re <= 1.15e+51)
                		tmp = (im * (1.0 + (t_2 * ((re * re) * (t_1 * t_1))))) / (1.0 + (t_2 * (t_2 + -1.0)));
                	elseif (re <= 1.02e+103)
                		tmp = im * (1.0 + (((re * re) - (t_3 * t_3)) / (re - t_3)));
                	else
                		tmp = im * (re * (re * (re * 0.16666666666666666)));
                	end
                	tmp_2 = tmp;
                end
                
                code[re_, im_] := Block[{t$95$0 = N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(re * t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(re * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 * N[(re * re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -600000.0], N[(N[(re + 1.0), $MachinePrecision] * N[(im * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.15e+51], N[(N[(im * N[(1.0 + N[(t$95$2 * N[(N[(re * re), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(t$95$2 * N[(t$95$2 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.02e+103], N[(im * N[(1.0 + N[(N[(N[(re * re), $MachinePrecision] - N[(t$95$3 * t$95$3), $MachinePrecision]), $MachinePrecision] / N[(re - t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(re * N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := 0.5 + re \cdot 0.16666666666666666\\
                t_1 := 1 + re \cdot t\_0\\
                t_2 := re \cdot t\_1\\
                t_3 := t\_0 \cdot \left(re \cdot re\right)\\
                \mathbf{if}\;re \leq -600000:\\
                \;\;\;\;\left(re + 1\right) \cdot \left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right)\\
                
                \mathbf{elif}\;re \leq 1.15 \cdot 10^{+51}:\\
                \;\;\;\;\frac{im \cdot \left(1 + t\_2 \cdot \left(\left(re \cdot re\right) \cdot \left(t\_1 \cdot t\_1\right)\right)\right)}{1 + t\_2 \cdot \left(t\_2 + -1\right)}\\
                
                \mathbf{elif}\;re \leq 1.02 \cdot 10^{+103}:\\
                \;\;\;\;im \cdot \left(1 + \frac{re \cdot re - t\_3 \cdot t\_3}{re - t\_3}\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right)\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 4 regimes
                2. if re < -6e5

                  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. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                    12. unpow2N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                    13. *-lowering-*.f6465.3%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                  5. Simplified65.3%

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

                    \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\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) \]
                  7. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\left(re + 1\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) \]
                    2. +-lowering-+.f642.6%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\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) \]
                  8. Simplified2.6%

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

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

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

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

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

                  if -6e5 < re < 1.15000000000000003e51

                  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. 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 \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-*.f6441.3%

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

                      \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)} \cdot im \]
                    5. Step-by-step derivation
                      1. flip3-+N/A

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

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

                        \[\leadsto \mathsf{/.f64}\left(\left(\left({1}^{3} + {\left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + re \cdot \frac{1}{6}\right)\right)\right)}^{3}\right) \cdot im\right), \color{blue}{\left(1 \cdot 1 + \left(\left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + re \cdot \frac{1}{6}\right)\right)\right) \cdot \left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + re \cdot \frac{1}{6}\right)\right)\right) - 1 \cdot \left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + re \cdot \frac{1}{6}\right)\right)\right)\right)\right)}\right) \]
                    6. Applied egg-rr45.6%

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

                    if 1.15000000000000003e51 < re < 1.01999999999999991e103

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

                        \[\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-*.f6428.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. Simplified28.9%

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(re \cdot re - \left(\left(re \cdot \left(\frac{1}{2} + re \cdot \frac{1}{6}\right)\right) \cdot re\right) \cdot \left(\left(re \cdot \left(\frac{1}{2} + re \cdot \frac{1}{6}\right)\right) \cdot re\right)\right), \left(re - \left(re \cdot \left(\frac{1}{2} + re \cdot \frac{1}{6}\right)\right) \cdot re\right)\right)\right), im\right) \]
                      6. Applied egg-rr100.0%

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

                      if 1.01999999999999991e103 < 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. Simplified85.0%

                          \[\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-*.f6485.0%

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

                          \[\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. cube-multN/A

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 8: 49.1% accurate, 4.0× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := re \cdot \left(re \cdot 0.5\right)\\ \mathbf{if}\;re \leq -600000:\\ \;\;\;\;\left(re + 1\right) \cdot \left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right)\\ \mathbf{elif}\;re \leq 2 \cdot 10^{+97}:\\ \;\;\;\;\left(1 + \frac{re \cdot re - t\_0 \cdot t\_0}{re - t\_0}\right) \cdot \left(im \cdot \left(1 + im \cdot \left(im \cdot \left(-0.16666666666666666 + im \cdot \left(im \cdot 0.008333333333333333\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right)\right)\\ \end{array} \end{array} \]
                      (FPCore (re im)
                       :precision binary64
                       (let* ((t_0 (* re (* re 0.5))))
                         (if (<= re -600000.0)
                           (* (+ re 1.0) (* im (* -0.16666666666666666 (* im im))))
                           (if (<= re 2e+97)
                             (*
                              (+ 1.0 (/ (- (* re re) (* t_0 t_0)) (- re t_0)))
                              (*
                               im
                               (+
                                1.0
                                (*
                                 im
                                 (*
                                  im
                                  (+ -0.16666666666666666 (* im (* im 0.008333333333333333))))))))
                             (* im (* re (* re (* re 0.16666666666666666))))))))
                      double code(double re, double im) {
                      	double t_0 = re * (re * 0.5);
                      	double tmp;
                      	if (re <= -600000.0) {
                      		tmp = (re + 1.0) * (im * (-0.16666666666666666 * (im * im)));
                      	} else if (re <= 2e+97) {
                      		tmp = (1.0 + (((re * re) - (t_0 * t_0)) / (re - t_0))) * (im * (1.0 + (im * (im * (-0.16666666666666666 + (im * (im * 0.008333333333333333)))))));
                      	} else {
                      		tmp = im * (re * (re * (re * 0.16666666666666666)));
                      	}
                      	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)
                          if (re <= (-600000.0d0)) then
                              tmp = (re + 1.0d0) * (im * ((-0.16666666666666666d0) * (im * im)))
                          else if (re <= 2d+97) then
                              tmp = (1.0d0 + (((re * re) - (t_0 * t_0)) / (re - t_0))) * (im * (1.0d0 + (im * (im * ((-0.16666666666666666d0) + (im * (im * 0.008333333333333333d0)))))))
                          else
                              tmp = im * (re * (re * (re * 0.16666666666666666d0)))
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double re, double im) {
                      	double t_0 = re * (re * 0.5);
                      	double tmp;
                      	if (re <= -600000.0) {
                      		tmp = (re + 1.0) * (im * (-0.16666666666666666 * (im * im)));
                      	} else if (re <= 2e+97) {
                      		tmp = (1.0 + (((re * re) - (t_0 * t_0)) / (re - t_0))) * (im * (1.0 + (im * (im * (-0.16666666666666666 + (im * (im * 0.008333333333333333)))))));
                      	} else {
                      		tmp = im * (re * (re * (re * 0.16666666666666666)));
                      	}
                      	return tmp;
                      }
                      
                      def code(re, im):
                      	t_0 = re * (re * 0.5)
                      	tmp = 0
                      	if re <= -600000.0:
                      		tmp = (re + 1.0) * (im * (-0.16666666666666666 * (im * im)))
                      	elif re <= 2e+97:
                      		tmp = (1.0 + (((re * re) - (t_0 * t_0)) / (re - t_0))) * (im * (1.0 + (im * (im * (-0.16666666666666666 + (im * (im * 0.008333333333333333)))))))
                      	else:
                      		tmp = im * (re * (re * (re * 0.16666666666666666)))
                      	return tmp
                      
                      function code(re, im)
                      	t_0 = Float64(re * Float64(re * 0.5))
                      	tmp = 0.0
                      	if (re <= -600000.0)
                      		tmp = Float64(Float64(re + 1.0) * Float64(im * Float64(-0.16666666666666666 * Float64(im * im))));
                      	elseif (re <= 2e+97)
                      		tmp = Float64(Float64(1.0 + Float64(Float64(Float64(re * re) - Float64(t_0 * t_0)) / Float64(re - t_0))) * Float64(im * Float64(1.0 + Float64(im * Float64(im * Float64(-0.16666666666666666 + Float64(im * Float64(im * 0.008333333333333333))))))));
                      	else
                      		tmp = Float64(im * Float64(re * Float64(re * Float64(re * 0.16666666666666666))));
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(re, im)
                      	t_0 = re * (re * 0.5);
                      	tmp = 0.0;
                      	if (re <= -600000.0)
                      		tmp = (re + 1.0) * (im * (-0.16666666666666666 * (im * im)));
                      	elseif (re <= 2e+97)
                      		tmp = (1.0 + (((re * re) - (t_0 * t_0)) / (re - t_0))) * (im * (1.0 + (im * (im * (-0.16666666666666666 + (im * (im * 0.008333333333333333)))))));
                      	else
                      		tmp = im * (re * (re * (re * 0.16666666666666666)));
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[re_, im_] := Block[{t$95$0 = N[(re * N[(re * 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -600000.0], N[(N[(re + 1.0), $MachinePrecision] * N[(im * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 2e+97], N[(N[(1.0 + N[(N[(N[(re * re), $MachinePrecision] - N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(re - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(im * N[(1.0 + N[(im * N[(im * N[(-0.16666666666666666 + N[(im * N[(im * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(re * N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_0 := re \cdot \left(re \cdot 0.5\right)\\
                      \mathbf{if}\;re \leq -600000:\\
                      \;\;\;\;\left(re + 1\right) \cdot \left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right)\\
                      
                      \mathbf{elif}\;re \leq 2 \cdot 10^{+97}:\\
                      \;\;\;\;\left(1 + \frac{re \cdot re - t\_0 \cdot t\_0}{re - t\_0}\right) \cdot \left(im \cdot \left(1 + im \cdot \left(im \cdot \left(-0.16666666666666666 + im \cdot \left(im \cdot 0.008333333333333333\right)\right)\right)\right)\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right)\right)\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if re < -6e5

                        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. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                          12. unpow2N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                          13. *-lowering-*.f6465.3%

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                        5. Simplified65.3%

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

                          \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\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) \]
                        7. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto \mathsf{*.f64}\left(\left(re + 1\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) \]
                          2. +-lowering-+.f642.6%

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\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) \]
                        8. Simplified2.6%

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

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

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

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

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

                        if -6e5 < re < 2.0000000000000001e97

                        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-*.f6480.7%

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

                          \[\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 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\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 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\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({im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)}\right)\right)\right) \]
                          3. 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, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{120} \cdot {im}^{2}} - \frac{1}{6}\right)\right)\right)\right)\right) \]
                          4. 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, \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)\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, \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)\right) \]
                          6. *-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(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)}\right)\right)\right)\right)\right) \]
                          7. sub-negN/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(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)\right) \]
                          8. metadata-evalN/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(im, \mathsf{*.f64}\left(im, \left(\frac{1}{120} \cdot {im}^{2} + \frac{-1}{6}\right)\right)\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, \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)\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(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)\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(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)\right) \]
                          12. 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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \left(\left(im \cdot im\right) \cdot \frac{1}{120}\right)\right)\right)\right)\right)\right)\right) \]
                          13. 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, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \left(im \cdot \color{blue}{\left(im \cdot \frac{1}{120}\right)}\right)\right)\right)\right)\right)\right)\right) \]
                          14. *-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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \frac{1}{120}\right)}\right)\right)\right)\right)\right)\right)\right) \]
                          15. *-lowering-*.f6442.7%

                            \[\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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{1}{120}}\right)\right)\right)\right)\right)\right)\right)\right) \]
                        8. Simplified42.7%

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(re \cdot 1 + re \cdot \left(re \cdot \frac{1}{2}\right)\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                          2. *-rgt-identityN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(re + re \cdot \left(re \cdot \frac{1}{2}\right)\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                          3. flip-+N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{re \cdot re - \left(re \cdot \left(re \cdot \frac{1}{2}\right)\right) \cdot \left(re \cdot \left(re \cdot \frac{1}{2}\right)\right)}{re - re \cdot \left(re \cdot \frac{1}{2}\right)}\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                          4. *-lft-identityN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{re \cdot re - \left(re \cdot \left(re \cdot \frac{1}{2}\right)\right) \cdot \left(re \cdot \left(re \cdot \frac{1}{2}\right)\right)}{1 \cdot re - re \cdot \left(re \cdot \frac{1}{2}\right)}\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                          5. fmm-defN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{re \cdot re - \left(re \cdot \left(re \cdot \frac{1}{2}\right)\right) \cdot \left(re \cdot \left(re \cdot \frac{1}{2}\right)\right)}{\mathsf{fma}\left(1, re, \mathsf{neg}\left(re \cdot \left(re \cdot \frac{1}{2}\right)\right)\right)}\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                          6. *-commutativeN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{re \cdot re - \left(re \cdot \left(re \cdot \frac{1}{2}\right)\right) \cdot \left(re \cdot \left(re \cdot \frac{1}{2}\right)\right)}{\mathsf{fma}\left(1, re, \mathsf{neg}\left(\left(re \cdot \frac{1}{2}\right) \cdot re\right)\right)}\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                          7. /-lowering-/.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(re \cdot re - \left(re \cdot \left(re \cdot \frac{1}{2}\right)\right) \cdot \left(re \cdot \left(re \cdot \frac{1}{2}\right)\right)\right), \left(\mathsf{fma}\left(1, re, \mathsf{neg}\left(\left(re \cdot \frac{1}{2}\right) \cdot re\right)\right)\right)\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                          8. --lowering--.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(re \cdot re\right), \left(\left(re \cdot \left(re \cdot \frac{1}{2}\right)\right) \cdot \left(re \cdot \left(re \cdot \frac{1}{2}\right)\right)\right)\right), \left(\mathsf{fma}\left(1, re, \mathsf{neg}\left(\left(re \cdot \frac{1}{2}\right) \cdot re\right)\right)\right)\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                          9. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\left(re \cdot \left(re \cdot \frac{1}{2}\right)\right) \cdot \left(re \cdot \left(re \cdot \frac{1}{2}\right)\right)\right)\right), \left(\mathsf{fma}\left(1, re, \mathsf{neg}\left(\left(re \cdot \frac{1}{2}\right) \cdot re\right)\right)\right)\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                          10. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(\left(re \cdot \left(re \cdot \frac{1}{2}\right)\right), \left(re \cdot \left(re \cdot \frac{1}{2}\right)\right)\right)\right), \left(\mathsf{fma}\left(1, re, \mathsf{neg}\left(\left(re \cdot \frac{1}{2}\right) \cdot re\right)\right)\right)\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                          11. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \left(re \cdot \frac{1}{2}\right)\right), \left(re \cdot \left(re \cdot \frac{1}{2}\right)\right)\right)\right), \left(\mathsf{fma}\left(1, re, \mathsf{neg}\left(\left(re \cdot \frac{1}{2}\right) \cdot re\right)\right)\right)\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                          12. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right), \left(re \cdot \left(re \cdot \frac{1}{2}\right)\right)\right)\right), \left(\mathsf{fma}\left(1, re, \mathsf{neg}\left(\left(re \cdot \frac{1}{2}\right) \cdot re\right)\right)\right)\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                          13. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(re, \left(re \cdot \frac{1}{2}\right)\right)\right)\right), \left(\mathsf{fma}\left(1, re, \mathsf{neg}\left(\left(re \cdot \frac{1}{2}\right) \cdot re\right)\right)\right)\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                          14. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \left(\mathsf{fma}\left(1, re, \mathsf{neg}\left(\left(re \cdot \frac{1}{2}\right) \cdot re\right)\right)\right)\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                          15. *-commutativeN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \left(\mathsf{fma}\left(1, re, \mathsf{neg}\left(re \cdot \left(re \cdot \frac{1}{2}\right)\right)\right)\right)\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                          16. fmm-defN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \left(1 \cdot re - re \cdot \left(re \cdot \frac{1}{2}\right)\right)\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                          17. *-lft-identityN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{1}{2}\right)\right)\right)\right), \left(re - re \cdot \left(re \cdot \frac{1}{2}\right)\right)\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                        10. Applied egg-rr45.4%

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

                        if 2.0000000000000001e97 < 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. Simplified85.0%

                            \[\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-*.f6485.0%

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

                            \[\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. cube-multN/A

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

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

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

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

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

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

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

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

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

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

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

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

                        Alternative 9: 49.8% accurate, 4.1× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(0.5 + re \cdot 0.16666666666666666\right) \cdot \left(re \cdot re\right)\\ \mathbf{if}\;re \leq -600000:\\ \;\;\;\;\left(re + 1\right) \cdot \left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right)\\ \mathbf{elif}\;re \leq 1.02 \cdot 10^{+103}:\\ \;\;\;\;im \cdot \left(1 + \frac{re \cdot re - t\_0 \cdot t\_0}{re - t\_0}\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right)\right)\\ \end{array} \end{array} \]
                        (FPCore (re im)
                         :precision binary64
                         (let* ((t_0 (* (+ 0.5 (* re 0.16666666666666666)) (* re re))))
                           (if (<= re -600000.0)
                             (* (+ re 1.0) (* im (* -0.16666666666666666 (* im im))))
                             (if (<= re 1.02e+103)
                               (* im (+ 1.0 (/ (- (* re re) (* t_0 t_0)) (- re t_0))))
                               (* im (* re (* re (* re 0.16666666666666666))))))))
                        double code(double re, double im) {
                        	double t_0 = (0.5 + (re * 0.16666666666666666)) * (re * re);
                        	double tmp;
                        	if (re <= -600000.0) {
                        		tmp = (re + 1.0) * (im * (-0.16666666666666666 * (im * im)));
                        	} else if (re <= 1.02e+103) {
                        		tmp = im * (1.0 + (((re * re) - (t_0 * t_0)) / (re - t_0)));
                        	} else {
                        		tmp = im * (re * (re * (re * 0.16666666666666666)));
                        	}
                        	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 = (0.5d0 + (re * 0.16666666666666666d0)) * (re * re)
                            if (re <= (-600000.0d0)) then
                                tmp = (re + 1.0d0) * (im * ((-0.16666666666666666d0) * (im * im)))
                            else if (re <= 1.02d+103) then
                                tmp = im * (1.0d0 + (((re * re) - (t_0 * t_0)) / (re - t_0)))
                            else
                                tmp = im * (re * (re * (re * 0.16666666666666666d0)))
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double re, double im) {
                        	double t_0 = (0.5 + (re * 0.16666666666666666)) * (re * re);
                        	double tmp;
                        	if (re <= -600000.0) {
                        		tmp = (re + 1.0) * (im * (-0.16666666666666666 * (im * im)));
                        	} else if (re <= 1.02e+103) {
                        		tmp = im * (1.0 + (((re * re) - (t_0 * t_0)) / (re - t_0)));
                        	} else {
                        		tmp = im * (re * (re * (re * 0.16666666666666666)));
                        	}
                        	return tmp;
                        }
                        
                        def code(re, im):
                        	t_0 = (0.5 + (re * 0.16666666666666666)) * (re * re)
                        	tmp = 0
                        	if re <= -600000.0:
                        		tmp = (re + 1.0) * (im * (-0.16666666666666666 * (im * im)))
                        	elif re <= 1.02e+103:
                        		tmp = im * (1.0 + (((re * re) - (t_0 * t_0)) / (re - t_0)))
                        	else:
                        		tmp = im * (re * (re * (re * 0.16666666666666666)))
                        	return tmp
                        
                        function code(re, im)
                        	t_0 = Float64(Float64(0.5 + Float64(re * 0.16666666666666666)) * Float64(re * re))
                        	tmp = 0.0
                        	if (re <= -600000.0)
                        		tmp = Float64(Float64(re + 1.0) * Float64(im * Float64(-0.16666666666666666 * Float64(im * im))));
                        	elseif (re <= 1.02e+103)
                        		tmp = Float64(im * Float64(1.0 + Float64(Float64(Float64(re * re) - Float64(t_0 * t_0)) / Float64(re - t_0))));
                        	else
                        		tmp = Float64(im * Float64(re * Float64(re * Float64(re * 0.16666666666666666))));
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(re, im)
                        	t_0 = (0.5 + (re * 0.16666666666666666)) * (re * re);
                        	tmp = 0.0;
                        	if (re <= -600000.0)
                        		tmp = (re + 1.0) * (im * (-0.16666666666666666 * (im * im)));
                        	elseif (re <= 1.02e+103)
                        		tmp = im * (1.0 + (((re * re) - (t_0 * t_0)) / (re - t_0)));
                        	else
                        		tmp = im * (re * (re * (re * 0.16666666666666666)));
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[re_, im_] := Block[{t$95$0 = N[(N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -600000.0], N[(N[(re + 1.0), $MachinePrecision] * N[(im * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.02e+103], N[(im * N[(1.0 + N[(N[(N[(re * re), $MachinePrecision] - N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(re - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(re * N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_0 := \left(0.5 + re \cdot 0.16666666666666666\right) \cdot \left(re \cdot re\right)\\
                        \mathbf{if}\;re \leq -600000:\\
                        \;\;\;\;\left(re + 1\right) \cdot \left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right)\\
                        
                        \mathbf{elif}\;re \leq 1.02 \cdot 10^{+103}:\\
                        \;\;\;\;im \cdot \left(1 + \frac{re \cdot re - t\_0 \cdot t\_0}{re - t\_0}\right)\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right)\right)\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 3 regimes
                        2. if re < -6e5

                          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. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                            12. unpow2N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                            13. *-lowering-*.f6465.3%

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                          5. Simplified65.3%

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

                            \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\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) \]
                          7. Step-by-step derivation
                            1. +-commutativeN/A

                              \[\leadsto \mathsf{*.f64}\left(\left(re + 1\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) \]
                            2. +-lowering-+.f642.6%

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\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) \]
                          8. Simplified2.6%

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

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

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

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

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

                          if -6e5 < re < 1.01999999999999991e103

                          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. Simplified54.3%

                              \[\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-*.f6440.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. Simplified40.6%

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

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

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

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

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

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

                            if 1.01999999999999991e103 < 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. Simplified85.0%

                                \[\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-*.f6485.0%

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

                                \[\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. cube-multN/A

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

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

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

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

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

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

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

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

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

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

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

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

                            Alternative 10: 49.3% accurate, 4.7× speedup?

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

                              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. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                12. unpow2N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                13. *-lowering-*.f6465.3%

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                              5. Simplified65.3%

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

                                \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\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) \]
                              7. Step-by-step derivation
                                1. +-commutativeN/A

                                  \[\leadsto \mathsf{*.f64}\left(\left(re + 1\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) \]
                                2. +-lowering-+.f642.6%

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\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) \]
                              8. Simplified2.6%

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

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

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

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

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

                              if -6e5 < re < 5.00000000000000018e153

                              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.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-*.f6444.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. Simplified44.6%

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

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

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

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

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

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

                                if 5.00000000000000018e153 < 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 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\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 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\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({im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)}\right)\right)\right) \]
                                  3. 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, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{120} \cdot {im}^{2}} - \frac{1}{6}\right)\right)\right)\right)\right) \]
                                  4. 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, \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)\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, \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)\right) \]
                                  6. *-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(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)}\right)\right)\right)\right)\right) \]
                                  7. sub-negN/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(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)\right) \]
                                  8. metadata-evalN/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(im, \mathsf{*.f64}\left(im, \left(\frac{1}{120} \cdot {im}^{2} + \frac{-1}{6}\right)\right)\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, \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)\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(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)\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(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)\right) \]
                                  12. 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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \left(\left(im \cdot im\right) \cdot \frac{1}{120}\right)\right)\right)\right)\right)\right)\right) \]
                                  13. 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, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \left(im \cdot \color{blue}{\left(im \cdot \frac{1}{120}\right)}\right)\right)\right)\right)\right)\right)\right) \]
                                  14. *-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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \frac{1}{120}\right)}\right)\right)\right)\right)\right)\right)\right) \]
                                  15. *-lowering-*.f6482.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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{1}{120}}\right)\right)\right)\right)\right)\right)\right)\right) \]
                                8. Simplified82.1%

                                  \[\leadsto \left(1 + re \cdot \left(1 + re \cdot 0.5\right)\right) \cdot \color{blue}{\left(im \cdot \left(1 + im \cdot \left(im \cdot \left(-0.16666666666666666 + im \cdot \left(im \cdot 0.008333333333333333\right)\right)\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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                                10. Step-by-step derivation
                                  1. *-lowering-*.f64N/A

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

                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(re \cdot re\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                                  3. *-lowering-*.f6482.1%

                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, re\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                                11. Simplified82.1%

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

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

                                    \[\leadsto \left(0.5 \cdot \left(re \cdot re\right)\right) \cdot \color{blue}{im} \]
                                14. Recombined 3 regimes into one program.
                                15. Final simplification49.2%

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

                                Alternative 11: 47.8% accurate, 8.1× speedup?

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

                                  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. *-lowering-*.f64N/A

                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                    12. unpow2N/A

                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                    13. *-lowering-*.f6465.3%

                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                  5. Simplified65.3%

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

                                    \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\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) \]
                                  7. Step-by-step derivation
                                    1. +-commutativeN/A

                                      \[\leadsto \mathsf{*.f64}\left(\left(re + 1\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) \]
                                    2. +-lowering-+.f642.6%

                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\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) \]
                                  8. Simplified2.6%

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

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

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

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

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

                                  if -6e5 < re < 2.45000000000000015e48

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

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

                                    \[\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. 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}, \left(\left(im \cdot im\right) \cdot \frac{1}{120}\right)\right)\right)\right)\right)\right) \]
                                    13. associate-*l*N/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 \cdot \color{blue}{\left(im \cdot \frac{1}{120}\right)}\right)\right)\right)\right)\right)\right) \]
                                    14. *-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(im, \color{blue}{\left(im \cdot \frac{1}{120}\right)}\right)\right)\right)\right)\right)\right) \]
                                    15. *-lowering-*.f6442.7%

                                      \[\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(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{1}{120}}\right)\right)\right)\right)\right)\right)\right) \]
                                  8. Simplified42.7%

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

                                  if 2.45000000000000015e48 < 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. Simplified87.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-*.f6474.2%

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

                                      \[\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. cube-multN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                  Alternative 12: 47.9% accurate, 8.8× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\\ \mathbf{if}\;re \leq -600000:\\ \;\;\;\;\left(re + 1\right) \cdot t\_0\\ \mathbf{elif}\;re \leq 3 \cdot 10^{+46}:\\ \;\;\;\;\left(re + 1\right) \cdot \left(im + t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right)\right)\\ \end{array} \end{array} \]
                                  (FPCore (re im)
                                   :precision binary64
                                   (let* ((t_0 (* im (* -0.16666666666666666 (* im im)))))
                                     (if (<= re -600000.0)
                                       (* (+ re 1.0) t_0)
                                       (if (<= re 3e+46)
                                         (* (+ re 1.0) (+ im t_0))
                                         (* im (* re (* re (* re 0.16666666666666666))))))))
                                  double code(double re, double im) {
                                  	double t_0 = im * (-0.16666666666666666 * (im * im));
                                  	double tmp;
                                  	if (re <= -600000.0) {
                                  		tmp = (re + 1.0) * t_0;
                                  	} else if (re <= 3e+46) {
                                  		tmp = (re + 1.0) * (im + t_0);
                                  	} else {
                                  		tmp = im * (re * (re * (re * 0.16666666666666666)));
                                  	}
                                  	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 * ((-0.16666666666666666d0) * (im * im))
                                      if (re <= (-600000.0d0)) then
                                          tmp = (re + 1.0d0) * t_0
                                      else if (re <= 3d+46) then
                                          tmp = (re + 1.0d0) * (im + t_0)
                                      else
                                          tmp = im * (re * (re * (re * 0.16666666666666666d0)))
                                      end if
                                      code = tmp
                                  end function
                                  
                                  public static double code(double re, double im) {
                                  	double t_0 = im * (-0.16666666666666666 * (im * im));
                                  	double tmp;
                                  	if (re <= -600000.0) {
                                  		tmp = (re + 1.0) * t_0;
                                  	} else if (re <= 3e+46) {
                                  		tmp = (re + 1.0) * (im + t_0);
                                  	} else {
                                  		tmp = im * (re * (re * (re * 0.16666666666666666)));
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(re, im):
                                  	t_0 = im * (-0.16666666666666666 * (im * im))
                                  	tmp = 0
                                  	if re <= -600000.0:
                                  		tmp = (re + 1.0) * t_0
                                  	elif re <= 3e+46:
                                  		tmp = (re + 1.0) * (im + t_0)
                                  	else:
                                  		tmp = im * (re * (re * (re * 0.16666666666666666)))
                                  	return tmp
                                  
                                  function code(re, im)
                                  	t_0 = Float64(im * Float64(-0.16666666666666666 * Float64(im * im)))
                                  	tmp = 0.0
                                  	if (re <= -600000.0)
                                  		tmp = Float64(Float64(re + 1.0) * t_0);
                                  	elseif (re <= 3e+46)
                                  		tmp = Float64(Float64(re + 1.0) * Float64(im + t_0));
                                  	else
                                  		tmp = Float64(im * Float64(re * Float64(re * Float64(re * 0.16666666666666666))));
                                  	end
                                  	return tmp
                                  end
                                  
                                  function tmp_2 = code(re, im)
                                  	t_0 = im * (-0.16666666666666666 * (im * im));
                                  	tmp = 0.0;
                                  	if (re <= -600000.0)
                                  		tmp = (re + 1.0) * t_0;
                                  	elseif (re <= 3e+46)
                                  		tmp = (re + 1.0) * (im + t_0);
                                  	else
                                  		tmp = im * (re * (re * (re * 0.16666666666666666)));
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  code[re_, im_] := Block[{t$95$0 = N[(im * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -600000.0], N[(N[(re + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[re, 3e+46], N[(N[(re + 1.0), $MachinePrecision] * N[(im + t$95$0), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(re * N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  t_0 := im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\\
                                  \mathbf{if}\;re \leq -600000:\\
                                  \;\;\;\;\left(re + 1\right) \cdot t\_0\\
                                  
                                  \mathbf{elif}\;re \leq 3 \cdot 10^{+46}:\\
                                  \;\;\;\;\left(re + 1\right) \cdot \left(im + t\_0\right)\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right)\right)\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 3 regimes
                                  2. if re < -6e5

                                    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. *-lowering-*.f64N/A

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                      12. unpow2N/A

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                      13. *-lowering-*.f6465.3%

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                    5. Simplified65.3%

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

                                      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\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) \]
                                    7. Step-by-step derivation
                                      1. +-commutativeN/A

                                        \[\leadsto \mathsf{*.f64}\left(\left(re + 1\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) \]
                                      2. +-lowering-+.f642.6%

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\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) \]
                                    8. Simplified2.6%

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

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

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

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

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

                                    if -6e5 < re < 3.00000000000000023e46

                                    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. *-lowering-*.f64N/A

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                      12. unpow2N/A

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                      13. *-lowering-*.f6451.6%

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                    5. Simplified51.6%

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

                                      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\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) \]
                                    7. Step-by-step derivation
                                      1. +-commutativeN/A

                                        \[\leadsto \mathsf{*.f64}\left(\left(re + 1\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) \]
                                      2. +-lowering-+.f6442.8%

                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\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) \]
                                    8. Simplified42.8%

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

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

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

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

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

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

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

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

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

                                    if 3.00000000000000023e46 < 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. Simplified88.0%

                                        \[\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-*.f6472.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), im\right) \]
                                      4. Simplified72.8%

                                        \[\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. cube-multN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                    Alternative 13: 47.9% accurate, 8.8× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := -0.16666666666666666 \cdot \left(im \cdot im\right)\\ \mathbf{if}\;re \leq -600000:\\ \;\;\;\;\left(re + 1\right) \cdot \left(im \cdot t\_0\right)\\ \mathbf{elif}\;re \leq 1.85 \cdot 10^{+46}:\\ \;\;\;\;\left(re + 1\right) \cdot \left(im \cdot \left(1 + t\_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right)\right)\\ \end{array} \end{array} \]
                                    (FPCore (re im)
                                     :precision binary64
                                     (let* ((t_0 (* -0.16666666666666666 (* im im))))
                                       (if (<= re -600000.0)
                                         (* (+ re 1.0) (* im t_0))
                                         (if (<= re 1.85e+46)
                                           (* (+ re 1.0) (* im (+ 1.0 t_0)))
                                           (* im (* re (* re (* re 0.16666666666666666))))))))
                                    double code(double re, double im) {
                                    	double t_0 = -0.16666666666666666 * (im * im);
                                    	double tmp;
                                    	if (re <= -600000.0) {
                                    		tmp = (re + 1.0) * (im * t_0);
                                    	} else if (re <= 1.85e+46) {
                                    		tmp = (re + 1.0) * (im * (1.0 + t_0));
                                    	} else {
                                    		tmp = im * (re * (re * (re * 0.16666666666666666)));
                                    	}
                                    	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 = (-0.16666666666666666d0) * (im * im)
                                        if (re <= (-600000.0d0)) then
                                            tmp = (re + 1.0d0) * (im * t_0)
                                        else if (re <= 1.85d+46) then
                                            tmp = (re + 1.0d0) * (im * (1.0d0 + t_0))
                                        else
                                            tmp = im * (re * (re * (re * 0.16666666666666666d0)))
                                        end if
                                        code = tmp
                                    end function
                                    
                                    public static double code(double re, double im) {
                                    	double t_0 = -0.16666666666666666 * (im * im);
                                    	double tmp;
                                    	if (re <= -600000.0) {
                                    		tmp = (re + 1.0) * (im * t_0);
                                    	} else if (re <= 1.85e+46) {
                                    		tmp = (re + 1.0) * (im * (1.0 + t_0));
                                    	} else {
                                    		tmp = im * (re * (re * (re * 0.16666666666666666)));
                                    	}
                                    	return tmp;
                                    }
                                    
                                    def code(re, im):
                                    	t_0 = -0.16666666666666666 * (im * im)
                                    	tmp = 0
                                    	if re <= -600000.0:
                                    		tmp = (re + 1.0) * (im * t_0)
                                    	elif re <= 1.85e+46:
                                    		tmp = (re + 1.0) * (im * (1.0 + t_0))
                                    	else:
                                    		tmp = im * (re * (re * (re * 0.16666666666666666)))
                                    	return tmp
                                    
                                    function code(re, im)
                                    	t_0 = Float64(-0.16666666666666666 * Float64(im * im))
                                    	tmp = 0.0
                                    	if (re <= -600000.0)
                                    		tmp = Float64(Float64(re + 1.0) * Float64(im * t_0));
                                    	elseif (re <= 1.85e+46)
                                    		tmp = Float64(Float64(re + 1.0) * Float64(im * Float64(1.0 + t_0)));
                                    	else
                                    		tmp = Float64(im * Float64(re * Float64(re * Float64(re * 0.16666666666666666))));
                                    	end
                                    	return tmp
                                    end
                                    
                                    function tmp_2 = code(re, im)
                                    	t_0 = -0.16666666666666666 * (im * im);
                                    	tmp = 0.0;
                                    	if (re <= -600000.0)
                                    		tmp = (re + 1.0) * (im * t_0);
                                    	elseif (re <= 1.85e+46)
                                    		tmp = (re + 1.0) * (im * (1.0 + t_0));
                                    	else
                                    		tmp = im * (re * (re * (re * 0.16666666666666666)));
                                    	end
                                    	tmp_2 = tmp;
                                    end
                                    
                                    code[re_, im_] := Block[{t$95$0 = N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -600000.0], N[(N[(re + 1.0), $MachinePrecision] * N[(im * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.85e+46], N[(N[(re + 1.0), $MachinePrecision] * N[(im * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(re * N[(re * N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    t_0 := -0.16666666666666666 \cdot \left(im \cdot im\right)\\
                                    \mathbf{if}\;re \leq -600000:\\
                                    \;\;\;\;\left(re + 1\right) \cdot \left(im \cdot t\_0\right)\\
                                    
                                    \mathbf{elif}\;re \leq 1.85 \cdot 10^{+46}:\\
                                    \;\;\;\;\left(re + 1\right) \cdot \left(im \cdot \left(1 + t\_0\right)\right)\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right)\right)\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 3 regimes
                                    2. if re < -6e5

                                      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. *-lowering-*.f64N/A

                                          \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                        12. unpow2N/A

                                          \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                        13. *-lowering-*.f6465.3%

                                          \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                      5. Simplified65.3%

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

                                        \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\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) \]
                                      7. Step-by-step derivation
                                        1. +-commutativeN/A

                                          \[\leadsto \mathsf{*.f64}\left(\left(re + 1\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) \]
                                        2. +-lowering-+.f642.6%

                                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\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) \]
                                      8. Simplified2.6%

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

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

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

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

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

                                      if -6e5 < re < 1.84999999999999995e46

                                      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. *-lowering-*.f64N/A

                                          \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                        12. unpow2N/A

                                          \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                        13. *-lowering-*.f6451.6%

                                          \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                      5. Simplified51.6%

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

                                        \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\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) \]
                                      7. Step-by-step derivation
                                        1. +-commutativeN/A

                                          \[\leadsto \mathsf{*.f64}\left(\left(re + 1\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) \]
                                        2. +-lowering-+.f6442.8%

                                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\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) \]
                                      8. Simplified42.8%

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

                                      if 1.84999999999999995e46 < 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. Simplified88.0%

                                          \[\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-*.f6472.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), im\right) \]
                                        4. Simplified72.8%

                                          \[\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. cube-multN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                      Alternative 14: 47.7% accurate, 10.1× speedup?

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

                                        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. *-lowering-*.f64N/A

                                            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                          12. unpow2N/A

                                            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                          13. *-lowering-*.f6465.3%

                                            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                        5. Simplified65.3%

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

                                          \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\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) \]
                                        7. Step-by-step derivation
                                          1. +-commutativeN/A

                                            \[\leadsto \mathsf{*.f64}\left(\left(re + 1\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) \]
                                          2. +-lowering-+.f642.6%

                                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\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) \]
                                        8. Simplified2.6%

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

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

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

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

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

                                        if -6e5 < 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. Simplified61.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-*.f6450.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. Simplified50.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. Recombined 2 regimes into one program.
                                        6. Final simplification47.3%

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

                                        Alternative 15: 47.3% accurate, 10.1× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq -600000:\\ \;\;\;\;\left(re + 1\right) \cdot \left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(1 + re \cdot \left(\left(re \cdot re\right) \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)\\ \end{array} \end{array} \]
                                        (FPCore (re im)
                                         :precision binary64
                                         (if (<= re -600000.0)
                                           (* (+ re 1.0) (* im (* -0.16666666666666666 (* im im))))
                                           (* im (+ 1.0 (* re (* (* re re) (+ 0.16666666666666666 (/ 0.5 re))))))))
                                        double code(double re, double im) {
                                        	double tmp;
                                        	if (re <= -600000.0) {
                                        		tmp = (re + 1.0) * (im * (-0.16666666666666666 * (im * im)));
                                        	} else {
                                        		tmp = im * (1.0 + (re * ((re * re) * (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 <= (-600000.0d0)) then
                                                tmp = (re + 1.0d0) * (im * ((-0.16666666666666666d0) * (im * im)))
                                            else
                                                tmp = im * (1.0d0 + (re * ((re * re) * (0.16666666666666666d0 + (0.5d0 / re)))))
                                            end if
                                            code = tmp
                                        end function
                                        
                                        public static double code(double re, double im) {
                                        	double tmp;
                                        	if (re <= -600000.0) {
                                        		tmp = (re + 1.0) * (im * (-0.16666666666666666 * (im * im)));
                                        	} else {
                                        		tmp = im * (1.0 + (re * ((re * re) * (0.16666666666666666 + (0.5 / re)))));
                                        	}
                                        	return tmp;
                                        }
                                        
                                        def code(re, im):
                                        	tmp = 0
                                        	if re <= -600000.0:
                                        		tmp = (re + 1.0) * (im * (-0.16666666666666666 * (im * im)))
                                        	else:
                                        		tmp = im * (1.0 + (re * ((re * re) * (0.16666666666666666 + (0.5 / re)))))
                                        	return tmp
                                        
                                        function code(re, im)
                                        	tmp = 0.0
                                        	if (re <= -600000.0)
                                        		tmp = Float64(Float64(re + 1.0) * Float64(im * Float64(-0.16666666666666666 * Float64(im * im))));
                                        	else
                                        		tmp = Float64(im * Float64(1.0 + Float64(re * Float64(Float64(re * re) * Float64(0.16666666666666666 + Float64(0.5 / re))))));
                                        	end
                                        	return tmp
                                        end
                                        
                                        function tmp_2 = code(re, im)
                                        	tmp = 0.0;
                                        	if (re <= -600000.0)
                                        		tmp = (re + 1.0) * (im * (-0.16666666666666666 * (im * im)));
                                        	else
                                        		tmp = im * (1.0 + (re * ((re * re) * (0.16666666666666666 + (0.5 / re)))));
                                        	end
                                        	tmp_2 = tmp;
                                        end
                                        
                                        code[re_, im_] := If[LessEqual[re, -600000.0], N[(N[(re + 1.0), $MachinePrecision] * N[(im * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(1.0 + N[(re * N[(N[(re * re), $MachinePrecision] * N[(0.16666666666666666 + N[(0.5 / re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;re \leq -600000:\\
                                        \;\;\;\;\left(re + 1\right) \cdot \left(im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right)\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;im \cdot \left(1 + re \cdot \left(\left(re \cdot re\right) \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 2 regimes
                                        2. if re < -6e5

                                          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. *-lowering-*.f64N/A

                                              \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                            12. unpow2N/A

                                              \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                            13. *-lowering-*.f6465.3%

                                              \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                          5. Simplified65.3%

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

                                            \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\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) \]
                                          7. Step-by-step derivation
                                            1. +-commutativeN/A

                                              \[\leadsto \mathsf{*.f64}\left(\left(re + 1\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) \]
                                            2. +-lowering-+.f642.6%

                                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\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) \]
                                          8. Simplified2.6%

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

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

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

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

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

                                          if -6e5 < 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. Simplified61.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-*.f6450.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. Simplified50.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(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \color{blue}{\left({re}^{2} \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)}\right)\right), im\right) \]
                                            6. Step-by-step derivation
                                              1. *-lowering-*.f64N/A

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

                                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\left(re \cdot re\right), \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{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(\mathsf{*.f64}\left(re, re\right), \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\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(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{6}, \left(\frac{1}{2} \cdot \frac{1}{re}\right)\right)\right)\right)\right), im\right) \]
                                              5. associate-*r/N/A

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

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

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

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

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

                                          Alternative 16: 47.7% accurate, 10.7× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\\ \mathbf{if}\;re \leq -600000:\\ \;\;\;\;\left(re + 1\right) \cdot t\_0\\ \mathbf{elif}\;re \leq 1.55 \cdot 10^{+46}:\\ \;\;\;\;im + t\_0\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right)\right)\\ \end{array} \end{array} \]
                                          (FPCore (re im)
                                           :precision binary64
                                           (let* ((t_0 (* im (* -0.16666666666666666 (* im im)))))
                                             (if (<= re -600000.0)
                                               (* (+ re 1.0) t_0)
                                               (if (<= re 1.55e+46)
                                                 (+ im t_0)
                                                 (* im (* re (* re (* re 0.16666666666666666))))))))
                                          double code(double re, double im) {
                                          	double t_0 = im * (-0.16666666666666666 * (im * im));
                                          	double tmp;
                                          	if (re <= -600000.0) {
                                          		tmp = (re + 1.0) * t_0;
                                          	} else if (re <= 1.55e+46) {
                                          		tmp = im + t_0;
                                          	} else {
                                          		tmp = im * (re * (re * (re * 0.16666666666666666)));
                                          	}
                                          	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 * ((-0.16666666666666666d0) * (im * im))
                                              if (re <= (-600000.0d0)) then
                                                  tmp = (re + 1.0d0) * t_0
                                              else if (re <= 1.55d+46) then
                                                  tmp = im + t_0
                                              else
                                                  tmp = im * (re * (re * (re * 0.16666666666666666d0)))
                                              end if
                                              code = tmp
                                          end function
                                          
                                          public static double code(double re, double im) {
                                          	double t_0 = im * (-0.16666666666666666 * (im * im));
                                          	double tmp;
                                          	if (re <= -600000.0) {
                                          		tmp = (re + 1.0) * t_0;
                                          	} else if (re <= 1.55e+46) {
                                          		tmp = im + t_0;
                                          	} else {
                                          		tmp = im * (re * (re * (re * 0.16666666666666666)));
                                          	}
                                          	return tmp;
                                          }
                                          
                                          def code(re, im):
                                          	t_0 = im * (-0.16666666666666666 * (im * im))
                                          	tmp = 0
                                          	if re <= -600000.0:
                                          		tmp = (re + 1.0) * t_0
                                          	elif re <= 1.55e+46:
                                          		tmp = im + t_0
                                          	else:
                                          		tmp = im * (re * (re * (re * 0.16666666666666666)))
                                          	return tmp
                                          
                                          function code(re, im)
                                          	t_0 = Float64(im * Float64(-0.16666666666666666 * Float64(im * im)))
                                          	tmp = 0.0
                                          	if (re <= -600000.0)
                                          		tmp = Float64(Float64(re + 1.0) * t_0);
                                          	elseif (re <= 1.55e+46)
                                          		tmp = Float64(im + t_0);
                                          	else
                                          		tmp = Float64(im * Float64(re * Float64(re * Float64(re * 0.16666666666666666))));
                                          	end
                                          	return tmp
                                          end
                                          
                                          function tmp_2 = code(re, im)
                                          	t_0 = im * (-0.16666666666666666 * (im * im));
                                          	tmp = 0.0;
                                          	if (re <= -600000.0)
                                          		tmp = (re + 1.0) * t_0;
                                          	elseif (re <= 1.55e+46)
                                          		tmp = im + t_0;
                                          	else
                                          		tmp = im * (re * (re * (re * 0.16666666666666666)));
                                          	end
                                          	tmp_2 = tmp;
                                          end
                                          
                                          code[re_, im_] := Block[{t$95$0 = N[(im * N[(-0.16666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -600000.0], N[(N[(re + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[re, 1.55e+46], N[(im + t$95$0), $MachinePrecision], N[(im * N[(re * N[(re * N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          t_0 := im \cdot \left(-0.16666666666666666 \cdot \left(im \cdot im\right)\right)\\
                                          \mathbf{if}\;re \leq -600000:\\
                                          \;\;\;\;\left(re + 1\right) \cdot t\_0\\
                                          
                                          \mathbf{elif}\;re \leq 1.55 \cdot 10^{+46}:\\
                                          \;\;\;\;im + t\_0\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;im \cdot \left(re \cdot \left(re \cdot \left(re \cdot 0.16666666666666666\right)\right)\right)\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 3 regimes
                                          2. if re < -6e5

                                            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. *-lowering-*.f64N/A

                                                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                              12. unpow2N/A

                                                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                              13. *-lowering-*.f6465.3%

                                                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                            5. Simplified65.3%

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

                                              \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\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) \]
                                            7. Step-by-step derivation
                                              1. +-commutativeN/A

                                                \[\leadsto \mathsf{*.f64}\left(\left(re + 1\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) \]
                                              2. +-lowering-+.f642.6%

                                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\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) \]
                                            8. Simplified2.6%

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

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

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

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

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

                                            if -6e5 < re < 1.54999999999999988e46

                                            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. *-lowering-*.f64N/A

                                                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                              12. unpow2N/A

                                                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                              13. *-lowering-*.f6451.6%

                                                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                            5. Simplified51.6%

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

                                              \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\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) \]
                                            7. Step-by-step derivation
                                              1. +-commutativeN/A

                                                \[\leadsto \mathsf{*.f64}\left(\left(re + 1\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) \]
                                              2. +-lowering-+.f6442.8%

                                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\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) \]
                                            8. Simplified42.8%

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \mathsf{*.f64}\left(\color{blue}{1}, \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, im\right)\right)\right), im\right)\right) \]
                                            12. Step-by-step derivation
                                              1. Simplified42.5%

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

                                              if 1.54999999999999988e46 < 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. Simplified88.0%

                                                  \[\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-*.f6472.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), im\right) \]
                                                4. Simplified72.8%

                                                  \[\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. cube-multN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                              Alternative 17: 46.4% accurate, 10.7× speedup?

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

                                                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. *-lowering-*.f64N/A

                                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                                  12. unpow2N/A

                                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                                  13. *-lowering-*.f6465.3%

                                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                                5. Simplified65.3%

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

                                                  \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\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) \]
                                                7. Step-by-step derivation
                                                  1. +-commutativeN/A

                                                    \[\leadsto \mathsf{*.f64}\left(\left(re + 1\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) \]
                                                  2. +-lowering-+.f642.6%

                                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\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) \]
                                                8. Simplified2.6%

                                                  \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \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\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\right)} \]
                                                  2. *-commutativeN/A

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

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

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

                                                    \[\leadsto {im}^{2} \cdot \color{blue}{\left(im \cdot \left(\frac{-1}{6} \cdot \left(1 + re\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\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\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\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\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}{re \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}{re} \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(re \cdot \frac{-1}{6}\right)}\right)\right)\right) \]
                                                  14. *-lowering-*.f6434.8%

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

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

                                                if -6e5 < re < 1.94999999999999997e46

                                                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. *-lowering-*.f64N/A

                                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                                  12. unpow2N/A

                                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                                  13. *-lowering-*.f6451.6%

                                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                                5. Simplified51.6%

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

                                                  \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\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) \]
                                                7. Step-by-step derivation
                                                  1. +-commutativeN/A

                                                    \[\leadsto \mathsf{*.f64}\left(\left(re + 1\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) \]
                                                  2. +-lowering-+.f6442.8%

                                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\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) \]
                                                8. Simplified42.8%

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto \mathsf{*.f64}\left(\color{blue}{1}, \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, im\right)\right)\right), im\right)\right) \]
                                                12. Step-by-step derivation
                                                  1. Simplified42.5%

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

                                                  if 1.94999999999999997e46 < 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. Simplified88.0%

                                                      \[\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-*.f6472.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), im\right) \]
                                                    4. Simplified72.8%

                                                      \[\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. cube-multN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                  Alternative 18: 40.6% accurate, 14.5× speedup?

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

                                                    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. *-lowering-*.f64N/A

                                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                                      12. unpow2N/A

                                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                                      13. *-lowering-*.f6456.6%

                                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\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) \]
                                                    5. Simplified56.6%

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

                                                      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\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) \]
                                                    7. Step-by-step derivation
                                                      1. +-commutativeN/A

                                                        \[\leadsto \mathsf{*.f64}\left(\left(re + 1\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) \]
                                                      2. +-lowering-+.f6428.2%

                                                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\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) \]
                                                    8. Simplified28.2%

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto \mathsf{*.f64}\left(\color{blue}{1}, \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, im\right)\right)\right), im\right)\right) \]
                                                    12. Step-by-step derivation
                                                      1. Simplified28.3%

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

                                                      if 3.2999999999999998e46 < 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. Simplified88.0%

                                                          \[\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-*.f6472.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), im\right) \]
                                                        4. Simplified72.8%

                                                          \[\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. cube-multN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                      Alternative 19: 40.6% accurate, 14.5× speedup?

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

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

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

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

                                                          \[\leadsto \color{blue}{im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{2}\right)} \]
                                                        7. Step-by-step derivation
                                                          1. *-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-*.f6428.3%

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

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

                                                        if 2.25000000000000005e46 < 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. Simplified88.0%

                                                            \[\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-*.f6472.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), im\right) \]
                                                          4. Simplified72.8%

                                                            \[\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. cube-multN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                        Alternative 20: 38.0% accurate, 14.5× speedup?

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

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

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

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

                                                            \[\leadsto \color{blue}{im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{2}\right)} \]
                                                          7. Step-by-step derivation
                                                            1. *-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-*.f6428.3%

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

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

                                                          if 1.40000000000000009e46 < 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-*.f6458.3%

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

                                                            \[\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 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\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 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\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({im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)}\right)\right)\right) \]
                                                            3. 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, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{120} \cdot {im}^{2}} - \frac{1}{6}\right)\right)\right)\right)\right) \]
                                                            4. 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, \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)\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, \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)\right) \]
                                                            6. *-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(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)}\right)\right)\right)\right)\right) \]
                                                            7. sub-negN/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(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)\right) \]
                                                            8. metadata-evalN/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(im, \mathsf{*.f64}\left(im, \left(\frac{1}{120} \cdot {im}^{2} + \frac{-1}{6}\right)\right)\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, \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)\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(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)\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(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)\right) \]
                                                            12. 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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \left(\left(im \cdot im\right) \cdot \frac{1}{120}\right)\right)\right)\right)\right)\right)\right) \]
                                                            13. 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, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \left(im \cdot \color{blue}{\left(im \cdot \frac{1}{120}\right)}\right)\right)\right)\right)\right)\right)\right) \]
                                                            14. *-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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \frac{1}{120}\right)}\right)\right)\right)\right)\right)\right)\right) \]
                                                            15. *-lowering-*.f6461.3%

                                                              \[\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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{1}{120}}\right)\right)\right)\right)\right)\right)\right)\right) \]
                                                          8. Simplified61.3%

                                                            \[\leadsto \left(1 + re \cdot \left(1 + re \cdot 0.5\right)\right) \cdot \color{blue}{\left(im \cdot \left(1 + im \cdot \left(im \cdot \left(-0.16666666666666666 + im \cdot \left(im \cdot 0.008333333333333333\right)\right)\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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                                                          10. Step-by-step derivation
                                                            1. *-lowering-*.f64N/A

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

                                                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(re \cdot re\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                                                            3. *-lowering-*.f6461.3%

                                                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, re\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                                                          11. Simplified61.3%

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

                                                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, re\right)\right), \color{blue}{im}\right) \]
                                                          13. Step-by-step derivation
                                                            1. Simplified59.3%

                                                              \[\leadsto \left(0.5 \cdot \left(re \cdot re\right)\right) \cdot \color{blue}{im} \]
                                                          14. Recombined 2 regimes into one program.
                                                          15. Final simplification34.4%

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

                                                          Alternative 21: 37.7% accurate, 16.9× speedup?

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

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

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

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

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

                                                                if 1.3999999999999999 < 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-*.f6446.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. Simplified46.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 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\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 + {im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\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({im}^{2} \cdot \left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)\right)}\right)\right)\right) \]
                                                                  3. 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, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{120} \cdot {im}^{2}} - \frac{1}{6}\right)\right)\right)\right)\right) \]
                                                                  4. 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, \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)\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, \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)\right) \]
                                                                  6. *-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(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{120} \cdot {im}^{2} - \frac{1}{6}\right)}\right)\right)\right)\right)\right) \]
                                                                  7. sub-negN/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(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)\right) \]
                                                                  8. metadata-evalN/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(im, \mathsf{*.f64}\left(im, \left(\frac{1}{120} \cdot {im}^{2} + \frac{-1}{6}\right)\right)\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, \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)\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(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)\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(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)\right) \]
                                                                  12. 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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \left(\left(im \cdot im\right) \cdot \frac{1}{120}\right)\right)\right)\right)\right)\right)\right) \]
                                                                  13. 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, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \left(im \cdot \color{blue}{\left(im \cdot \frac{1}{120}\right)}\right)\right)\right)\right)\right)\right)\right) \]
                                                                  14. *-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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \frac{1}{120}\right)}\right)\right)\right)\right)\right)\right)\right) \]
                                                                  15. *-lowering-*.f6451.3%

                                                                    \[\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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{1}{120}}\right)\right)\right)\right)\right)\right)\right)\right) \]
                                                                8. Simplified51.3%

                                                                  \[\leadsto \left(1 + re \cdot \left(1 + re \cdot 0.5\right)\right) \cdot \color{blue}{\left(im \cdot \left(1 + im \cdot \left(im \cdot \left(-0.16666666666666666 + im \cdot \left(im \cdot 0.008333333333333333\right)\right)\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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                                                                10. Step-by-step derivation
                                                                  1. *-lowering-*.f64N/A

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

                                                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(re \cdot re\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                                                                  3. *-lowering-*.f6451.3%

                                                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, re\right)\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{120}\right)\right)\right)\right)\right)\right)\right)\right) \]
                                                                11. Simplified51.3%

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

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

                                                                    \[\leadsto \left(0.5 \cdot \left(re \cdot re\right)\right) \cdot \color{blue}{im} \]
                                                                14. Recombined 2 regimes into one program.
                                                                15. Final simplification33.8%

                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 1.4:\\ \;\;\;\;im\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(0.5 \cdot \left(re \cdot re\right)\right)\\ \end{array} \]
                                                                16. Add Preprocessing

                                                                Alternative 22: 29.9% accurate, 25.3× speedup?

                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 290:\\ \;\;\;\;im\\ \mathbf{else}:\\ \;\;\;\;re \cdot im\\ \end{array} \end{array} \]
                                                                (FPCore (re im) :precision binary64 (if (<= re 290.0) im (* re im)))
                                                                double code(double re, double im) {
                                                                	double tmp;
                                                                	if (re <= 290.0) {
                                                                		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 (re <= 290.0d0) then
                                                                        tmp = im
                                                                    else
                                                                        tmp = re * im
                                                                    end if
                                                                    code = tmp
                                                                end function
                                                                
                                                                public static double code(double re, double im) {
                                                                	double tmp;
                                                                	if (re <= 290.0) {
                                                                		tmp = im;
                                                                	} else {
                                                                		tmp = re * im;
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                def code(re, im):
                                                                	tmp = 0
                                                                	if re <= 290.0:
                                                                		tmp = im
                                                                	else:
                                                                		tmp = re * im
                                                                	return tmp
                                                                
                                                                function code(re, im)
                                                                	tmp = 0.0
                                                                	if (re <= 290.0)
                                                                		tmp = im;
                                                                	else
                                                                		tmp = Float64(re * im);
                                                                	end
                                                                	return tmp
                                                                end
                                                                
                                                                function tmp_2 = code(re, im)
                                                                	tmp = 0.0;
                                                                	if (re <= 290.0)
                                                                		tmp = im;
                                                                	else
                                                                		tmp = re * im;
                                                                	end
                                                                	tmp_2 = tmp;
                                                                end
                                                                
                                                                code[re_, im_] := If[LessEqual[re, 290.0], im, N[(re * im), $MachinePrecision]]
                                                                
                                                                \begin{array}{l}
                                                                
                                                                \\
                                                                \begin{array}{l}
                                                                \mathbf{if}\;re \leq 290:\\
                                                                \;\;\;\;im\\
                                                                
                                                                \mathbf{else}:\\
                                                                \;\;\;\;re \cdot im\\
                                                                
                                                                
                                                                \end{array}
                                                                \end{array}
                                                                
                                                                Derivation
                                                                1. Split input into 2 regimes
                                                                2. if re < 290

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

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

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

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

                                                                      if 290 < 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. Simplified82.8%

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

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

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

                                                                            \[\leadsto \color{blue}{re} \cdot im \]
                                                                        7. Recombined 2 regimes into one program.
                                                                        8. Add Preprocessing

                                                                        Alternative 23: 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. Simplified72.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-+.f6427.9%

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

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

                                                                            \[\leadsto im \cdot \left(re + 1\right) \]
                                                                          6. Add Preprocessing

                                                                          Alternative 24: 26.5% 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. Simplified72.5%

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

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

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

                                                                              Reproduce

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