math.exp on complex, real part

Percentage Accurate: 100.0% → 100.0%
Time: 21.3s
Alternatives: 26
Speedup: 1.0×

Specification

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

\\
e^{re} \cdot \cos 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 26 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 \cos im \end{array} \]
(FPCore (re im) :precision binary64 (* (exp re) (cos im)))
double code(double re, double im) {
	return exp(re) * cos(im);
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = exp(re) * cos(im)
end function
public static double code(double re, double im) {
	return Math.exp(re) * Math.cos(im);
}
def code(re, im):
	return math.exp(re) * math.cos(im)
function code(re, im)
	return Float64(exp(re) * cos(im))
end
function tmp = code(re, im)
	tmp = exp(re) * cos(im);
end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Cos[im], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 100.0% accurate, 1.0× speedup?

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

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

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

Alternative 2: 97.6% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
t_0 := \cos 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:\\
\;\;\;\;e^{re}\\

\mathbf{elif}\;re \leq 0.047:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;re \leq 1.02 \cdot 10^{+103}:\\
\;\;\;\;e^{re}\\

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


\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 \cos im \]
    2. Add Preprocessing
    3. Taylor expanded in im around 0

      \[\leadsto \color{blue}{e^{re}} \]
    4. Step-by-step derivation
      1. exp-lowering-exp.f6496.1%

        \[\leadsto \mathsf{exp.f64}\left(re\right) \]
    5. Simplified96.1%

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

    if -0.0379999999999999991 < re < 0.047 or 1.01999999999999991e103 < re

    1. Initial program 100.0%

      \[e^{re} \cdot \cos 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{cos.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{cos.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{cos.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{cos.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{cos.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{cos.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{cos.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{cos.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 \cos im \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -0.038:\\ \;\;\;\;e^{re}\\ \mathbf{elif}\;re \leq 0.047:\\ \;\;\;\;\cos 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}\\ \mathbf{else}:\\ \;\;\;\;\cos im \cdot \left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 96.3% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos im \cdot \left(1 + re \cdot \left(1 + re \cdot 0.5\right)\right)\\ \mathbf{if}\;re \leq -0.015:\\ \;\;\;\;e^{re}\\ \mathbf{elif}\;re \leq 0.027:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;re \leq 1.85 \cdot 10^{+154}:\\ \;\;\;\;e^{re}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* (cos im) (+ 1.0 (* re (+ 1.0 (* re 0.5)))))))
   (if (<= re -0.015)
     (exp re)
     (if (<= re 0.027) t_0 (if (<= re 1.85e+154) (exp re) t_0)))))
double code(double re, double im) {
	double t_0 = cos(im) * (1.0 + (re * (1.0 + (re * 0.5))));
	double tmp;
	if (re <= -0.015) {
		tmp = exp(re);
	} else if (re <= 0.027) {
		tmp = t_0;
	} else if (re <= 1.85e+154) {
		tmp = exp(re);
	} 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 = cos(im) * (1.0d0 + (re * (1.0d0 + (re * 0.5d0))))
    if (re <= (-0.015d0)) then
        tmp = exp(re)
    else if (re <= 0.027d0) then
        tmp = t_0
    else if (re <= 1.85d+154) then
        tmp = exp(re)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = Math.cos(im) * (1.0 + (re * (1.0 + (re * 0.5))));
	double tmp;
	if (re <= -0.015) {
		tmp = Math.exp(re);
	} else if (re <= 0.027) {
		tmp = t_0;
	} else if (re <= 1.85e+154) {
		tmp = Math.exp(re);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(re, im):
	t_0 = math.cos(im) * (1.0 + (re * (1.0 + (re * 0.5))))
	tmp = 0
	if re <= -0.015:
		tmp = math.exp(re)
	elif re <= 0.027:
		tmp = t_0
	elif re <= 1.85e+154:
		tmp = math.exp(re)
	else:
		tmp = t_0
	return tmp
function code(re, im)
	t_0 = Float64(cos(im) * Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * 0.5)))))
	tmp = 0.0
	if (re <= -0.015)
		tmp = exp(re);
	elseif (re <= 0.027)
		tmp = t_0;
	elseif (re <= 1.85e+154)
		tmp = exp(re);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = cos(im) * (1.0 + (re * (1.0 + (re * 0.5))));
	tmp = 0.0;
	if (re <= -0.015)
		tmp = exp(re);
	elseif (re <= 0.027)
		tmp = t_0;
	elseif (re <= 1.85e+154)
		tmp = exp(re);
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(N[Cos[im], $MachinePrecision] * N[(1.0 + N[(re * N[(1.0 + N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -0.015], N[Exp[re], $MachinePrecision], If[LessEqual[re, 0.027], t$95$0, If[LessEqual[re, 1.85e+154], N[Exp[re], $MachinePrecision], t$95$0]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \cos im \cdot \left(1 + re \cdot \left(1 + re \cdot 0.5\right)\right)\\
\mathbf{if}\;re \leq -0.015:\\
\;\;\;\;e^{re}\\

\mathbf{elif}\;re \leq 0.027:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;re \leq 1.85 \cdot 10^{+154}:\\
\;\;\;\;e^{re}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if re < -0.014999999999999999 or 0.0269999999999999997 < re < 1.84999999999999997e154

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{re}} \]
    4. Step-by-step derivation
      1. exp-lowering-exp.f6493.9%

        \[\leadsto \mathsf{exp.f64}\left(re\right) \]
    5. Simplified93.9%

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

    if -0.014999999999999999 < re < 0.0269999999999999997 or 1.84999999999999997e154 < re

    1. Initial program 100.0%

      \[e^{re} \cdot \cos 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{cos.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{cos.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{cos.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{cos.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{cos.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{cos.f64}\left(im\right)\right) \]
    5. Simplified99.4%

      \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot 0.5\right)\right)} \cdot \cos im \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -0.015:\\ \;\;\;\;e^{re}\\ \mathbf{elif}\;re \leq 0.027:\\ \;\;\;\;\cos 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}\\ \mathbf{else}:\\ \;\;\;\;\cos im \cdot \left(1 + re \cdot \left(1 + re \cdot 0.5\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 93.3% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq -0.00031:\\ \;\;\;\;e^{re}\\ \mathbf{elif}\;re \leq 0.024:\\ \;\;\;\;\cos im \cdot \left(re + 1\right)\\ \mathbf{elif}\;re \leq 3 \cdot 10^{+47}:\\ \;\;\;\;e^{re}\\ \mathbf{else}:\\ \;\;\;\;e^{re} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= re -0.00031)
   (exp re)
   (if (<= re 0.024)
     (* (cos im) (+ re 1.0))
     (if (<= re 3e+47) (exp re) (* (exp re) (+ 1.0 (* -0.5 (* im im))))))))
double code(double re, double im) {
	double tmp;
	if (re <= -0.00031) {
		tmp = exp(re);
	} else if (re <= 0.024) {
		tmp = cos(im) * (re + 1.0);
	} else if (re <= 3e+47) {
		tmp = exp(re);
	} else {
		tmp = exp(re) * (1.0 + (-0.5 * (im * im)));
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: tmp
    if (re <= (-0.00031d0)) then
        tmp = exp(re)
    else if (re <= 0.024d0) then
        tmp = cos(im) * (re + 1.0d0)
    else if (re <= 3d+47) then
        tmp = exp(re)
    else
        tmp = exp(re) * (1.0d0 + ((-0.5d0) * (im * im)))
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double tmp;
	if (re <= -0.00031) {
		tmp = Math.exp(re);
	} else if (re <= 0.024) {
		tmp = Math.cos(im) * (re + 1.0);
	} else if (re <= 3e+47) {
		tmp = Math.exp(re);
	} else {
		tmp = Math.exp(re) * (1.0 + (-0.5 * (im * im)));
	}
	return tmp;
}
def code(re, im):
	tmp = 0
	if re <= -0.00031:
		tmp = math.exp(re)
	elif re <= 0.024:
		tmp = math.cos(im) * (re + 1.0)
	elif re <= 3e+47:
		tmp = math.exp(re)
	else:
		tmp = math.exp(re) * (1.0 + (-0.5 * (im * im)))
	return tmp
function code(re, im)
	tmp = 0.0
	if (re <= -0.00031)
		tmp = exp(re);
	elseif (re <= 0.024)
		tmp = Float64(cos(im) * Float64(re + 1.0));
	elseif (re <= 3e+47)
		tmp = exp(re);
	else
		tmp = Float64(exp(re) * Float64(1.0 + Float64(-0.5 * Float64(im * im))));
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if (re <= -0.00031)
		tmp = exp(re);
	elseif (re <= 0.024)
		tmp = cos(im) * (re + 1.0);
	elseif (re <= 3e+47)
		tmp = exp(re);
	else
		tmp = exp(re) * (1.0 + (-0.5 * (im * im)));
	end
	tmp_2 = tmp;
end
code[re_, im_] := If[LessEqual[re, -0.00031], N[Exp[re], $MachinePrecision], If[LessEqual[re, 0.024], N[(N[Cos[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 3e+47], N[Exp[re], $MachinePrecision], N[(N[Exp[re], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;re \leq -0.00031:\\
\;\;\;\;e^{re}\\

\mathbf{elif}\;re \leq 0.024:\\
\;\;\;\;\cos im \cdot \left(re + 1\right)\\

\mathbf{elif}\;re \leq 3 \cdot 10^{+47}:\\
\;\;\;\;e^{re}\\

\mathbf{else}:\\
\;\;\;\;e^{re} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if re < -3.1e-4 or 0.024 < re < 3.0000000000000001e47

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{re}} \]
    4. Step-by-step derivation
      1. exp-lowering-exp.f6498.5%

        \[\leadsto \mathsf{exp.f64}\left(re\right) \]
    5. Simplified98.5%

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

    if -3.1e-4 < re < 0.024

    1. Initial program 100.0%

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

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

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

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

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

    if 3.0000000000000001e47 < re

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -0.00031:\\ \;\;\;\;e^{re}\\ \mathbf{elif}\;re \leq 0.024:\\ \;\;\;\;\cos im \cdot \left(re + 1\right)\\ \mathbf{elif}\;re \leq 3 \cdot 10^{+47}:\\ \;\;\;\;e^{re}\\ \mathbf{else}:\\ \;\;\;\;e^{re} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 93.3% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq -0.00034:\\ \;\;\;\;e^{re}\\ \mathbf{elif}\;re \leq 0.024:\\ \;\;\;\;\cos im \cdot \left(re + 1\right)\\ \mathbf{elif}\;re \leq 6 \cdot 10^{+121}:\\ \;\;\;\;e^{re}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= re -0.00034)
   (exp re)
   (if (<= re 0.024)
     (* (cos im) (+ re 1.0))
     (if (<= re 6e+121)
       (exp re)
       (*
        (+ 1.0 (* -0.5 (* im im)))
        (* (* re re) (* re (+ 0.16666666666666666 (/ 0.5 re)))))))))
double code(double re, double im) {
	double tmp;
	if (re <= -0.00034) {
		tmp = exp(re);
	} else if (re <= 0.024) {
		tmp = cos(im) * (re + 1.0);
	} else if (re <= 6e+121) {
		tmp = exp(re);
	} else {
		tmp = (1.0 + (-0.5 * (im * im))) * ((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 <= (-0.00034d0)) then
        tmp = exp(re)
    else if (re <= 0.024d0) then
        tmp = cos(im) * (re + 1.0d0)
    else if (re <= 6d+121) then
        tmp = exp(re)
    else
        tmp = (1.0d0 + ((-0.5d0) * (im * im))) * ((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 <= -0.00034) {
		tmp = Math.exp(re);
	} else if (re <= 0.024) {
		tmp = Math.cos(im) * (re + 1.0);
	} else if (re <= 6e+121) {
		tmp = Math.exp(re);
	} else {
		tmp = (1.0 + (-0.5 * (im * im))) * ((re * re) * (re * (0.16666666666666666 + (0.5 / re))));
	}
	return tmp;
}
def code(re, im):
	tmp = 0
	if re <= -0.00034:
		tmp = math.exp(re)
	elif re <= 0.024:
		tmp = math.cos(im) * (re + 1.0)
	elif re <= 6e+121:
		tmp = math.exp(re)
	else:
		tmp = (1.0 + (-0.5 * (im * im))) * ((re * re) * (re * (0.16666666666666666 + (0.5 / re))))
	return tmp
function code(re, im)
	tmp = 0.0
	if (re <= -0.00034)
		tmp = exp(re);
	elseif (re <= 0.024)
		tmp = Float64(cos(im) * Float64(re + 1.0));
	elseif (re <= 6e+121)
		tmp = exp(re);
	else
		tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(im * im))) * Float64(Float64(re * re) * Float64(re * Float64(0.16666666666666666 + Float64(0.5 / re)))));
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if (re <= -0.00034)
		tmp = exp(re);
	elseif (re <= 0.024)
		tmp = cos(im) * (re + 1.0);
	elseif (re <= 6e+121)
		tmp = exp(re);
	else
		tmp = (1.0 + (-0.5 * (im * im))) * ((re * re) * (re * (0.16666666666666666 + (0.5 / re))));
	end
	tmp_2 = tmp;
end
code[re_, im_] := If[LessEqual[re, -0.00034], N[Exp[re], $MachinePrecision], If[LessEqual[re, 0.024], N[(N[Cos[im], $MachinePrecision] * N[(re + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 6e+121], N[Exp[re], $MachinePrecision], N[(N[(1.0 + N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(re * re), $MachinePrecision] * N[(re * N[(0.16666666666666666 + N[(0.5 / re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;re \leq -0.00034:\\
\;\;\;\;e^{re}\\

\mathbf{elif}\;re \leq 0.024:\\
\;\;\;\;\cos im \cdot \left(re + 1\right)\\

\mathbf{elif}\;re \leq 6 \cdot 10^{+121}:\\
\;\;\;\;e^{re}\\

\mathbf{else}:\\
\;\;\;\;\left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if re < -3.4e-4 or 0.024 < re < 6.0000000000000005e121

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{re}} \]
    4. Step-by-step derivation
      1. exp-lowering-exp.f6495.9%

        \[\leadsto \mathsf{exp.f64}\left(re\right) \]
    5. Simplified95.9%

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

    if -3.4e-4 < re < 0.024

    1. Initial program 100.0%

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

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

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

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

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

    if 6.0000000000000005e121 < re

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 92.7% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq -5.4 \cdot 10^{-8}:\\ \;\;\;\;e^{re}\\ \mathbf{elif}\;re \leq 0.024:\\ \;\;\;\;\cos im\\ \mathbf{elif}\;re \leq 10^{+122}:\\ \;\;\;\;e^{re}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= re -5.4e-8)
   (exp re)
   (if (<= re 0.024)
     (cos im)
     (if (<= re 1e+122)
       (exp re)
       (*
        (+ 1.0 (* -0.5 (* im im)))
        (* (* re re) (* re (+ 0.16666666666666666 (/ 0.5 re)))))))))
double code(double re, double im) {
	double tmp;
	if (re <= -5.4e-8) {
		tmp = exp(re);
	} else if (re <= 0.024) {
		tmp = cos(im);
	} else if (re <= 1e+122) {
		tmp = exp(re);
	} else {
		tmp = (1.0 + (-0.5 * (im * im))) * ((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 <= (-5.4d-8)) then
        tmp = exp(re)
    else if (re <= 0.024d0) then
        tmp = cos(im)
    else if (re <= 1d+122) then
        tmp = exp(re)
    else
        tmp = (1.0d0 + ((-0.5d0) * (im * im))) * ((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 <= -5.4e-8) {
		tmp = Math.exp(re);
	} else if (re <= 0.024) {
		tmp = Math.cos(im);
	} else if (re <= 1e+122) {
		tmp = Math.exp(re);
	} else {
		tmp = (1.0 + (-0.5 * (im * im))) * ((re * re) * (re * (0.16666666666666666 + (0.5 / re))));
	}
	return tmp;
}
def code(re, im):
	tmp = 0
	if re <= -5.4e-8:
		tmp = math.exp(re)
	elif re <= 0.024:
		tmp = math.cos(im)
	elif re <= 1e+122:
		tmp = math.exp(re)
	else:
		tmp = (1.0 + (-0.5 * (im * im))) * ((re * re) * (re * (0.16666666666666666 + (0.5 / re))))
	return tmp
function code(re, im)
	tmp = 0.0
	if (re <= -5.4e-8)
		tmp = exp(re);
	elseif (re <= 0.024)
		tmp = cos(im);
	elseif (re <= 1e+122)
		tmp = exp(re);
	else
		tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(im * im))) * Float64(Float64(re * re) * Float64(re * Float64(0.16666666666666666 + Float64(0.5 / re)))));
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if (re <= -5.4e-8)
		tmp = exp(re);
	elseif (re <= 0.024)
		tmp = cos(im);
	elseif (re <= 1e+122)
		tmp = exp(re);
	else
		tmp = (1.0 + (-0.5 * (im * im))) * ((re * re) * (re * (0.16666666666666666 + (0.5 / re))));
	end
	tmp_2 = tmp;
end
code[re_, im_] := If[LessEqual[re, -5.4e-8], N[Exp[re], $MachinePrecision], If[LessEqual[re, 0.024], N[Cos[im], $MachinePrecision], If[LessEqual[re, 1e+122], N[Exp[re], $MachinePrecision], N[(N[(1.0 + N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(re * re), $MachinePrecision] * N[(re * N[(0.16666666666666666 + N[(0.5 / re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;re \leq -5.4 \cdot 10^{-8}:\\
\;\;\;\;e^{re}\\

\mathbf{elif}\;re \leq 0.024:\\
\;\;\;\;\cos im\\

\mathbf{elif}\;re \leq 10^{+122}:\\
\;\;\;\;e^{re}\\

\mathbf{else}:\\
\;\;\;\;\left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if re < -5.40000000000000005e-8 or 0.024 < re < 1.00000000000000001e122

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{re}} \]
    4. Step-by-step derivation
      1. exp-lowering-exp.f6495.9%

        \[\leadsto \mathsf{exp.f64}\left(re\right) \]
    5. Simplified95.9%

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

    if -5.40000000000000005e-8 < re < 0.024

    1. Initial program 100.0%

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

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

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

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

    if 1.00000000000000001e122 < re

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 77.6% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := re \cdot re + \left(1 - re\right)\\ t_1 := re \cdot \left(re \cdot re\right)\\ t_2 := re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\\ t_3 := re \cdot \left(-1 - t\_2\right)\\ \mathbf{if}\;re \leq -1.34 \cdot 10^{+154}:\\ \;\;\;\;\frac{1 + \left(im \cdot im\right) \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)}{t\_0}\\ \mathbf{elif}\;re \leq -600000:\\ \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\ \mathbf{elif}\;re \leq 0.062:\\ \;\;\;\;\cos im\\ \mathbf{elif}\;re \leq 2.35 \cdot 10^{+51}:\\ \;\;\;\;\frac{\frac{\left(1 + t\_1 \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot t\_1\right)\right)\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)}{1 + t\_1 \cdot \left(t\_1 + -1\right)}}{t\_0}\\ \mathbf{elif}\;re \leq 4.45 \cdot 10^{+102}:\\ \;\;\;\;\frac{\left(1 - \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) \cdot 0.25\right) \cdot \left(1 + re \cdot \left(\left(1 + t\_2\right) \cdot t\_3\right)\right)}{\left(1 - im \cdot \left(im \cdot -0.5\right)\right) \cdot \left(1 + t\_3\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (+ (* re re) (- 1.0 re)))
        (t_1 (* re (* re re)))
        (t_2 (* re (+ 0.5 (* re 0.16666666666666666))))
        (t_3 (* re (- -1.0 t_2))))
   (if (<= re -1.34e+154)
     (/ (+ 1.0 (* (* im im) (+ -0.5 (* (* im im) 0.041666666666666664)))) t_0)
     (if (<= re -600000.0)
       (* 0.041666666666666664 (* (* im im) (* im im)))
       (if (<= re 0.062)
         (cos im)
         (if (<= re 2.35e+51)
           (/
            (/
             (*
              (+ 1.0 (* t_1 (* (* re re) (* re t_1))))
              (+
               1.0
               (* (* im im) (+ -0.5 (* im (* im 0.041666666666666664))))))
             (+ 1.0 (* t_1 (+ t_1 -1.0))))
            t_0)
           (if (<= re 4.45e+102)
             (/
              (*
               (- 1.0 (* (* im (* im (* im im))) 0.25))
               (+ 1.0 (* re (* (+ 1.0 t_2) t_3))))
              (* (- 1.0 (* im (* im -0.5))) (+ 1.0 t_3)))
             (*
              (+ 1.0 (* -0.5 (* im im)))
              (* (* re re) (* re (+ 0.16666666666666666 (/ 0.5 re))))))))))))
double code(double re, double im) {
	double t_0 = (re * re) + (1.0 - re);
	double t_1 = re * (re * re);
	double t_2 = re * (0.5 + (re * 0.16666666666666666));
	double t_3 = re * (-1.0 - t_2);
	double tmp;
	if (re <= -1.34e+154) {
		tmp = (1.0 + ((im * im) * (-0.5 + ((im * im) * 0.041666666666666664)))) / t_0;
	} else if (re <= -600000.0) {
		tmp = 0.041666666666666664 * ((im * im) * (im * im));
	} else if (re <= 0.062) {
		tmp = cos(im);
	} else if (re <= 2.35e+51) {
		tmp = (((1.0 + (t_1 * ((re * re) * (re * t_1)))) * (1.0 + ((im * im) * (-0.5 + (im * (im * 0.041666666666666664)))))) / (1.0 + (t_1 * (t_1 + -1.0)))) / t_0;
	} else if (re <= 4.45e+102) {
		tmp = ((1.0 - ((im * (im * (im * im))) * 0.25)) * (1.0 + (re * ((1.0 + t_2) * t_3)))) / ((1.0 - (im * (im * -0.5))) * (1.0 + t_3));
	} else {
		tmp = (1.0 + (-0.5 * (im * im))) * ((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) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = (re * re) + (1.0d0 - re)
    t_1 = re * (re * re)
    t_2 = re * (0.5d0 + (re * 0.16666666666666666d0))
    t_3 = re * ((-1.0d0) - t_2)
    if (re <= (-1.34d+154)) then
        tmp = (1.0d0 + ((im * im) * ((-0.5d0) + ((im * im) * 0.041666666666666664d0)))) / t_0
    else if (re <= (-600000.0d0)) then
        tmp = 0.041666666666666664d0 * ((im * im) * (im * im))
    else if (re <= 0.062d0) then
        tmp = cos(im)
    else if (re <= 2.35d+51) then
        tmp = (((1.0d0 + (t_1 * ((re * re) * (re * t_1)))) * (1.0d0 + ((im * im) * ((-0.5d0) + (im * (im * 0.041666666666666664d0)))))) / (1.0d0 + (t_1 * (t_1 + (-1.0d0))))) / t_0
    else if (re <= 4.45d+102) then
        tmp = ((1.0d0 - ((im * (im * (im * im))) * 0.25d0)) * (1.0d0 + (re * ((1.0d0 + t_2) * t_3)))) / ((1.0d0 - (im * (im * (-0.5d0)))) * (1.0d0 + t_3))
    else
        tmp = (1.0d0 + ((-0.5d0) * (im * im))) * ((re * re) * (re * (0.16666666666666666d0 + (0.5d0 / re))))
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = (re * re) + (1.0 - re);
	double t_1 = re * (re * re);
	double t_2 = re * (0.5 + (re * 0.16666666666666666));
	double t_3 = re * (-1.0 - t_2);
	double tmp;
	if (re <= -1.34e+154) {
		tmp = (1.0 + ((im * im) * (-0.5 + ((im * im) * 0.041666666666666664)))) / t_0;
	} else if (re <= -600000.0) {
		tmp = 0.041666666666666664 * ((im * im) * (im * im));
	} else if (re <= 0.062) {
		tmp = Math.cos(im);
	} else if (re <= 2.35e+51) {
		tmp = (((1.0 + (t_1 * ((re * re) * (re * t_1)))) * (1.0 + ((im * im) * (-0.5 + (im * (im * 0.041666666666666664)))))) / (1.0 + (t_1 * (t_1 + -1.0)))) / t_0;
	} else if (re <= 4.45e+102) {
		tmp = ((1.0 - ((im * (im * (im * im))) * 0.25)) * (1.0 + (re * ((1.0 + t_2) * t_3)))) / ((1.0 - (im * (im * -0.5))) * (1.0 + t_3));
	} else {
		tmp = (1.0 + (-0.5 * (im * im))) * ((re * re) * (re * (0.16666666666666666 + (0.5 / re))));
	}
	return tmp;
}
def code(re, im):
	t_0 = (re * re) + (1.0 - re)
	t_1 = re * (re * re)
	t_2 = re * (0.5 + (re * 0.16666666666666666))
	t_3 = re * (-1.0 - t_2)
	tmp = 0
	if re <= -1.34e+154:
		tmp = (1.0 + ((im * im) * (-0.5 + ((im * im) * 0.041666666666666664)))) / t_0
	elif re <= -600000.0:
		tmp = 0.041666666666666664 * ((im * im) * (im * im))
	elif re <= 0.062:
		tmp = math.cos(im)
	elif re <= 2.35e+51:
		tmp = (((1.0 + (t_1 * ((re * re) * (re * t_1)))) * (1.0 + ((im * im) * (-0.5 + (im * (im * 0.041666666666666664)))))) / (1.0 + (t_1 * (t_1 + -1.0)))) / t_0
	elif re <= 4.45e+102:
		tmp = ((1.0 - ((im * (im * (im * im))) * 0.25)) * (1.0 + (re * ((1.0 + t_2) * t_3)))) / ((1.0 - (im * (im * -0.5))) * (1.0 + t_3))
	else:
		tmp = (1.0 + (-0.5 * (im * im))) * ((re * re) * (re * (0.16666666666666666 + (0.5 / re))))
	return tmp
function code(re, im)
	t_0 = Float64(Float64(re * re) + Float64(1.0 - re))
	t_1 = Float64(re * Float64(re * re))
	t_2 = Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666)))
	t_3 = Float64(re * Float64(-1.0 - t_2))
	tmp = 0.0
	if (re <= -1.34e+154)
		tmp = Float64(Float64(1.0 + Float64(Float64(im * im) * Float64(-0.5 + Float64(Float64(im * im) * 0.041666666666666664)))) / t_0);
	elseif (re <= -600000.0)
		tmp = Float64(0.041666666666666664 * Float64(Float64(im * im) * Float64(im * im)));
	elseif (re <= 0.062)
		tmp = cos(im);
	elseif (re <= 2.35e+51)
		tmp = Float64(Float64(Float64(Float64(1.0 + Float64(t_1 * Float64(Float64(re * re) * Float64(re * t_1)))) * Float64(1.0 + Float64(Float64(im * im) * Float64(-0.5 + Float64(im * Float64(im * 0.041666666666666664)))))) / Float64(1.0 + Float64(t_1 * Float64(t_1 + -1.0)))) / t_0);
	elseif (re <= 4.45e+102)
		tmp = Float64(Float64(Float64(1.0 - Float64(Float64(im * Float64(im * Float64(im * im))) * 0.25)) * Float64(1.0 + Float64(re * Float64(Float64(1.0 + t_2) * t_3)))) / Float64(Float64(1.0 - Float64(im * Float64(im * -0.5))) * Float64(1.0 + t_3)));
	else
		tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(im * im))) * Float64(Float64(re * re) * Float64(re * Float64(0.16666666666666666 + Float64(0.5 / re)))));
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = (re * re) + (1.0 - re);
	t_1 = re * (re * re);
	t_2 = re * (0.5 + (re * 0.16666666666666666));
	t_3 = re * (-1.0 - t_2);
	tmp = 0.0;
	if (re <= -1.34e+154)
		tmp = (1.0 + ((im * im) * (-0.5 + ((im * im) * 0.041666666666666664)))) / t_0;
	elseif (re <= -600000.0)
		tmp = 0.041666666666666664 * ((im * im) * (im * im));
	elseif (re <= 0.062)
		tmp = cos(im);
	elseif (re <= 2.35e+51)
		tmp = (((1.0 + (t_1 * ((re * re) * (re * t_1)))) * (1.0 + ((im * im) * (-0.5 + (im * (im * 0.041666666666666664)))))) / (1.0 + (t_1 * (t_1 + -1.0)))) / t_0;
	elseif (re <= 4.45e+102)
		tmp = ((1.0 - ((im * (im * (im * im))) * 0.25)) * (1.0 + (re * ((1.0 + t_2) * t_3)))) / ((1.0 - (im * (im * -0.5))) * (1.0 + t_3));
	else
		tmp = (1.0 + (-0.5 * (im * im))) * ((re * re) * (re * (0.16666666666666666 + (0.5 / re))));
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(N[(re * re), $MachinePrecision] + N[(1.0 - re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(re * N[(-1.0 - t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -1.34e+154], N[(N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(-0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[re, -600000.0], N[(0.041666666666666664 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 0.062], N[Cos[im], $MachinePrecision], If[LessEqual[re, 2.35e+51], N[(N[(N[(N[(1.0 + N[(t$95$1 * N[(N[(re * re), $MachinePrecision] * N[(re * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(-0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(t$95$1 * N[(t$95$1 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[re, 4.45e+102], N[(N[(N[(1.0 - N[(N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(re * N[(N[(1.0 + t$95$2), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 - N[(im * N[(im * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(re * re), $MachinePrecision] * N[(re * N[(0.16666666666666666 + N[(0.5 / re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := re \cdot re + \left(1 - re\right)\\
t_1 := re \cdot \left(re \cdot re\right)\\
t_2 := re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\\
t_3 := re \cdot \left(-1 - t\_2\right)\\
\mathbf{if}\;re \leq -1.34 \cdot 10^{+154}:\\
\;\;\;\;\frac{1 + \left(im \cdot im\right) \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)}{t\_0}\\

\mathbf{elif}\;re \leq -600000:\\
\;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\

\mathbf{elif}\;re \leq 0.062:\\
\;\;\;\;\cos im\\

\mathbf{elif}\;re \leq 2.35 \cdot 10^{+51}:\\
\;\;\;\;\frac{\frac{\left(1 + t\_1 \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot t\_1\right)\right)\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)}{1 + t\_1 \cdot \left(t\_1 + -1\right)}}{t\_0}\\

\mathbf{elif}\;re \leq 4.45 \cdot 10^{+102}:\\
\;\;\;\;\frac{\left(1 - \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) \cdot 0.25\right) \cdot \left(1 + re \cdot \left(\left(1 + t\_2\right) \cdot t\_3\right)\right)}{\left(1 - im \cdot \left(im \cdot -0.5\right)\right) \cdot \left(1 + t\_3\right)}\\

\mathbf{else}:\\
\;\;\;\;\left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if re < -1.34000000000000001e154

    1. Initial program 100.0%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
    5. Simplified1.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
      5. sub-negN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
      12. *-lowering-*.f6452.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
    13. Simplified52.4%

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

    if -1.34000000000000001e154 < re < -6e5

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + im \cdot \left(im \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\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}{24} \cdot {im}^{4}\right)}\right) \]
    10. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1} \cdot \left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right) \]

      if -6e5 < re < 0.062

      1. Initial program 100.0%

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

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

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

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

      if 0.062 < re < 2.3500000000000001e51

      1. Initial program 100.0%

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
      5. Simplified6.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot \left(1 + re \cdot \left(re \cdot re\right)\right)}{re \cdot re + \left(1 - re\right)}} \]
      11. Applied egg-rr51.8%

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

      if 2.3500000000000001e51 < re < 4.4499999999999999e102

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
        7. *-lowering-*.f646.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), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
      8. Simplified6.4%

        \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \]
      9. Applied egg-rr85.7%

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

      if 4.4499999999999999e102 < re

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -1.34 \cdot 10^{+154}:\\ \;\;\;\;\frac{1 + \left(im \cdot im\right) \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)}{re \cdot re + \left(1 - re\right)}\\ \mathbf{elif}\;re \leq -600000:\\ \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\ \mathbf{elif}\;re \leq 0.062:\\ \;\;\;\;\cos im\\ \mathbf{elif}\;re \leq 2.35 \cdot 10^{+51}:\\ \;\;\;\;\frac{\frac{\left(1 + \left(re \cdot \left(re \cdot re\right)\right) \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \left(re \cdot \left(re \cdot re\right)\right)\right)\right)\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)}{1 + \left(re \cdot \left(re \cdot re\right)\right) \cdot \left(re \cdot \left(re \cdot re\right) + -1\right)}}{re \cdot re + \left(1 - re\right)}\\ \mathbf{elif}\;re \leq 4.45 \cdot 10^{+102}:\\ \;\;\;\;\frac{\left(1 - \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) \cdot 0.25\right) \cdot \left(1 + re \cdot \left(\left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right) \cdot \left(re \cdot \left(-1 - re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)\right)\right)}{\left(1 - im \cdot \left(im \cdot -0.5\right)\right) \cdot \left(1 + re \cdot \left(-1 - re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)\\ \end{array} \]
    16. Add Preprocessing

    Alternative 8: 54.5% accurate, 2.6× speedup?

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

      1. Initial program 100.0%

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
      5. Simplified1.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
        5. sub-negN/A

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
        12. *-lowering-*.f6452.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
      13. Simplified52.4%

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

      if -1.34000000000000001e154 < re < -6e5

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + im \cdot \left(im \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\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}{24} \cdot {im}^{4}\right)}\right) \]
      10. Step-by-step derivation
        1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{1} \cdot \left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right) \]

        if -6e5 < re < 2.3500000000000001e51

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{\left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot \left(1 + re \cdot \left(re \cdot re\right)\right)}{re \cdot re + \left(1 - re\right)}} \]
        11. Applied egg-rr47.3%

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

        if 2.3500000000000001e51 < re < 3.85000000000000007e102

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
          7. *-lowering-*.f646.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), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
        8. Simplified6.4%

          \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \]
        9. Applied egg-rr85.7%

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

        if 3.85000000000000007e102 < re

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -1.34 \cdot 10^{+154}:\\ \;\;\;\;\frac{1 + \left(im \cdot im\right) \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)}{re \cdot re + \left(1 - re\right)}\\ \mathbf{elif}\;re \leq -600000:\\ \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\ \mathbf{elif}\;re \leq 2.35 \cdot 10^{+51}:\\ \;\;\;\;\frac{\frac{\left(1 + \left(re \cdot \left(re \cdot re\right)\right) \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \left(re \cdot \left(re \cdot re\right)\right)\right)\right)\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)}{1 + \left(re \cdot \left(re \cdot re\right)\right) \cdot \left(re \cdot \left(re \cdot re\right) + -1\right)}}{re \cdot re + \left(1 - re\right)}\\ \mathbf{elif}\;re \leq 3.85 \cdot 10^{+102}:\\ \;\;\;\;\frac{\left(1 - \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) \cdot 0.25\right) \cdot \left(1 + re \cdot \left(\left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right) \cdot \left(re \cdot \left(-1 - re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)\right)\right)}{\left(1 - im \cdot \left(im \cdot -0.5\right)\right) \cdot \left(1 + re \cdot \left(-1 - re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)\\ \end{array} \]
      16. Add Preprocessing

      Alternative 9: 53.4% accurate, 2.8× speedup?

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

        1. Initial program 100.0%

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
        5. Simplified1.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
          5. sub-negN/A

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

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

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
          12. *-lowering-*.f6452.4%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
        13. Simplified52.4%

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

        if -1.34000000000000001e154 < re < -6e5

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + im \cdot \left(im \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\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}{24} \cdot {im}^{4}\right)}\right) \]
        10. Step-by-step derivation
          1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{1} \cdot \left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right) \]

          if -6e5 < re < 1.15000000000000003e51

          1. Initial program 100.0%

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
          5. Simplified85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{\left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot \left(1 + re \cdot \left(re \cdot re\right)\right)}{re \cdot re + \left(1 - re\right)}} \]
          11. Applied egg-rr47.6%

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

          if 1.15000000000000003e51 < re

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 10: 54.4% accurate, 3.5× speedup?

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

          1. Initial program 100.0%

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
          5. Simplified1.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
            5. sub-negN/A

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

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
            12. *-lowering-*.f6452.4%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
          13. Simplified52.4%

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

          if -1.34000000000000001e154 < re < -6e5

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + im \cdot \left(im \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\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}{24} \cdot {im}^{4}\right)}\right) \]
          10. Step-by-step derivation
            1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{1} \cdot \left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right) \]

            if -6e5 < re < 3.50000000000000002e38

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{1 + re} \]
            10. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto re + \color{blue}{1} \]
              2. +-lowering-+.f6445.3%

                \[\leadsto \mathsf{+.f64}\left(re, \color{blue}{1}\right) \]
            11. Simplified45.3%

              \[\leadsto \color{blue}{re + 1} \]
            12. Applied egg-rr47.6%

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

            if 3.50000000000000002e38 < re

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
              7. *-lowering-*.f6465.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), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
            8. Simplified65.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 11: 52.7% accurate, 3.8× speedup?

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

            1. Initial program 100.0%

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
            5. Simplified1.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
              5. sub-negN/A

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

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

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

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

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

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

                \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
              12. *-lowering-*.f6452.4%

                \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
            13. Simplified52.4%

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

            if -1.34000000000000001e154 < re < -6e5

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + im \cdot \left(im \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\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}{24} \cdot {im}^{4}\right)}\right) \]
            10. Step-by-step derivation
              1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{1} \cdot \left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right) \]

              if -6e5 < re < 3.2999999999999999e47

              1. Initial program 100.0%

                \[e^{re} \cdot \cos 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{cos.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{cos.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{cos.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{cos.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{cos.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{cos.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{cos.f64}\left(im\right)\right) \]
                7. *-lowering-*.f6486.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), \mathsf{cos.f64}\left(im\right)\right) \]
              5. Simplified86.4%

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

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

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

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

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

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

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

              if 3.2999999999999999e47 < re

              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                7. *-lowering-*.f6470.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), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
              8. Simplified70.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \]
            14. Recombined 4 regimes into one program.
            15. Final simplification53.5%

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

            Alternative 12: 54.4% accurate, 4.3× speedup?

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

              1. Initial program 100.0%

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
              5. Simplified1.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                5. sub-negN/A

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

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

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

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

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left({im}^{2} \cdot \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                10. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left({im}^{2}\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                11. unpow2N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                12. *-lowering-*.f6452.4%

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
              13. Simplified52.4%

                \[\leadsto \frac{\color{blue}{1 + \left(im \cdot im\right) \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)}}{re \cdot re + \left(1 - re\right)} \]

              if -1.34000000000000001e154 < re < -6e5

              1. Initial program 100.0%

                \[e^{re} \cdot \cos im \]
              2. Add Preprocessing
              3. Taylor expanded in re around 0

                \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\right)}, \mathsf{cos.f64}\left(im\right)\right) \]
              4. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                2. +-lowering-+.f642.6%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
              5. Simplified2.6%

                \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \cos im \]
              6. Taylor expanded in im around 0

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right) \]
              7. Step-by-step derivation
                1. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                2. unpow2N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24} \cdot {im}^{2}} - \frac{1}{2}\right)\right)\right)\right) \]
                3. associate-*l*N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right)\right) \]
                4. *-commutativeN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot \color{blue}{im}\right)\right)\right)\right) \]
                5. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot im\right)}\right)\right)\right) \]
                6. *-commutativeN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                7. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                8. sub-negN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right)\right) \]
                9. metadata-evalN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \frac{-1}{2}\right)\right)\right)\right)\right) \]
                10. +-commutativeN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{-1}{2} + \color{blue}{\frac{1}{24} \cdot {im}^{2}}\right)\right)\right)\right)\right) \]
                11. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right) \]
                12. *-commutativeN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                13. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                14. unpow2N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                15. *-lowering-*.f642.3%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              8. Simplified2.3%

                \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + im \cdot \left(im \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\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}{24} \cdot {im}^{4}\right)}\right) \]
              10. Step-by-step derivation
                1. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\left({im}^{4}\right)}\right)\right) \]
                2. metadata-evalN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({im}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right)\right) \]
                3. pow-sqrN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right)\right) \]
                4. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                5. unpow2N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \left({\color{blue}{im}}^{2}\right)\right)\right)\right) \]
                6. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({\color{blue}{im}}^{2}\right)\right)\right)\right) \]
                7. unpow2N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                8. *-lowering-*.f6461.7%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
              11. Simplified61.7%

                \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)} \]
              12. Taylor expanded in re around 0

                \[\leadsto \mathsf{*.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
              13. Step-by-step derivation
                1. Simplified61.8%

                  \[\leadsto \color{blue}{1} \cdot \left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right) \]

                if -6e5 < re < 1.06e17

                1. Initial program 100.0%

                  \[e^{re} \cdot \cos im \]
                2. Add Preprocessing
                3. Taylor expanded in im around 0

                  \[\leadsto \color{blue}{e^{re}} \]
                4. Step-by-step derivation
                  1. exp-lowering-exp.f6453.4%

                    \[\leadsto \mathsf{exp.f64}\left(re\right) \]
                5. Simplified53.4%

                  \[\leadsto \color{blue}{e^{re}} \]
                6. Taylor expanded in re around 0

                  \[\leadsto \color{blue}{1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)} \]
                7. Step-by-step derivation
                  1. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)}\right) \]
                  2. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \color{blue}{\left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)}\right)\right) \]
                  3. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \color{blue}{\left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)}\right)\right)\right) \]
                  4. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot re\right)}\right)\right)\right)\right) \]
                  5. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{6} \cdot re\right)}\right)\right)\right)\right)\right) \]
                  6. *-commutativeN/A

                    \[\leadsto \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 \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                  7. *-lowering-*.f6448.5%

                    \[\leadsto \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, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                8. Simplified48.5%

                  \[\leadsto \color{blue}{1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)} \]

                if 1.06e17 < re < 7.49999999999999965e121

                1. Initial program 100.0%

                  \[e^{re} \cdot \cos im \]
                2. Add Preprocessing
                3. Taylor expanded in re around 0

                  \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\right)}, \mathsf{cos.f64}\left(im\right)\right) \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                  2. +-lowering-+.f643.6%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                5. Simplified3.6%

                  \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \cos im \]
                6. Taylor expanded in im around 0

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right) \]
                7. Step-by-step derivation
                  1. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                  2. unpow2N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24} \cdot {im}^{2}} - \frac{1}{2}\right)\right)\right)\right) \]
                  3. associate-*l*N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right)\right) \]
                  4. *-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot \color{blue}{im}\right)\right)\right)\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot im\right)}\right)\right)\right) \]
                  6. *-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                  7. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                  8. sub-negN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right)\right) \]
                  9. metadata-evalN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \frac{-1}{2}\right)\right)\right)\right)\right) \]
                  10. +-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{-1}{2} + \color{blue}{\frac{1}{24} \cdot {im}^{2}}\right)\right)\right)\right)\right) \]
                  11. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right) \]
                  12. *-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                  13. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                  14. unpow2N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                  15. *-lowering-*.f6427.3%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                8. Simplified27.3%

                  \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + im \cdot \left(im \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)} \]
                9. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \left(1 + im \cdot \left(im \cdot \left(\frac{-1}{2} + \left(im \cdot im\right) \cdot \frac{1}{24}\right)\right)\right) \cdot \color{blue}{\left(re + 1\right)} \]
                  2. flip3-+N/A

                    \[\leadsto \left(1 + im \cdot \left(im \cdot \left(\frac{-1}{2} + \left(im \cdot im\right) \cdot \frac{1}{24}\right)\right)\right) \cdot \frac{{re}^{3} + {1}^{3}}{\color{blue}{re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)}} \]
                  3. associate-*r/N/A

                    \[\leadsto \frac{\left(1 + im \cdot \left(im \cdot \left(\frac{-1}{2} + \left(im \cdot im\right) \cdot \frac{1}{24}\right)\right)\right) \cdot \left({re}^{3} + {1}^{3}\right)}{\color{blue}{re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)}} \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + im \cdot \left(im \cdot \left(\frac{-1}{2} + \left(im \cdot im\right) \cdot \frac{1}{24}\right)\right)\right) \cdot \left({re}^{3} + {1}^{3}\right)\right), \color{blue}{\left(re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)\right)}\right) \]
                10. Applied egg-rr39.2%

                  \[\leadsto \color{blue}{\frac{\left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot \left(1 + re \cdot \left(re \cdot re\right)\right)}{re \cdot re + \left(1 - re\right)}} \]
                11. Taylor expanded in re around inf

                  \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left({re}^{3} \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right)}, \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                12. Step-by-step derivation
                  1. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({re}^{3}\right), \left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(re, re\right)}, \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  2. cube-multN/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(re \cdot \left(re \cdot re\right)\right), \left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\color{blue}{re}, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  3. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(re \cdot {re}^{2}\right), \left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  4. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \left({re}^{2}\right)\right), \left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\color{blue}{re}, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  5. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \left(re \cdot re\right)\right), \left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  6. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  7. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, \color{blue}{re}\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  8. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({im}^{2}\right), \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  9. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(im \cdot im\right), \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  10. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  11. sub-negN/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{1}{24} \cdot {im}^{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  12. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{1}{24} \cdot {im}^{2} + \frac{-1}{2}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  13. +-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{-1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  14. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left(\frac{1}{24} \cdot {im}^{2}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  15. *-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left({im}^{2} \cdot \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  16. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left({im}^{2}\right), \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  17. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  18. *-lowering-*.f6439.2%

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                13. Simplified39.2%

                  \[\leadsto \frac{\color{blue}{\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)}}{re \cdot re + \left(1 - re\right)} \]

                if 7.49999999999999965e121 < re

                1. Initial program 100.0%

                  \[e^{re} \cdot \cos im \]
                2. Add Preprocessing
                3. Taylor expanded in im around 0

                  \[\leadsto \color{blue}{e^{re} + \frac{-1}{2} \cdot \left({im}^{2} \cdot e^{re}\right)} \]
                4. Step-by-step derivation
                  1. *-lft-identityN/A

                    \[\leadsto 1 \cdot e^{re} + \color{blue}{\frac{-1}{2}} \cdot \left({im}^{2} \cdot e^{re}\right) \]
                  2. associate-*r*N/A

                    \[\leadsto 1 \cdot e^{re} + \left(\frac{-1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{e^{re}} \]
                  3. distribute-rgt-inN/A

                    \[\leadsto e^{re} \cdot \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)} \]
                  4. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\left(e^{re}\right), \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)}\right) \]
                  5. exp-lowering-exp.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \left(\color{blue}{1} + \frac{-1}{2} \cdot {im}^{2}\right)\right) \]
                  6. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                  7. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                  8. unpow2N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                  9. *-lowering-*.f6483.8%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                5. Simplified83.8%

                  \[\leadsto \color{blue}{e^{re} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)} \]
                6. Taylor expanded in re around 0

                  \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                7. Step-by-step derivation
                  1. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                  2. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                  3. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                  4. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                  5. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot re\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                  6. *-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                  7. *-lowering-*.f6483.8%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                8. Simplified83.8%

                  \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \]
                9. Taylor expanded in re around inf

                  \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left({re}^{3} \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                10. Step-by-step derivation
                  1. unpow3N/A

                    \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(re \cdot re\right) \cdot re\right) \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                  2. unpow2N/A

                    \[\leadsto \mathsf{*.f64}\left(\left(\left({re}^{2} \cdot re\right) \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                  3. associate-*l*N/A

                    \[\leadsto \mathsf{*.f64}\left(\left({re}^{2} \cdot \left(re \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                  4. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({re}^{2}\right), \left(re \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                  5. unpow2N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(re \cdot re\right), \left(re \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                  6. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(re \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                  7. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                  8. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{6}, \left(\frac{1}{2} \cdot \frac{1}{re}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                  9. associate-*r/N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{6}, \left(\frac{\frac{1}{2} \cdot 1}{re}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                  10. metadata-evalN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{6}, \left(\frac{\frac{1}{2}}{re}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                  11. /-lowering-/.f6483.8%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\frac{1}{2}, re\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                11. Simplified83.8%

                  \[\leadsto \color{blue}{\left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \]
              14. Recombined 5 regimes into one program.
              15. Final simplification55.1%

                \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -1.34 \cdot 10^{+154}:\\ \;\;\;\;\frac{1 + \left(im \cdot im\right) \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)}{re \cdot re + \left(1 - re\right)}\\ \mathbf{elif}\;re \leq -600000:\\ \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\ \mathbf{elif}\;re \leq 1.06 \cdot 10^{+17}:\\ \;\;\;\;1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\\ \mathbf{elif}\;re \leq 7.5 \cdot 10^{+121}:\\ \;\;\;\;\frac{\left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right) \cdot \left(re \cdot \left(re \cdot re\right)\right)}{re \cdot re + \left(1 - re\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)\\ \end{array} \]
              16. Add Preprocessing

              Alternative 13: 54.4% accurate, 4.5× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{1 + \left(im \cdot im\right) \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)}{re \cdot re + \left(1 - re\right)}\\ \mathbf{elif}\;re \leq -600000:\\ \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\ \mathbf{elif}\;re \leq 1.08 \cdot 10^{+26}:\\ \;\;\;\;1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\\ \mathbf{elif}\;re \leq 1.36 \cdot 10^{+48}:\\ \;\;\;\;\frac{\left(1 + re \cdot \left(re \cdot re\right)\right) \cdot \left(0.041666666666666664 \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\right)}{\left(1 + re \cdot re\right) - re}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)\\ \end{array} \end{array} \]
              (FPCore (re im)
               :precision binary64
               (if (<= re -1.35e+154)
                 (/
                  (+ 1.0 (* (* im im) (+ -0.5 (* (* im im) 0.041666666666666664))))
                  (+ (* re re) (- 1.0 re)))
                 (if (<= re -600000.0)
                   (* 0.041666666666666664 (* (* im im) (* im im)))
                   (if (<= re 1.08e+26)
                     (+ 1.0 (* re (+ 1.0 (* re (+ 0.5 (* re 0.16666666666666666))))))
                     (if (<= re 1.36e+48)
                       (/
                        (*
                         (+ 1.0 (* re (* re re)))
                         (* 0.041666666666666664 (* im (* im (* im im)))))
                        (- (+ 1.0 (* re re)) re))
                       (*
                        (+ 1.0 (* -0.5 (* im im)))
                        (* (* re re) (* re (+ 0.16666666666666666 (/ 0.5 re))))))))))
              double code(double re, double im) {
              	double tmp;
              	if (re <= -1.35e+154) {
              		tmp = (1.0 + ((im * im) * (-0.5 + ((im * im) * 0.041666666666666664)))) / ((re * re) + (1.0 - re));
              	} else if (re <= -600000.0) {
              		tmp = 0.041666666666666664 * ((im * im) * (im * im));
              	} else if (re <= 1.08e+26) {
              		tmp = 1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))));
              	} else if (re <= 1.36e+48) {
              		tmp = ((1.0 + (re * (re * re))) * (0.041666666666666664 * (im * (im * (im * im))))) / ((1.0 + (re * re)) - re);
              	} else {
              		tmp = (1.0 + (-0.5 * (im * im))) * ((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 <= (-1.35d+154)) then
                      tmp = (1.0d0 + ((im * im) * ((-0.5d0) + ((im * im) * 0.041666666666666664d0)))) / ((re * re) + (1.0d0 - re))
                  else if (re <= (-600000.0d0)) then
                      tmp = 0.041666666666666664d0 * ((im * im) * (im * im))
                  else if (re <= 1.08d+26) then
                      tmp = 1.0d0 + (re * (1.0d0 + (re * (0.5d0 + (re * 0.16666666666666666d0)))))
                  else if (re <= 1.36d+48) then
                      tmp = ((1.0d0 + (re * (re * re))) * (0.041666666666666664d0 * (im * (im * (im * im))))) / ((1.0d0 + (re * re)) - re)
                  else
                      tmp = (1.0d0 + ((-0.5d0) * (im * im))) * ((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 <= -1.35e+154) {
              		tmp = (1.0 + ((im * im) * (-0.5 + ((im * im) * 0.041666666666666664)))) / ((re * re) + (1.0 - re));
              	} else if (re <= -600000.0) {
              		tmp = 0.041666666666666664 * ((im * im) * (im * im));
              	} else if (re <= 1.08e+26) {
              		tmp = 1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))));
              	} else if (re <= 1.36e+48) {
              		tmp = ((1.0 + (re * (re * re))) * (0.041666666666666664 * (im * (im * (im * im))))) / ((1.0 + (re * re)) - re);
              	} else {
              		tmp = (1.0 + (-0.5 * (im * im))) * ((re * re) * (re * (0.16666666666666666 + (0.5 / re))));
              	}
              	return tmp;
              }
              
              def code(re, im):
              	tmp = 0
              	if re <= -1.35e+154:
              		tmp = (1.0 + ((im * im) * (-0.5 + ((im * im) * 0.041666666666666664)))) / ((re * re) + (1.0 - re))
              	elif re <= -600000.0:
              		tmp = 0.041666666666666664 * ((im * im) * (im * im))
              	elif re <= 1.08e+26:
              		tmp = 1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))
              	elif re <= 1.36e+48:
              		tmp = ((1.0 + (re * (re * re))) * (0.041666666666666664 * (im * (im * (im * im))))) / ((1.0 + (re * re)) - re)
              	else:
              		tmp = (1.0 + (-0.5 * (im * im))) * ((re * re) * (re * (0.16666666666666666 + (0.5 / re))))
              	return tmp
              
              function code(re, im)
              	tmp = 0.0
              	if (re <= -1.35e+154)
              		tmp = Float64(Float64(1.0 + Float64(Float64(im * im) * Float64(-0.5 + Float64(Float64(im * im) * 0.041666666666666664)))) / Float64(Float64(re * re) + Float64(1.0 - re)));
              	elseif (re <= -600000.0)
              		tmp = Float64(0.041666666666666664 * Float64(Float64(im * im) * Float64(im * im)));
              	elseif (re <= 1.08e+26)
              		tmp = Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666))))));
              	elseif (re <= 1.36e+48)
              		tmp = Float64(Float64(Float64(1.0 + Float64(re * Float64(re * re))) * Float64(0.041666666666666664 * Float64(im * Float64(im * Float64(im * im))))) / Float64(Float64(1.0 + Float64(re * re)) - re));
              	else
              		tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(im * im))) * Float64(Float64(re * re) * Float64(re * Float64(0.16666666666666666 + Float64(0.5 / re)))));
              	end
              	return tmp
              end
              
              function tmp_2 = code(re, im)
              	tmp = 0.0;
              	if (re <= -1.35e+154)
              		tmp = (1.0 + ((im * im) * (-0.5 + ((im * im) * 0.041666666666666664)))) / ((re * re) + (1.0 - re));
              	elseif (re <= -600000.0)
              		tmp = 0.041666666666666664 * ((im * im) * (im * im));
              	elseif (re <= 1.08e+26)
              		tmp = 1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))));
              	elseif (re <= 1.36e+48)
              		tmp = ((1.0 + (re * (re * re))) * (0.041666666666666664 * (im * (im * (im * im))))) / ((1.0 + (re * re)) - re);
              	else
              		tmp = (1.0 + (-0.5 * (im * im))) * ((re * re) * (re * (0.16666666666666666 + (0.5 / re))));
              	end
              	tmp_2 = tmp;
              end
              
              code[re_, im_] := If[LessEqual[re, -1.35e+154], N[(N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(-0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(re * re), $MachinePrecision] + N[(1.0 - re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, -600000.0], N[(0.041666666666666664 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.08e+26], N[(1.0 + N[(re * N[(1.0 + N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.36e+48], N[(N[(N[(1.0 + N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.041666666666666664 * N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(re * re), $MachinePrecision]), $MachinePrecision] - re), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(re * re), $MachinePrecision] * N[(re * N[(0.16666666666666666 + N[(0.5 / re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;re \leq -1.35 \cdot 10^{+154}:\\
              \;\;\;\;\frac{1 + \left(im \cdot im\right) \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)}{re \cdot re + \left(1 - re\right)}\\
              
              \mathbf{elif}\;re \leq -600000:\\
              \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\
              
              \mathbf{elif}\;re \leq 1.08 \cdot 10^{+26}:\\
              \;\;\;\;1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\\
              
              \mathbf{elif}\;re \leq 1.36 \cdot 10^{+48}:\\
              \;\;\;\;\frac{\left(1 + re \cdot \left(re \cdot re\right)\right) \cdot \left(0.041666666666666664 \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\right)}{\left(1 + re \cdot re\right) - re}\\
              
              \mathbf{else}:\\
              \;\;\;\;\left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 5 regimes
              2. if re < -1.35000000000000003e154

                1. Initial program 100.0%

                  \[e^{re} \cdot \cos im \]
                2. Add Preprocessing
                3. Taylor expanded in re around 0

                  \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\right)}, \mathsf{cos.f64}\left(im\right)\right) \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                  2. +-lowering-+.f641.9%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                5. Simplified1.9%

                  \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \cos im \]
                6. Taylor expanded in im around 0

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right) \]
                7. Step-by-step derivation
                  1. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                  2. unpow2N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24} \cdot {im}^{2}} - \frac{1}{2}\right)\right)\right)\right) \]
                  3. associate-*l*N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right)\right) \]
                  4. *-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot \color{blue}{im}\right)\right)\right)\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot im\right)}\right)\right)\right) \]
                  6. *-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                  7. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                  8. sub-negN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right)\right) \]
                  9. metadata-evalN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \frac{-1}{2}\right)\right)\right)\right)\right) \]
                  10. +-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{-1}{2} + \color{blue}{\frac{1}{24} \cdot {im}^{2}}\right)\right)\right)\right)\right) \]
                  11. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right) \]
                  12. *-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                  13. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                  14. unpow2N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                  15. *-lowering-*.f641.7%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                8. Simplified1.7%

                  \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + im \cdot \left(im \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)} \]
                9. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \left(1 + im \cdot \left(im \cdot \left(\frac{-1}{2} + \left(im \cdot im\right) \cdot \frac{1}{24}\right)\right)\right) \cdot \color{blue}{\left(re + 1\right)} \]
                  2. flip3-+N/A

                    \[\leadsto \left(1 + im \cdot \left(im \cdot \left(\frac{-1}{2} + \left(im \cdot im\right) \cdot \frac{1}{24}\right)\right)\right) \cdot \frac{{re}^{3} + {1}^{3}}{\color{blue}{re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)}} \]
                  3. associate-*r/N/A

                    \[\leadsto \frac{\left(1 + im \cdot \left(im \cdot \left(\frac{-1}{2} + \left(im \cdot im\right) \cdot \frac{1}{24}\right)\right)\right) \cdot \left({re}^{3} + {1}^{3}\right)}{\color{blue}{re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)}} \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + im \cdot \left(im \cdot \left(\frac{-1}{2} + \left(im \cdot im\right) \cdot \frac{1}{24}\right)\right)\right) \cdot \left({re}^{3} + {1}^{3}\right)\right), \color{blue}{\left(re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)\right)}\right) \]
                10. Applied egg-rr0.0%

                  \[\leadsto \color{blue}{\frac{\left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot \left(1 + re \cdot \left(re \cdot re\right)\right)}{re \cdot re + \left(1 - re\right)}} \]
                11. Taylor expanded in re around 0

                  \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}, \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                12. Step-by-step derivation
                  1. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(re, re\right)}, \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  2. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({im}^{2}\right), \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, \color{blue}{re}\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  3. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(im \cdot im\right), \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  4. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  5. sub-negN/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{1}{24} \cdot {im}^{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  6. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{1}{24} \cdot {im}^{2} + \frac{-1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  7. +-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{-1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  8. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left(\frac{1}{24} \cdot {im}^{2}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  9. *-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left({im}^{2} \cdot \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  10. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left({im}^{2}\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  11. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  12. *-lowering-*.f6452.4%

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                13. Simplified52.4%

                  \[\leadsto \frac{\color{blue}{1 + \left(im \cdot im\right) \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)}}{re \cdot re + \left(1 - re\right)} \]

                if -1.35000000000000003e154 < re < -6e5

                1. Initial program 100.0%

                  \[e^{re} \cdot \cos im \]
                2. Add Preprocessing
                3. Taylor expanded in re around 0

                  \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\right)}, \mathsf{cos.f64}\left(im\right)\right) \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                  2. +-lowering-+.f642.6%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                5. Simplified2.6%

                  \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \cos im \]
                6. Taylor expanded in im around 0

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right) \]
                7. Step-by-step derivation
                  1. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                  2. unpow2N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24} \cdot {im}^{2}} - \frac{1}{2}\right)\right)\right)\right) \]
                  3. associate-*l*N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right)\right) \]
                  4. *-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot \color{blue}{im}\right)\right)\right)\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot im\right)}\right)\right)\right) \]
                  6. *-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                  7. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                  8. sub-negN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right)\right) \]
                  9. metadata-evalN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \frac{-1}{2}\right)\right)\right)\right)\right) \]
                  10. +-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{-1}{2} + \color{blue}{\frac{1}{24} \cdot {im}^{2}}\right)\right)\right)\right)\right) \]
                  11. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right) \]
                  12. *-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                  13. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                  14. unpow2N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                  15. *-lowering-*.f642.3%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                8. Simplified2.3%

                  \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + im \cdot \left(im \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\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}{24} \cdot {im}^{4}\right)}\right) \]
                10. Step-by-step derivation
                  1. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\left({im}^{4}\right)}\right)\right) \]
                  2. metadata-evalN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({im}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right)\right) \]
                  3. pow-sqrN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right)\right) \]
                  4. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                  5. unpow2N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \left({\color{blue}{im}}^{2}\right)\right)\right)\right) \]
                  6. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({\color{blue}{im}}^{2}\right)\right)\right)\right) \]
                  7. unpow2N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                  8. *-lowering-*.f6461.7%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                11. Simplified61.7%

                  \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)} \]
                12. Taylor expanded in re around 0

                  \[\leadsto \mathsf{*.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                13. Step-by-step derivation
                  1. Simplified61.8%

                    \[\leadsto \color{blue}{1} \cdot \left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right) \]

                  if -6e5 < re < 1.08e26

                  1. Initial program 100.0%

                    \[e^{re} \cdot \cos im \]
                  2. Add Preprocessing
                  3. Taylor expanded in im around 0

                    \[\leadsto \color{blue}{e^{re}} \]
                  4. Step-by-step derivation
                    1. exp-lowering-exp.f6454.5%

                      \[\leadsto \mathsf{exp.f64}\left(re\right) \]
                  5. Simplified54.5%

                    \[\leadsto \color{blue}{e^{re}} \]
                  6. Taylor expanded in re around 0

                    \[\leadsto \color{blue}{1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)} \]
                  7. Step-by-step derivation
                    1. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)}\right) \]
                    2. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \color{blue}{\left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)}\right)\right) \]
                    3. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \color{blue}{\left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)}\right)\right)\right) \]
                    4. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot re\right)}\right)\right)\right)\right) \]
                    5. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{6} \cdot re\right)}\right)\right)\right)\right)\right) \]
                    6. *-commutativeN/A

                      \[\leadsto \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 \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                    7. *-lowering-*.f6447.4%

                      \[\leadsto \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, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                  8. Simplified47.4%

                    \[\leadsto \color{blue}{1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)} \]

                  if 1.08e26 < re < 1.3599999999999999e48

                  1. Initial program 100.0%

                    \[e^{re} \cdot \cos im \]
                  2. Add Preprocessing
                  3. Taylor expanded in re around 0

                    \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\right)}, \mathsf{cos.f64}\left(im\right)\right) \]
                  4. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                    2. +-lowering-+.f643.4%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                  5. Simplified3.4%

                    \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \cos im \]
                  6. Taylor expanded in im around 0

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right) \]
                  7. Step-by-step derivation
                    1. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                    2. unpow2N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24} \cdot {im}^{2}} - \frac{1}{2}\right)\right)\right)\right) \]
                    3. associate-*l*N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right)\right) \]
                    4. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot \color{blue}{im}\right)\right)\right)\right) \]
                    5. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot im\right)}\right)\right)\right) \]
                    6. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                    7. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                    8. sub-negN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right)\right) \]
                    9. metadata-evalN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \frac{-1}{2}\right)\right)\right)\right)\right) \]
                    10. +-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{-1}{2} + \color{blue}{\frac{1}{24} \cdot {im}^{2}}\right)\right)\right)\right)\right) \]
                    11. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right) \]
                    12. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                    13. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                    14. unpow2N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                    15. *-lowering-*.f6446.4%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                  8. Simplified46.4%

                    \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + im \cdot \left(im \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\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}{24} \cdot {im}^{4}\right)}\right) \]
                  10. Step-by-step derivation
                    1. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\left({im}^{4}\right)}\right)\right) \]
                    2. metadata-evalN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({im}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right)\right) \]
                    3. pow-sqrN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right)\right) \]
                    4. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                    5. unpow2N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \left({\color{blue}{im}}^{2}\right)\right)\right)\right) \]
                    6. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({\color{blue}{im}}^{2}\right)\right)\right)\right) \]
                    7. unpow2N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                    8. *-lowering-*.f6446.1%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                  11. Simplified46.1%

                    \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)} \]
                  12. Step-by-step derivation
                    1. flip3-+N/A

                      \[\leadsto \frac{{re}^{3} + {1}^{3}}{re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)} \cdot \left(\color{blue}{\frac{1}{24}} \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right) \]
                    2. cube-unmultN/A

                      \[\leadsto \frac{re \cdot \left(re \cdot re\right) + {1}^{3}}{re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)} \cdot \left(\frac{1}{24} \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right) \]
                    3. metadata-evalN/A

                      \[\leadsto \frac{re \cdot \left(re \cdot re\right) + 1}{re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)} \cdot \left(\frac{1}{24} \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right) \]
                    4. +-commutativeN/A

                      \[\leadsto \frac{1 + re \cdot \left(re \cdot re\right)}{re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)} \cdot \left(\frac{1}{24} \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right) \]
                    5. *-commutativeN/A

                      \[\leadsto \frac{1 + re \cdot \left(re \cdot re\right)}{re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)} \cdot \left(\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\frac{1}{24}}\right) \]
                    6. associate-*r*N/A

                      \[\leadsto \frac{1 + re \cdot \left(re \cdot re\right)}{re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)} \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(\left(im \cdot im\right) \cdot \frac{1}{24}\right)}\right) \]
                    7. associate-*r*N/A

                      \[\leadsto \frac{1 + re \cdot \left(re \cdot re\right)}{re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)} \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot \color{blue}{\left(im \cdot \frac{1}{24}\right)}\right)\right) \]
                    8. associate-*l/N/A

                      \[\leadsto \frac{\left(1 + re \cdot \left(re \cdot re\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \frac{1}{24}\right)\right)\right)}{\color{blue}{re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)}} \]
                    9. metadata-evalN/A

                      \[\leadsto \frac{\left(1 + re \cdot \left(re \cdot re\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \frac{1}{24}\right)\right)\right)}{re \cdot re + \left(1 - \color{blue}{re} \cdot 1\right)} \]
                    10. *-rgt-identityN/A

                      \[\leadsto \frac{\left(1 + re \cdot \left(re \cdot re\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \frac{1}{24}\right)\right)\right)}{re \cdot re + \left(1 - re\right)} \]
                    11. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + re \cdot \left(re \cdot re\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \frac{1}{24}\right)\right)\right)\right), \color{blue}{\left(re \cdot re + \left(1 - re\right)\right)}\right) \]
                  13. Applied egg-rr56.5%

                    \[\leadsto \color{blue}{\frac{\left(1 + re \cdot \left(re \cdot re\right)\right) \cdot \left(0.041666666666666664 \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\right)}{\left(1 + re \cdot re\right) - re}} \]

                  if 1.3599999999999999e48 < re

                  1. Initial program 100.0%

                    \[e^{re} \cdot \cos im \]
                  2. Add Preprocessing
                  3. Taylor expanded in im around 0

                    \[\leadsto \color{blue}{e^{re} + \frac{-1}{2} \cdot \left({im}^{2} \cdot e^{re}\right)} \]
                  4. Step-by-step derivation
                    1. *-lft-identityN/A

                      \[\leadsto 1 \cdot e^{re} + \color{blue}{\frac{-1}{2}} \cdot \left({im}^{2} \cdot e^{re}\right) \]
                    2. associate-*r*N/A

                      \[\leadsto 1 \cdot e^{re} + \left(\frac{-1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{e^{re}} \]
                    3. distribute-rgt-inN/A

                      \[\leadsto e^{re} \cdot \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)} \]
                    4. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\left(e^{re}\right), \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)}\right) \]
                    5. exp-lowering-exp.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \left(\color{blue}{1} + \frac{-1}{2} \cdot {im}^{2}\right)\right) \]
                    6. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                    7. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                    8. unpow2N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                    9. *-lowering-*.f6483.7%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                  5. Simplified83.7%

                    \[\leadsto \color{blue}{e^{re} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)} \]
                  6. Taylor expanded in re around 0

                    \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                  7. Step-by-step derivation
                    1. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                    2. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                    3. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                    4. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                    5. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot re\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                    6. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                    7. *-lowering-*.f6470.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), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                  8. Simplified70.4%

                    \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \]
                  9. Taylor expanded in re around inf

                    \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left({re}^{3} \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                  10. Step-by-step derivation
                    1. unpow3N/A

                      \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(re \cdot re\right) \cdot re\right) \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                    2. unpow2N/A

                      \[\leadsto \mathsf{*.f64}\left(\left(\left({re}^{2} \cdot re\right) \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                    3. associate-*l*N/A

                      \[\leadsto \mathsf{*.f64}\left(\left({re}^{2} \cdot \left(re \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                    4. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({re}^{2}\right), \left(re \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                    5. unpow2N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(re \cdot re\right), \left(re \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                    6. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(re \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                    7. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                    8. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{6}, \left(\frac{1}{2} \cdot \frac{1}{re}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                    9. associate-*r/N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{6}, \left(\frac{\frac{1}{2} \cdot 1}{re}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                    10. metadata-evalN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{6}, \left(\frac{\frac{1}{2}}{re}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                    11. /-lowering-/.f6470.4%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\frac{1}{2}, re\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                  11. Simplified70.4%

                    \[\leadsto \color{blue}{\left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \]
                14. Recombined 5 regimes into one program.
                15. Final simplification54.8%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{1 + \left(im \cdot im\right) \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)}{re \cdot re + \left(1 - re\right)}\\ \mathbf{elif}\;re \leq -600000:\\ \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\ \mathbf{elif}\;re \leq 1.08 \cdot 10^{+26}:\\ \;\;\;\;1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\\ \mathbf{elif}\;re \leq 1.36 \cdot 10^{+48}:\\ \;\;\;\;\frac{\left(1 + re \cdot \left(re \cdot re\right)\right) \cdot \left(0.041666666666666664 \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\right)}{\left(1 + re \cdot re\right) - re}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)\\ \end{array} \]
                16. Add Preprocessing

                Alternative 14: 52.5% accurate, 4.6× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := re \cdot re + \left(1 - re\right)\\ \mathbf{if}\;re \leq -1.34 \cdot 10^{+154}:\\ \;\;\;\;\frac{1 + \left(im \cdot im\right) \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)}{t\_0}\\ \mathbf{elif}\;re \leq -600000:\\ \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\ \mathbf{elif}\;re \leq 1.1 \cdot 10^{+122}:\\ \;\;\;\;\frac{\left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot \left(1 + re \cdot \left(re \cdot re\right)\right)}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)\\ \end{array} \end{array} \]
                (FPCore (re im)
                 :precision binary64
                 (let* ((t_0 (+ (* re re) (- 1.0 re))))
                   (if (<= re -1.34e+154)
                     (/ (+ 1.0 (* (* im im) (+ -0.5 (* (* im im) 0.041666666666666664)))) t_0)
                     (if (<= re -600000.0)
                       (* 0.041666666666666664 (* (* im im) (* im im)))
                       (if (<= re 1.1e+122)
                         (/
                          (*
                           (+ 1.0 (* (* im im) (+ -0.5 (* im (* im 0.041666666666666664)))))
                           (+ 1.0 (* re (* re re))))
                          t_0)
                         (*
                          (+ 1.0 (* -0.5 (* im im)))
                          (* (* re re) (* re (+ 0.16666666666666666 (/ 0.5 re))))))))))
                double code(double re, double im) {
                	double t_0 = (re * re) + (1.0 - re);
                	double tmp;
                	if (re <= -1.34e+154) {
                		tmp = (1.0 + ((im * im) * (-0.5 + ((im * im) * 0.041666666666666664)))) / t_0;
                	} else if (re <= -600000.0) {
                		tmp = 0.041666666666666664 * ((im * im) * (im * im));
                	} else if (re <= 1.1e+122) {
                		tmp = ((1.0 + ((im * im) * (-0.5 + (im * (im * 0.041666666666666664))))) * (1.0 + (re * (re * re)))) / t_0;
                	} else {
                		tmp = (1.0 + (-0.5 * (im * im))) * ((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) :: t_0
                    real(8) :: tmp
                    t_0 = (re * re) + (1.0d0 - re)
                    if (re <= (-1.34d+154)) then
                        tmp = (1.0d0 + ((im * im) * ((-0.5d0) + ((im * im) * 0.041666666666666664d0)))) / t_0
                    else if (re <= (-600000.0d0)) then
                        tmp = 0.041666666666666664d0 * ((im * im) * (im * im))
                    else if (re <= 1.1d+122) then
                        tmp = ((1.0d0 + ((im * im) * ((-0.5d0) + (im * (im * 0.041666666666666664d0))))) * (1.0d0 + (re * (re * re)))) / t_0
                    else
                        tmp = (1.0d0 + ((-0.5d0) * (im * im))) * ((re * re) * (re * (0.16666666666666666d0 + (0.5d0 / re))))
                    end if
                    code = tmp
                end function
                
                public static double code(double re, double im) {
                	double t_0 = (re * re) + (1.0 - re);
                	double tmp;
                	if (re <= -1.34e+154) {
                		tmp = (1.0 + ((im * im) * (-0.5 + ((im * im) * 0.041666666666666664)))) / t_0;
                	} else if (re <= -600000.0) {
                		tmp = 0.041666666666666664 * ((im * im) * (im * im));
                	} else if (re <= 1.1e+122) {
                		tmp = ((1.0 + ((im * im) * (-0.5 + (im * (im * 0.041666666666666664))))) * (1.0 + (re * (re * re)))) / t_0;
                	} else {
                		tmp = (1.0 + (-0.5 * (im * im))) * ((re * re) * (re * (0.16666666666666666 + (0.5 / re))));
                	}
                	return tmp;
                }
                
                def code(re, im):
                	t_0 = (re * re) + (1.0 - re)
                	tmp = 0
                	if re <= -1.34e+154:
                		tmp = (1.0 + ((im * im) * (-0.5 + ((im * im) * 0.041666666666666664)))) / t_0
                	elif re <= -600000.0:
                		tmp = 0.041666666666666664 * ((im * im) * (im * im))
                	elif re <= 1.1e+122:
                		tmp = ((1.0 + ((im * im) * (-0.5 + (im * (im * 0.041666666666666664))))) * (1.0 + (re * (re * re)))) / t_0
                	else:
                		tmp = (1.0 + (-0.5 * (im * im))) * ((re * re) * (re * (0.16666666666666666 + (0.5 / re))))
                	return tmp
                
                function code(re, im)
                	t_0 = Float64(Float64(re * re) + Float64(1.0 - re))
                	tmp = 0.0
                	if (re <= -1.34e+154)
                		tmp = Float64(Float64(1.0 + Float64(Float64(im * im) * Float64(-0.5 + Float64(Float64(im * im) * 0.041666666666666664)))) / t_0);
                	elseif (re <= -600000.0)
                		tmp = Float64(0.041666666666666664 * Float64(Float64(im * im) * Float64(im * im)));
                	elseif (re <= 1.1e+122)
                		tmp = Float64(Float64(Float64(1.0 + Float64(Float64(im * im) * Float64(-0.5 + Float64(im * Float64(im * 0.041666666666666664))))) * Float64(1.0 + Float64(re * Float64(re * re)))) / t_0);
                	else
                		tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(im * im))) * Float64(Float64(re * re) * Float64(re * Float64(0.16666666666666666 + Float64(0.5 / re)))));
                	end
                	return tmp
                end
                
                function tmp_2 = code(re, im)
                	t_0 = (re * re) + (1.0 - re);
                	tmp = 0.0;
                	if (re <= -1.34e+154)
                		tmp = (1.0 + ((im * im) * (-0.5 + ((im * im) * 0.041666666666666664)))) / t_0;
                	elseif (re <= -600000.0)
                		tmp = 0.041666666666666664 * ((im * im) * (im * im));
                	elseif (re <= 1.1e+122)
                		tmp = ((1.0 + ((im * im) * (-0.5 + (im * (im * 0.041666666666666664))))) * (1.0 + (re * (re * re)))) / t_0;
                	else
                		tmp = (1.0 + (-0.5 * (im * im))) * ((re * re) * (re * (0.16666666666666666 + (0.5 / re))));
                	end
                	tmp_2 = tmp;
                end
                
                code[re_, im_] := Block[{t$95$0 = N[(N[(re * re), $MachinePrecision] + N[(1.0 - re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -1.34e+154], N[(N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(-0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[re, -600000.0], N[(0.041666666666666664 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.1e+122], N[(N[(N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(-0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(1.0 + N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(re * re), $MachinePrecision] * N[(re * N[(0.16666666666666666 + N[(0.5 / re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := re \cdot re + \left(1 - re\right)\\
                \mathbf{if}\;re \leq -1.34 \cdot 10^{+154}:\\
                \;\;\;\;\frac{1 + \left(im \cdot im\right) \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)}{t\_0}\\
                
                \mathbf{elif}\;re \leq -600000:\\
                \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\
                
                \mathbf{elif}\;re \leq 1.1 \cdot 10^{+122}:\\
                \;\;\;\;\frac{\left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot \left(1 + re \cdot \left(re \cdot re\right)\right)}{t\_0}\\
                
                \mathbf{else}:\\
                \;\;\;\;\left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 4 regimes
                2. if re < -1.34000000000000001e154

                  1. Initial program 100.0%

                    \[e^{re} \cdot \cos im \]
                  2. Add Preprocessing
                  3. Taylor expanded in re around 0

                    \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\right)}, \mathsf{cos.f64}\left(im\right)\right) \]
                  4. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                    2. +-lowering-+.f641.9%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                  5. Simplified1.9%

                    \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \cos im \]
                  6. Taylor expanded in im around 0

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right) \]
                  7. Step-by-step derivation
                    1. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                    2. unpow2N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24} \cdot {im}^{2}} - \frac{1}{2}\right)\right)\right)\right) \]
                    3. associate-*l*N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right)\right) \]
                    4. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot \color{blue}{im}\right)\right)\right)\right) \]
                    5. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot im\right)}\right)\right)\right) \]
                    6. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                    7. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                    8. sub-negN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right)\right) \]
                    9. metadata-evalN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \frac{-1}{2}\right)\right)\right)\right)\right) \]
                    10. +-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{-1}{2} + \color{blue}{\frac{1}{24} \cdot {im}^{2}}\right)\right)\right)\right)\right) \]
                    11. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right) \]
                    12. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                    13. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                    14. unpow2N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                    15. *-lowering-*.f641.7%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                  8. Simplified1.7%

                    \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + im \cdot \left(im \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)} \]
                  9. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \left(1 + im \cdot \left(im \cdot \left(\frac{-1}{2} + \left(im \cdot im\right) \cdot \frac{1}{24}\right)\right)\right) \cdot \color{blue}{\left(re + 1\right)} \]
                    2. flip3-+N/A

                      \[\leadsto \left(1 + im \cdot \left(im \cdot \left(\frac{-1}{2} + \left(im \cdot im\right) \cdot \frac{1}{24}\right)\right)\right) \cdot \frac{{re}^{3} + {1}^{3}}{\color{blue}{re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)}} \]
                    3. associate-*r/N/A

                      \[\leadsto \frac{\left(1 + im \cdot \left(im \cdot \left(\frac{-1}{2} + \left(im \cdot im\right) \cdot \frac{1}{24}\right)\right)\right) \cdot \left({re}^{3} + {1}^{3}\right)}{\color{blue}{re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)}} \]
                    4. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + im \cdot \left(im \cdot \left(\frac{-1}{2} + \left(im \cdot im\right) \cdot \frac{1}{24}\right)\right)\right) \cdot \left({re}^{3} + {1}^{3}\right)\right), \color{blue}{\left(re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)\right)}\right) \]
                  10. Applied egg-rr0.0%

                    \[\leadsto \color{blue}{\frac{\left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot \left(1 + re \cdot \left(re \cdot re\right)\right)}{re \cdot re + \left(1 - re\right)}} \]
                  11. Taylor expanded in re around 0

                    \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}, \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  12. Step-by-step derivation
                    1. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(re, re\right)}, \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                    2. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({im}^{2}\right), \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, \color{blue}{re}\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                    3. unpow2N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(im \cdot im\right), \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                    4. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                    5. sub-negN/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{1}{24} \cdot {im}^{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                    6. metadata-evalN/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{1}{24} \cdot {im}^{2} + \frac{-1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                    7. +-commutativeN/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{-1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                    8. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left(\frac{1}{24} \cdot {im}^{2}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                    9. *-commutativeN/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left({im}^{2} \cdot \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                    10. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left({im}^{2}\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                    11. unpow2N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                    12. *-lowering-*.f6452.4%

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                  13. Simplified52.4%

                    \[\leadsto \frac{\color{blue}{1 + \left(im \cdot im\right) \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)}}{re \cdot re + \left(1 - re\right)} \]

                  if -1.34000000000000001e154 < re < -6e5

                  1. Initial program 100.0%

                    \[e^{re} \cdot \cos im \]
                  2. Add Preprocessing
                  3. Taylor expanded in re around 0

                    \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\right)}, \mathsf{cos.f64}\left(im\right)\right) \]
                  4. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                    2. +-lowering-+.f642.6%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                  5. Simplified2.6%

                    \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \cos im \]
                  6. Taylor expanded in im around 0

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right) \]
                  7. Step-by-step derivation
                    1. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                    2. unpow2N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24} \cdot {im}^{2}} - \frac{1}{2}\right)\right)\right)\right) \]
                    3. associate-*l*N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right)\right) \]
                    4. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot \color{blue}{im}\right)\right)\right)\right) \]
                    5. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot im\right)}\right)\right)\right) \]
                    6. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                    7. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                    8. sub-negN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right)\right) \]
                    9. metadata-evalN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \frac{-1}{2}\right)\right)\right)\right)\right) \]
                    10. +-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{-1}{2} + \color{blue}{\frac{1}{24} \cdot {im}^{2}}\right)\right)\right)\right)\right) \]
                    11. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right) \]
                    12. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                    13. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                    14. unpow2N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                    15. *-lowering-*.f642.3%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                  8. Simplified2.3%

                    \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + im \cdot \left(im \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\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}{24} \cdot {im}^{4}\right)}\right) \]
                  10. Step-by-step derivation
                    1. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\left({im}^{4}\right)}\right)\right) \]
                    2. metadata-evalN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({im}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right)\right) \]
                    3. pow-sqrN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right)\right) \]
                    4. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                    5. unpow2N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \left({\color{blue}{im}}^{2}\right)\right)\right)\right) \]
                    6. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({\color{blue}{im}}^{2}\right)\right)\right)\right) \]
                    7. unpow2N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                    8. *-lowering-*.f6461.7%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                  11. Simplified61.7%

                    \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)} \]
                  12. Taylor expanded in re around 0

                    \[\leadsto \mathsf{*.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                  13. Step-by-step derivation
                    1. Simplified61.8%

                      \[\leadsto \color{blue}{1} \cdot \left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right) \]

                    if -6e5 < re < 1.1e122

                    1. Initial program 100.0%

                      \[e^{re} \cdot \cos im \]
                    2. Add Preprocessing
                    3. Taylor expanded in re around 0

                      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\right)}, \mathsf{cos.f64}\left(im\right)\right) \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                      2. +-lowering-+.f6478.8%

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                    5. Simplified78.8%

                      \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \cos im \]
                    6. Taylor expanded in im around 0

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right) \]
                    7. Step-by-step derivation
                      1. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                      2. unpow2N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24} \cdot {im}^{2}} - \frac{1}{2}\right)\right)\right)\right) \]
                      3. associate-*l*N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right)\right) \]
                      4. *-commutativeN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot \color{blue}{im}\right)\right)\right)\right) \]
                      5. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot im\right)}\right)\right)\right) \]
                      6. *-commutativeN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                      7. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                      8. sub-negN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right)\right) \]
                      9. metadata-evalN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \frac{-1}{2}\right)\right)\right)\right)\right) \]
                      10. +-commutativeN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{-1}{2} + \color{blue}{\frac{1}{24} \cdot {im}^{2}}\right)\right)\right)\right)\right) \]
                      11. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right) \]
                      12. *-commutativeN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                      13. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                      14. unpow2N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                      15. *-lowering-*.f6442.2%

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                    8. Simplified42.2%

                      \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + im \cdot \left(im \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)} \]
                    9. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto \left(1 + im \cdot \left(im \cdot \left(\frac{-1}{2} + \left(im \cdot im\right) \cdot \frac{1}{24}\right)\right)\right) \cdot \color{blue}{\left(re + 1\right)} \]
                      2. flip3-+N/A

                        \[\leadsto \left(1 + im \cdot \left(im \cdot \left(\frac{-1}{2} + \left(im \cdot im\right) \cdot \frac{1}{24}\right)\right)\right) \cdot \frac{{re}^{3} + {1}^{3}}{\color{blue}{re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)}} \]
                      3. associate-*r/N/A

                        \[\leadsto \frac{\left(1 + im \cdot \left(im \cdot \left(\frac{-1}{2} + \left(im \cdot im\right) \cdot \frac{1}{24}\right)\right)\right) \cdot \left({re}^{3} + {1}^{3}\right)}{\color{blue}{re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)}} \]
                      4. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + im \cdot \left(im \cdot \left(\frac{-1}{2} + \left(im \cdot im\right) \cdot \frac{1}{24}\right)\right)\right) \cdot \left({re}^{3} + {1}^{3}\right)\right), \color{blue}{\left(re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)\right)}\right) \]
                    10. Applied egg-rr44.2%

                      \[\leadsto \color{blue}{\frac{\left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot \left(1 + re \cdot \left(re \cdot re\right)\right)}{re \cdot re + \left(1 - re\right)}} \]

                    if 1.1e122 < re

                    1. Initial program 100.0%

                      \[e^{re} \cdot \cos im \]
                    2. Add Preprocessing
                    3. Taylor expanded in im around 0

                      \[\leadsto \color{blue}{e^{re} + \frac{-1}{2} \cdot \left({im}^{2} \cdot e^{re}\right)} \]
                    4. Step-by-step derivation
                      1. *-lft-identityN/A

                        \[\leadsto 1 \cdot e^{re} + \color{blue}{\frac{-1}{2}} \cdot \left({im}^{2} \cdot e^{re}\right) \]
                      2. associate-*r*N/A

                        \[\leadsto 1 \cdot e^{re} + \left(\frac{-1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{e^{re}} \]
                      3. distribute-rgt-inN/A

                        \[\leadsto e^{re} \cdot \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)} \]
                      4. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\left(e^{re}\right), \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)}\right) \]
                      5. exp-lowering-exp.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \left(\color{blue}{1} + \frac{-1}{2} \cdot {im}^{2}\right)\right) \]
                      6. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                      7. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                      8. unpow2N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                      9. *-lowering-*.f6483.8%

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                    5. Simplified83.8%

                      \[\leadsto \color{blue}{e^{re} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)} \]
                    6. Taylor expanded in re around 0

                      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                    7. Step-by-step derivation
                      1. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                      2. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                      3. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                      4. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                      5. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot re\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                      6. *-commutativeN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                      7. *-lowering-*.f6483.8%

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                    8. Simplified83.8%

                      \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \]
                    9. Taylor expanded in re around inf

                      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left({re}^{3} \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                    10. Step-by-step derivation
                      1. unpow3N/A

                        \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(re \cdot re\right) \cdot re\right) \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                      2. unpow2N/A

                        \[\leadsto \mathsf{*.f64}\left(\left(\left({re}^{2} \cdot re\right) \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                      3. associate-*l*N/A

                        \[\leadsto \mathsf{*.f64}\left(\left({re}^{2} \cdot \left(re \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                      4. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({re}^{2}\right), \left(re \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                      5. unpow2N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(re \cdot re\right), \left(re \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                      6. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(re \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                      7. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                      8. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{6}, \left(\frac{1}{2} \cdot \frac{1}{re}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                      9. associate-*r/N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{6}, \left(\frac{\frac{1}{2} \cdot 1}{re}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                      10. metadata-evalN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{6}, \left(\frac{\frac{1}{2}}{re}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                      11. /-lowering-/.f6483.8%

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\frac{1}{2}, re\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                    11. Simplified83.8%

                      \[\leadsto \color{blue}{\left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \]
                  14. Recombined 4 regimes into one program.
                  15. Final simplification53.5%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -1.34 \cdot 10^{+154}:\\ \;\;\;\;\frac{1 + \left(im \cdot im\right) \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)}{re \cdot re + \left(1 - re\right)}\\ \mathbf{elif}\;re \leq -600000:\\ \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\ \mathbf{elif}\;re \leq 1.1 \cdot 10^{+122}:\\ \;\;\;\;\frac{\left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot \left(1 + re \cdot \left(re \cdot re\right)\right)}{re \cdot re + \left(1 - re\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)\\ \end{array} \]
                  16. Add Preprocessing

                  Alternative 15: 52.4% accurate, 6.5× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq -1.34 \cdot 10^{+154}:\\ \;\;\;\;\frac{1 + \left(im \cdot im\right) \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)}{re \cdot re + \left(1 - re\right)}\\ \mathbf{elif}\;re \leq -600000:\\ \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right) \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)\\ \end{array} \end{array} \]
                  (FPCore (re im)
                   :precision binary64
                   (if (<= re -1.34e+154)
                     (/
                      (+ 1.0 (* (* im im) (+ -0.5 (* (* im im) 0.041666666666666664))))
                      (+ (* re re) (- 1.0 re)))
                     (if (<= re -600000.0)
                       (* 0.041666666666666664 (* (* im im) (* im im)))
                       (*
                        (+ 1.0 (* re (+ 1.0 (* re (+ 0.5 (* re 0.16666666666666666))))))
                        (+ 1.0 (* -0.5 (* im im)))))))
                  double code(double re, double im) {
                  	double tmp;
                  	if (re <= -1.34e+154) {
                  		tmp = (1.0 + ((im * im) * (-0.5 + ((im * im) * 0.041666666666666664)))) / ((re * re) + (1.0 - re));
                  	} else if (re <= -600000.0) {
                  		tmp = 0.041666666666666664 * ((im * im) * (im * im));
                  	} else {
                  		tmp = (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) * (1.0 + (-0.5 * (im * im)));
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(re, im)
                      real(8), intent (in) :: re
                      real(8), intent (in) :: im
                      real(8) :: tmp
                      if (re <= (-1.34d+154)) then
                          tmp = (1.0d0 + ((im * im) * ((-0.5d0) + ((im * im) * 0.041666666666666664d0)))) / ((re * re) + (1.0d0 - re))
                      else if (re <= (-600000.0d0)) then
                          tmp = 0.041666666666666664d0 * ((im * im) * (im * im))
                      else
                          tmp = (1.0d0 + (re * (1.0d0 + (re * (0.5d0 + (re * 0.16666666666666666d0)))))) * (1.0d0 + ((-0.5d0) * (im * im)))
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double re, double im) {
                  	double tmp;
                  	if (re <= -1.34e+154) {
                  		tmp = (1.0 + ((im * im) * (-0.5 + ((im * im) * 0.041666666666666664)))) / ((re * re) + (1.0 - re));
                  	} else if (re <= -600000.0) {
                  		tmp = 0.041666666666666664 * ((im * im) * (im * im));
                  	} else {
                  		tmp = (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) * (1.0 + (-0.5 * (im * im)));
                  	}
                  	return tmp;
                  }
                  
                  def code(re, im):
                  	tmp = 0
                  	if re <= -1.34e+154:
                  		tmp = (1.0 + ((im * im) * (-0.5 + ((im * im) * 0.041666666666666664)))) / ((re * re) + (1.0 - re))
                  	elif re <= -600000.0:
                  		tmp = 0.041666666666666664 * ((im * im) * (im * im))
                  	else:
                  		tmp = (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) * (1.0 + (-0.5 * (im * im)))
                  	return tmp
                  
                  function code(re, im)
                  	tmp = 0.0
                  	if (re <= -1.34e+154)
                  		tmp = Float64(Float64(1.0 + Float64(Float64(im * im) * Float64(-0.5 + Float64(Float64(im * im) * 0.041666666666666664)))) / Float64(Float64(re * re) + Float64(1.0 - re)));
                  	elseif (re <= -600000.0)
                  		tmp = Float64(0.041666666666666664 * Float64(Float64(im * im) * Float64(im * im)));
                  	else
                  		tmp = Float64(Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666)))))) * Float64(1.0 + Float64(-0.5 * Float64(im * im))));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(re, im)
                  	tmp = 0.0;
                  	if (re <= -1.34e+154)
                  		tmp = (1.0 + ((im * im) * (-0.5 + ((im * im) * 0.041666666666666664)))) / ((re * re) + (1.0 - re));
                  	elseif (re <= -600000.0)
                  		tmp = 0.041666666666666664 * ((im * im) * (im * im));
                  	else
                  		tmp = (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) * (1.0 + (-0.5 * (im * im)));
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[re_, im_] := If[LessEqual[re, -1.34e+154], N[(N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(-0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(re * re), $MachinePrecision] + N[(1.0 - re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, -600000.0], N[(0.041666666666666664 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(re * N[(1.0 + N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;re \leq -1.34 \cdot 10^{+154}:\\
                  \;\;\;\;\frac{1 + \left(im \cdot im\right) \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)}{re \cdot re + \left(1 - re\right)}\\
                  
                  \mathbf{elif}\;re \leq -600000:\\
                  \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right) \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if re < -1.34000000000000001e154

                    1. Initial program 100.0%

                      \[e^{re} \cdot \cos im \]
                    2. Add Preprocessing
                    3. Taylor expanded in re around 0

                      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\right)}, \mathsf{cos.f64}\left(im\right)\right) \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                      2. +-lowering-+.f641.9%

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                    5. Simplified1.9%

                      \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \cos im \]
                    6. Taylor expanded in im around 0

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right) \]
                    7. Step-by-step derivation
                      1. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                      2. unpow2N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24} \cdot {im}^{2}} - \frac{1}{2}\right)\right)\right)\right) \]
                      3. associate-*l*N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right)\right) \]
                      4. *-commutativeN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot \color{blue}{im}\right)\right)\right)\right) \]
                      5. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot im\right)}\right)\right)\right) \]
                      6. *-commutativeN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                      7. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                      8. sub-negN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right)\right) \]
                      9. metadata-evalN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \frac{-1}{2}\right)\right)\right)\right)\right) \]
                      10. +-commutativeN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{-1}{2} + \color{blue}{\frac{1}{24} \cdot {im}^{2}}\right)\right)\right)\right)\right) \]
                      11. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right) \]
                      12. *-commutativeN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                      13. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                      14. unpow2N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                      15. *-lowering-*.f641.7%

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                    8. Simplified1.7%

                      \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + im \cdot \left(im \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)} \]
                    9. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto \left(1 + im \cdot \left(im \cdot \left(\frac{-1}{2} + \left(im \cdot im\right) \cdot \frac{1}{24}\right)\right)\right) \cdot \color{blue}{\left(re + 1\right)} \]
                      2. flip3-+N/A

                        \[\leadsto \left(1 + im \cdot \left(im \cdot \left(\frac{-1}{2} + \left(im \cdot im\right) \cdot \frac{1}{24}\right)\right)\right) \cdot \frac{{re}^{3} + {1}^{3}}{\color{blue}{re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)}} \]
                      3. associate-*r/N/A

                        \[\leadsto \frac{\left(1 + im \cdot \left(im \cdot \left(\frac{-1}{2} + \left(im \cdot im\right) \cdot \frac{1}{24}\right)\right)\right) \cdot \left({re}^{3} + {1}^{3}\right)}{\color{blue}{re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)}} \]
                      4. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + im \cdot \left(im \cdot \left(\frac{-1}{2} + \left(im \cdot im\right) \cdot \frac{1}{24}\right)\right)\right) \cdot \left({re}^{3} + {1}^{3}\right)\right), \color{blue}{\left(re \cdot re + \left(1 \cdot 1 - re \cdot 1\right)\right)}\right) \]
                    10. Applied egg-rr0.0%

                      \[\leadsto \color{blue}{\frac{\left(1 + \left(im \cdot im\right) \cdot \left(-0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot \left(1 + re \cdot \left(re \cdot re\right)\right)}{re \cdot re + \left(1 - re\right)}} \]
                    11. Taylor expanded in re around 0

                      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}, \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                    12. Step-by-step derivation
                      1. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(re, re\right)}, \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                      2. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({im}^{2}\right), \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, \color{blue}{re}\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                      3. unpow2N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(im \cdot im\right), \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                      4. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                      5. sub-negN/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{1}{24} \cdot {im}^{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                      6. metadata-evalN/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{1}{24} \cdot {im}^{2} + \frac{-1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                      7. +-commutativeN/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{-1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                      8. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left(\frac{1}{24} \cdot {im}^{2}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                      9. *-commutativeN/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left({im}^{2} \cdot \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                      10. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left({im}^{2}\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                      11. unpow2N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                      12. *-lowering-*.f6452.4%

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{\_.f64}\left(1, re\right)\right)\right) \]
                    13. Simplified52.4%

                      \[\leadsto \frac{\color{blue}{1 + \left(im \cdot im\right) \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)}}{re \cdot re + \left(1 - re\right)} \]

                    if -1.34000000000000001e154 < re < -6e5

                    1. Initial program 100.0%

                      \[e^{re} \cdot \cos im \]
                    2. Add Preprocessing
                    3. Taylor expanded in re around 0

                      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\right)}, \mathsf{cos.f64}\left(im\right)\right) \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                      2. +-lowering-+.f642.6%

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                    5. Simplified2.6%

                      \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \cos im \]
                    6. Taylor expanded in im around 0

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right) \]
                    7. Step-by-step derivation
                      1. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                      2. unpow2N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24} \cdot {im}^{2}} - \frac{1}{2}\right)\right)\right)\right) \]
                      3. associate-*l*N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right)\right) \]
                      4. *-commutativeN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot \color{blue}{im}\right)\right)\right)\right) \]
                      5. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot im\right)}\right)\right)\right) \]
                      6. *-commutativeN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                      7. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                      8. sub-negN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right)\right) \]
                      9. metadata-evalN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \frac{-1}{2}\right)\right)\right)\right)\right) \]
                      10. +-commutativeN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{-1}{2} + \color{blue}{\frac{1}{24} \cdot {im}^{2}}\right)\right)\right)\right)\right) \]
                      11. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right) \]
                      12. *-commutativeN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                      13. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                      14. unpow2N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                      15. *-lowering-*.f642.3%

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                    8. Simplified2.3%

                      \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + im \cdot \left(im \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\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}{24} \cdot {im}^{4}\right)}\right) \]
                    10. Step-by-step derivation
                      1. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\left({im}^{4}\right)}\right)\right) \]
                      2. metadata-evalN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({im}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right)\right) \]
                      3. pow-sqrN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right)\right) \]
                      4. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                      5. unpow2N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \left({\color{blue}{im}}^{2}\right)\right)\right)\right) \]
                      6. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({\color{blue}{im}}^{2}\right)\right)\right)\right) \]
                      7. unpow2N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                      8. *-lowering-*.f6461.7%

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                    11. Simplified61.7%

                      \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)} \]
                    12. Taylor expanded in re around 0

                      \[\leadsto \mathsf{*.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                    13. Step-by-step derivation
                      1. Simplified61.8%

                        \[\leadsto \color{blue}{1} \cdot \left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right) \]

                      if -6e5 < re

                      1. Initial program 100.0%

                        \[e^{re} \cdot \cos im \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{e^{re} + \frac{-1}{2} \cdot \left({im}^{2} \cdot e^{re}\right)} \]
                      4. Step-by-step derivation
                        1. *-lft-identityN/A

                          \[\leadsto 1 \cdot e^{re} + \color{blue}{\frac{-1}{2}} \cdot \left({im}^{2} \cdot e^{re}\right) \]
                        2. associate-*r*N/A

                          \[\leadsto 1 \cdot e^{re} + \left(\frac{-1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{e^{re}} \]
                        3. distribute-rgt-inN/A

                          \[\leadsto e^{re} \cdot \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)} \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\left(e^{re}\right), \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)}\right) \]
                        5. exp-lowering-exp.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \left(\color{blue}{1} + \frac{-1}{2} \cdot {im}^{2}\right)\right) \]
                        6. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                        8. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                        9. *-lowering-*.f6459.1%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                      5. Simplified59.1%

                        \[\leadsto \color{blue}{e^{re} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)} \]
                      6. Taylor expanded in re around 0

                        \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                      7. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                        2. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                        3. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                        5. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot re\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                        6. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                        7. *-lowering-*.f6449.5%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                      8. Simplified49.5%

                        \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \]
                    14. Recombined 3 regimes into one program.
                    15. Final simplification51.6%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -1.34 \cdot 10^{+154}:\\ \;\;\;\;\frac{1 + \left(im \cdot im\right) \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)}{re \cdot re + \left(1 - re\right)}\\ \mathbf{elif}\;re \leq -600000:\\ \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right) \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)\\ \end{array} \]
                    16. Add Preprocessing

                    Alternative 16: 51.3% accurate, 7.0× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq -600000:\\ \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\ \mathbf{elif}\;re \leq 6.8 \cdot 10^{+46}:\\ \;\;\;\;1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)\\ \end{array} \end{array} \]
                    (FPCore (re im)
                     :precision binary64
                     (if (<= re -600000.0)
                       (* 0.041666666666666664 (* (* im im) (* im im)))
                       (if (<= re 6.8e+46)
                         (+ 1.0 (* re (+ 1.0 (* re (+ 0.5 (* re 0.16666666666666666))))))
                         (*
                          (+ 1.0 (* -0.5 (* im im)))
                          (* (* re re) (* re (+ 0.16666666666666666 (/ 0.5 re))))))))
                    double code(double re, double im) {
                    	double tmp;
                    	if (re <= -600000.0) {
                    		tmp = 0.041666666666666664 * ((im * im) * (im * im));
                    	} else if (re <= 6.8e+46) {
                    		tmp = 1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))));
                    	} else {
                    		tmp = (1.0 + (-0.5 * (im * im))) * ((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 = 0.041666666666666664d0 * ((im * im) * (im * im))
                        else if (re <= 6.8d+46) then
                            tmp = 1.0d0 + (re * (1.0d0 + (re * (0.5d0 + (re * 0.16666666666666666d0)))))
                        else
                            tmp = (1.0d0 + ((-0.5d0) * (im * im))) * ((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 = 0.041666666666666664 * ((im * im) * (im * im));
                    	} else if (re <= 6.8e+46) {
                    		tmp = 1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))));
                    	} else {
                    		tmp = (1.0 + (-0.5 * (im * im))) * ((re * re) * (re * (0.16666666666666666 + (0.5 / re))));
                    	}
                    	return tmp;
                    }
                    
                    def code(re, im):
                    	tmp = 0
                    	if re <= -600000.0:
                    		tmp = 0.041666666666666664 * ((im * im) * (im * im))
                    	elif re <= 6.8e+46:
                    		tmp = 1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))
                    	else:
                    		tmp = (1.0 + (-0.5 * (im * im))) * ((re * re) * (re * (0.16666666666666666 + (0.5 / re))))
                    	return tmp
                    
                    function code(re, im)
                    	tmp = 0.0
                    	if (re <= -600000.0)
                    		tmp = Float64(0.041666666666666664 * Float64(Float64(im * im) * Float64(im * im)));
                    	elseif (re <= 6.8e+46)
                    		tmp = Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666))))));
                    	else
                    		tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(im * im))) * Float64(Float64(re * re) * Float64(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 = 0.041666666666666664 * ((im * im) * (im * im));
                    	elseif (re <= 6.8e+46)
                    		tmp = 1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))));
                    	else
                    		tmp = (1.0 + (-0.5 * (im * im))) * ((re * re) * (re * (0.16666666666666666 + (0.5 / re))));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[re_, im_] := If[LessEqual[re, -600000.0], N[(0.041666666666666664 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 6.8e+46], N[(1.0 + N[(re * N[(1.0 + N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(re * re), $MachinePrecision] * N[(re * N[(0.16666666666666666 + N[(0.5 / re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;re \leq -600000:\\
                    \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\
                    
                    \mathbf{elif}\;re \leq 6.8 \cdot 10^{+46}:\\
                    \;\;\;\;1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\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 \cos im \]
                      2. Add Preprocessing
                      3. Taylor expanded in re around 0

                        \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\right)}, \mathsf{cos.f64}\left(im\right)\right) \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                        2. +-lowering-+.f642.2%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                      5. Simplified2.2%

                        \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \cos im \]
                      6. Taylor expanded in im around 0

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right) \]
                      7. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                        2. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24} \cdot {im}^{2}} - \frac{1}{2}\right)\right)\right)\right) \]
                        3. associate-*l*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right)\right) \]
                        4. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot \color{blue}{im}\right)\right)\right)\right) \]
                        5. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot im\right)}\right)\right)\right) \]
                        6. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                        8. sub-negN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right)\right) \]
                        9. metadata-evalN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \frac{-1}{2}\right)\right)\right)\right)\right) \]
                        10. +-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{-1}{2} + \color{blue}{\frac{1}{24} \cdot {im}^{2}}\right)\right)\right)\right)\right) \]
                        11. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right) \]
                        12. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                        13. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                        14. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                        15. *-lowering-*.f642.0%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                      8. Simplified2.0%

                        \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + im \cdot \left(im \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\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}{24} \cdot {im}^{4}\right)}\right) \]
                      10. Step-by-step derivation
                        1. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\left({im}^{4}\right)}\right)\right) \]
                        2. metadata-evalN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({im}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right)\right) \]
                        3. pow-sqrN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right)\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                        5. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \left({\color{blue}{im}}^{2}\right)\right)\right)\right) \]
                        6. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({\color{blue}{im}}^{2}\right)\right)\right)\right) \]
                        7. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                        8. *-lowering-*.f6441.3%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                      11. Simplified41.3%

                        \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)} \]
                      12. Taylor expanded in re around 0

                        \[\leadsto \mathsf{*.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                      13. Step-by-step derivation
                        1. Simplified41.8%

                          \[\leadsto \color{blue}{1} \cdot \left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right) \]

                        if -6e5 < re < 6.7999999999999996e46

                        1. Initial program 100.0%

                          \[e^{re} \cdot \cos im \]
                        2. Add Preprocessing
                        3. Taylor expanded in im around 0

                          \[\leadsto \color{blue}{e^{re}} \]
                        4. Step-by-step derivation
                          1. exp-lowering-exp.f6456.9%

                            \[\leadsto \mathsf{exp.f64}\left(re\right) \]
                        5. Simplified56.9%

                          \[\leadsto \color{blue}{e^{re}} \]
                        6. Taylor expanded in re around 0

                          \[\leadsto \color{blue}{1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)} \]
                        7. Step-by-step derivation
                          1. +-lowering-+.f64N/A

                            \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)}\right) \]
                          2. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \color{blue}{\left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)}\right)\right) \]
                          3. +-lowering-+.f64N/A

                            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \color{blue}{\left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)}\right)\right)\right) \]
                          4. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot re\right)}\right)\right)\right)\right) \]
                          5. +-lowering-+.f64N/A

                            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{6} \cdot re\right)}\right)\right)\right)\right)\right) \]
                          6. *-commutativeN/A

                            \[\leadsto \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 \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                          7. *-lowering-*.f6444.4%

                            \[\leadsto \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, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                        8. Simplified44.4%

                          \[\leadsto \color{blue}{1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)} \]

                        if 6.7999999999999996e46 < re

                        1. Initial program 100.0%

                          \[e^{re} \cdot \cos im \]
                        2. Add Preprocessing
                        3. Taylor expanded in im around 0

                          \[\leadsto \color{blue}{e^{re} + \frac{-1}{2} \cdot \left({im}^{2} \cdot e^{re}\right)} \]
                        4. Step-by-step derivation
                          1. *-lft-identityN/A

                            \[\leadsto 1 \cdot e^{re} + \color{blue}{\frac{-1}{2}} \cdot \left({im}^{2} \cdot e^{re}\right) \]
                          2. associate-*r*N/A

                            \[\leadsto 1 \cdot e^{re} + \left(\frac{-1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{e^{re}} \]
                          3. distribute-rgt-inN/A

                            \[\leadsto e^{re} \cdot \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)} \]
                          4. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\left(e^{re}\right), \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)}\right) \]
                          5. exp-lowering-exp.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \left(\color{blue}{1} + \frac{-1}{2} \cdot {im}^{2}\right)\right) \]
                          6. +-lowering-+.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                          7. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                          8. unpow2N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                          9. *-lowering-*.f6483.7%

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                        5. Simplified83.7%

                          \[\leadsto \color{blue}{e^{re} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)} \]
                        6. Taylor expanded in re around 0

                          \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                        7. Step-by-step derivation
                          1. +-lowering-+.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                          2. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                          3. +-lowering-+.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                          4. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                          5. +-lowering-+.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot re\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                          6. *-commutativeN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                          7. *-lowering-*.f6470.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), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                        8. Simplified70.4%

                          \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \]
                        9. Taylor expanded in re around inf

                          \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left({re}^{3} \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                        10. Step-by-step derivation
                          1. unpow3N/A

                            \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(re \cdot re\right) \cdot re\right) \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                          2. unpow2N/A

                            \[\leadsto \mathsf{*.f64}\left(\left(\left({re}^{2} \cdot re\right) \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                          3. associate-*l*N/A

                            \[\leadsto \mathsf{*.f64}\left(\left({re}^{2} \cdot \left(re \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                          4. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({re}^{2}\right), \left(re \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                          5. unpow2N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(re \cdot re\right), \left(re \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                          6. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(re \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                          7. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{re}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                          8. +-lowering-+.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{6}, \left(\frac{1}{2} \cdot \frac{1}{re}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                          9. associate-*r/N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{6}, \left(\frac{\frac{1}{2} \cdot 1}{re}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                          10. metadata-evalN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{6}, \left(\frac{\frac{1}{2}}{re}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                          11. /-lowering-/.f6470.4%

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\frac{1}{2}, re\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                        11. Simplified70.4%

                          \[\leadsto \color{blue}{\left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \]
                      14. Recombined 3 regimes into one program.
                      15. Final simplification48.6%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -600000:\\ \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\ \mathbf{elif}\;re \leq 6.8 \cdot 10^{+46}:\\ \;\;\;\;1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot \left(0.16666666666666666 + \frac{0.5}{re}\right)\right)\right)\\ \end{array} \]
                      16. Add Preprocessing

                      Alternative 17: 49.6% accurate, 7.8× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq -600000:\\ \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right) \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)\\ \end{array} \end{array} \]
                      (FPCore (re im)
                       :precision binary64
                       (if (<= re -600000.0)
                         (* 0.041666666666666664 (* (* im im) (* im im)))
                         (*
                          (+ 1.0 (* re (+ 1.0 (* re (+ 0.5 (* re 0.16666666666666666))))))
                          (+ 1.0 (* -0.5 (* im im))))))
                      double code(double re, double im) {
                      	double tmp;
                      	if (re <= -600000.0) {
                      		tmp = 0.041666666666666664 * ((im * im) * (im * im));
                      	} else {
                      		tmp = (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) * (1.0 + (-0.5 * (im * im)));
                      	}
                      	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 = 0.041666666666666664d0 * ((im * im) * (im * im))
                          else
                              tmp = (1.0d0 + (re * (1.0d0 + (re * (0.5d0 + (re * 0.16666666666666666d0)))))) * (1.0d0 + ((-0.5d0) * (im * im)))
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double re, double im) {
                      	double tmp;
                      	if (re <= -600000.0) {
                      		tmp = 0.041666666666666664 * ((im * im) * (im * im));
                      	} else {
                      		tmp = (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) * (1.0 + (-0.5 * (im * im)));
                      	}
                      	return tmp;
                      }
                      
                      def code(re, im):
                      	tmp = 0
                      	if re <= -600000.0:
                      		tmp = 0.041666666666666664 * ((im * im) * (im * im))
                      	else:
                      		tmp = (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) * (1.0 + (-0.5 * (im * im)))
                      	return tmp
                      
                      function code(re, im)
                      	tmp = 0.0
                      	if (re <= -600000.0)
                      		tmp = Float64(0.041666666666666664 * Float64(Float64(im * im) * Float64(im * im)));
                      	else
                      		tmp = Float64(Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666)))))) * Float64(1.0 + Float64(-0.5 * Float64(im * im))));
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(re, im)
                      	tmp = 0.0;
                      	if (re <= -600000.0)
                      		tmp = 0.041666666666666664 * ((im * im) * (im * im));
                      	else
                      		tmp = (1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))) * (1.0 + (-0.5 * (im * im)));
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[re_, im_] := If[LessEqual[re, -600000.0], N[(0.041666666666666664 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(re * N[(1.0 + N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;re \leq -600000:\\
                      \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right) \cdot \left(1 + -0.5 \cdot \left(im \cdot im\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 \cos im \]
                        2. Add Preprocessing
                        3. Taylor expanded in re around 0

                          \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\right)}, \mathsf{cos.f64}\left(im\right)\right) \]
                        4. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                          2. +-lowering-+.f642.2%

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                        5. Simplified2.2%

                          \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \cos im \]
                        6. Taylor expanded in im around 0

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right) \]
                        7. Step-by-step derivation
                          1. +-lowering-+.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                          2. unpow2N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24} \cdot {im}^{2}} - \frac{1}{2}\right)\right)\right)\right) \]
                          3. associate-*l*N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right)\right) \]
                          4. *-commutativeN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot \color{blue}{im}\right)\right)\right)\right) \]
                          5. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot im\right)}\right)\right)\right) \]
                          6. *-commutativeN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                          7. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                          8. sub-negN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right)\right) \]
                          9. metadata-evalN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \frac{-1}{2}\right)\right)\right)\right)\right) \]
                          10. +-commutativeN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{-1}{2} + \color{blue}{\frac{1}{24} \cdot {im}^{2}}\right)\right)\right)\right)\right) \]
                          11. +-lowering-+.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right) \]
                          12. *-commutativeN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                          13. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                          14. unpow2N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                          15. *-lowering-*.f642.0%

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                        8. Simplified2.0%

                          \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + im \cdot \left(im \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\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}{24} \cdot {im}^{4}\right)}\right) \]
                        10. Step-by-step derivation
                          1. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\left({im}^{4}\right)}\right)\right) \]
                          2. metadata-evalN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({im}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right)\right) \]
                          3. pow-sqrN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right)\right) \]
                          4. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                          5. unpow2N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \left({\color{blue}{im}}^{2}\right)\right)\right)\right) \]
                          6. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({\color{blue}{im}}^{2}\right)\right)\right)\right) \]
                          7. unpow2N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                          8. *-lowering-*.f6441.3%

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                        11. Simplified41.3%

                          \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)} \]
                        12. Taylor expanded in re around 0

                          \[\leadsto \mathsf{*.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                        13. Step-by-step derivation
                          1. Simplified41.8%

                            \[\leadsto \color{blue}{1} \cdot \left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right) \]

                          if -6e5 < re

                          1. Initial program 100.0%

                            \[e^{re} \cdot \cos im \]
                          2. Add Preprocessing
                          3. Taylor expanded in im around 0

                            \[\leadsto \color{blue}{e^{re} + \frac{-1}{2} \cdot \left({im}^{2} \cdot e^{re}\right)} \]
                          4. Step-by-step derivation
                            1. *-lft-identityN/A

                              \[\leadsto 1 \cdot e^{re} + \color{blue}{\frac{-1}{2}} \cdot \left({im}^{2} \cdot e^{re}\right) \]
                            2. associate-*r*N/A

                              \[\leadsto 1 \cdot e^{re} + \left(\frac{-1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{e^{re}} \]
                            3. distribute-rgt-inN/A

                              \[\leadsto e^{re} \cdot \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)} \]
                            4. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\left(e^{re}\right), \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)}\right) \]
                            5. exp-lowering-exp.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \left(\color{blue}{1} + \frac{-1}{2} \cdot {im}^{2}\right)\right) \]
                            6. +-lowering-+.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                            7. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                            8. unpow2N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                            9. *-lowering-*.f6459.1%

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                          5. Simplified59.1%

                            \[\leadsto \color{blue}{e^{re} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)} \]
                          6. Taylor expanded in re around 0

                            \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                          7. Step-by-step derivation
                            1. +-lowering-+.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                            2. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                            3. +-lowering-+.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                            4. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                            5. +-lowering-+.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot re\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                            6. *-commutativeN/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                            7. *-lowering-*.f6449.5%

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                          8. Simplified49.5%

                            \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \]
                        14. Recombined 2 regimes into one program.
                        15. Final simplification47.3%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -600000:\\ \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right) \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)\\ \end{array} \]
                        16. Add Preprocessing

                        Alternative 18: 51.3% accurate, 8.8× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq -600000:\\ \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\ \mathbf{elif}\;re \leq 6.8 \cdot 10^{+46}:\\ \;\;\;\;1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(0.16666666666666666 + \left(im \cdot im\right) \cdot -0.08333333333333333\right)\\ \end{array} \end{array} \]
                        (FPCore (re im)
                         :precision binary64
                         (if (<= re -600000.0)
                           (* 0.041666666666666664 (* (* im im) (* im im)))
                           (if (<= re 6.8e+46)
                             (+ 1.0 (* re (+ 1.0 (* re (+ 0.5 (* re 0.16666666666666666))))))
                             (*
                              (* re (* re re))
                              (+ 0.16666666666666666 (* (* im im) -0.08333333333333333))))))
                        double code(double re, double im) {
                        	double tmp;
                        	if (re <= -600000.0) {
                        		tmp = 0.041666666666666664 * ((im * im) * (im * im));
                        	} else if (re <= 6.8e+46) {
                        		tmp = 1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))));
                        	} else {
                        		tmp = (re * (re * re)) * (0.16666666666666666 + ((im * im) * -0.08333333333333333));
                        	}
                        	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 = 0.041666666666666664d0 * ((im * im) * (im * im))
                            else if (re <= 6.8d+46) then
                                tmp = 1.0d0 + (re * (1.0d0 + (re * (0.5d0 + (re * 0.16666666666666666d0)))))
                            else
                                tmp = (re * (re * re)) * (0.16666666666666666d0 + ((im * im) * (-0.08333333333333333d0)))
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double re, double im) {
                        	double tmp;
                        	if (re <= -600000.0) {
                        		tmp = 0.041666666666666664 * ((im * im) * (im * im));
                        	} else if (re <= 6.8e+46) {
                        		tmp = 1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))));
                        	} else {
                        		tmp = (re * (re * re)) * (0.16666666666666666 + ((im * im) * -0.08333333333333333));
                        	}
                        	return tmp;
                        }
                        
                        def code(re, im):
                        	tmp = 0
                        	if re <= -600000.0:
                        		tmp = 0.041666666666666664 * ((im * im) * (im * im))
                        	elif re <= 6.8e+46:
                        		tmp = 1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))))
                        	else:
                        		tmp = (re * (re * re)) * (0.16666666666666666 + ((im * im) * -0.08333333333333333))
                        	return tmp
                        
                        function code(re, im)
                        	tmp = 0.0
                        	if (re <= -600000.0)
                        		tmp = Float64(0.041666666666666664 * Float64(Float64(im * im) * Float64(im * im)));
                        	elseif (re <= 6.8e+46)
                        		tmp = Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * Float64(0.5 + Float64(re * 0.16666666666666666))))));
                        	else
                        		tmp = Float64(Float64(re * Float64(re * re)) * Float64(0.16666666666666666 + Float64(Float64(im * im) * -0.08333333333333333)));
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(re, im)
                        	tmp = 0.0;
                        	if (re <= -600000.0)
                        		tmp = 0.041666666666666664 * ((im * im) * (im * im));
                        	elseif (re <= 6.8e+46)
                        		tmp = 1.0 + (re * (1.0 + (re * (0.5 + (re * 0.16666666666666666)))));
                        	else
                        		tmp = (re * (re * re)) * (0.16666666666666666 + ((im * im) * -0.08333333333333333));
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[re_, im_] := If[LessEqual[re, -600000.0], N[(0.041666666666666664 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 6.8e+46], N[(1.0 + N[(re * N[(1.0 + N[(re * N[(0.5 + N[(re * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(0.16666666666666666 + N[(N[(im * im), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;re \leq -600000:\\
                        \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\
                        
                        \mathbf{elif}\;re \leq 6.8 \cdot 10^{+46}:\\
                        \;\;\;\;1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(0.16666666666666666 + \left(im \cdot im\right) \cdot -0.08333333333333333\right)\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 3 regimes
                        2. if re < -6e5

                          1. Initial program 100.0%

                            \[e^{re} \cdot \cos im \]
                          2. Add Preprocessing
                          3. Taylor expanded in re around 0

                            \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\right)}, \mathsf{cos.f64}\left(im\right)\right) \]
                          4. Step-by-step derivation
                            1. +-commutativeN/A

                              \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                            2. +-lowering-+.f642.2%

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                          5. Simplified2.2%

                            \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \cos im \]
                          6. Taylor expanded in im around 0

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right) \]
                          7. Step-by-step derivation
                            1. +-lowering-+.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                            2. unpow2N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24} \cdot {im}^{2}} - \frac{1}{2}\right)\right)\right)\right) \]
                            3. associate-*l*N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right)\right) \]
                            4. *-commutativeN/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot \color{blue}{im}\right)\right)\right)\right) \]
                            5. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot im\right)}\right)\right)\right) \]
                            6. *-commutativeN/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                            7. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                            8. sub-negN/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right)\right) \]
                            9. metadata-evalN/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \frac{-1}{2}\right)\right)\right)\right)\right) \]
                            10. +-commutativeN/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{-1}{2} + \color{blue}{\frac{1}{24} \cdot {im}^{2}}\right)\right)\right)\right)\right) \]
                            11. +-lowering-+.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right) \]
                            12. *-commutativeN/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                            13. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                            14. unpow2N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                            15. *-lowering-*.f642.0%

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                          8. Simplified2.0%

                            \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + im \cdot \left(im \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\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}{24} \cdot {im}^{4}\right)}\right) \]
                          10. Step-by-step derivation
                            1. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\left({im}^{4}\right)}\right)\right) \]
                            2. metadata-evalN/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({im}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right)\right) \]
                            3. pow-sqrN/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right)\right) \]
                            4. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                            5. unpow2N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \left({\color{blue}{im}}^{2}\right)\right)\right)\right) \]
                            6. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({\color{blue}{im}}^{2}\right)\right)\right)\right) \]
                            7. unpow2N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                            8. *-lowering-*.f6441.3%

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                          11. Simplified41.3%

                            \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)} \]
                          12. Taylor expanded in re around 0

                            \[\leadsto \mathsf{*.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                          13. Step-by-step derivation
                            1. Simplified41.8%

                              \[\leadsto \color{blue}{1} \cdot \left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right) \]

                            if -6e5 < re < 6.7999999999999996e46

                            1. Initial program 100.0%

                              \[e^{re} \cdot \cos im \]
                            2. Add Preprocessing
                            3. Taylor expanded in im around 0

                              \[\leadsto \color{blue}{e^{re}} \]
                            4. Step-by-step derivation
                              1. exp-lowering-exp.f6456.9%

                                \[\leadsto \mathsf{exp.f64}\left(re\right) \]
                            5. Simplified56.9%

                              \[\leadsto \color{blue}{e^{re}} \]
                            6. Taylor expanded in re around 0

                              \[\leadsto \color{blue}{1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)} \]
                            7. Step-by-step derivation
                              1. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)}\right) \]
                              2. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \color{blue}{\left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)}\right)\right) \]
                              3. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \color{blue}{\left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)}\right)\right)\right) \]
                              4. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot re\right)}\right)\right)\right)\right) \]
                              5. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{6} \cdot re\right)}\right)\right)\right)\right)\right) \]
                              6. *-commutativeN/A

                                \[\leadsto \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 \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                              7. *-lowering-*.f6444.4%

                                \[\leadsto \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, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                            8. Simplified44.4%

                              \[\leadsto \color{blue}{1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)} \]

                            if 6.7999999999999996e46 < re

                            1. Initial program 100.0%

                              \[e^{re} \cdot \cos im \]
                            2. Add Preprocessing
                            3. Taylor expanded in im around 0

                              \[\leadsto \color{blue}{e^{re} + \frac{-1}{2} \cdot \left({im}^{2} \cdot e^{re}\right)} \]
                            4. Step-by-step derivation
                              1. *-lft-identityN/A

                                \[\leadsto 1 \cdot e^{re} + \color{blue}{\frac{-1}{2}} \cdot \left({im}^{2} \cdot e^{re}\right) \]
                              2. associate-*r*N/A

                                \[\leadsto 1 \cdot e^{re} + \left(\frac{-1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{e^{re}} \]
                              3. distribute-rgt-inN/A

                                \[\leadsto e^{re} \cdot \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)} \]
                              4. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\left(e^{re}\right), \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)}\right) \]
                              5. exp-lowering-exp.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \left(\color{blue}{1} + \frac{-1}{2} \cdot {im}^{2}\right)\right) \]
                              6. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                              7. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                              8. unpow2N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                              9. *-lowering-*.f6483.7%

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                            5. Simplified83.7%

                              \[\leadsto \color{blue}{e^{re} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)} \]
                            6. Taylor expanded in re around 0

                              \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                            7. Step-by-step derivation
                              1. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                              2. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                              3. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                              4. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                              5. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot re\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                              6. *-commutativeN/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                              7. *-lowering-*.f6470.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), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                            8. Simplified70.4%

                              \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \]
                            9. Taylor expanded in re around inf

                              \[\leadsto \color{blue}{\frac{1}{6} \cdot \left({re}^{3} \cdot \left(1 + \frac{-1}{2} \cdot {im}^{2}\right)\right)} \]
                            10. Step-by-step derivation
                              1. *-commutativeN/A

                                \[\leadsto \left({re}^{3} \cdot \left(1 + \frac{-1}{2} \cdot {im}^{2}\right)\right) \cdot \color{blue}{\frac{1}{6}} \]
                              2. associate-*r*N/A

                                \[\leadsto {re}^{3} \cdot \color{blue}{\left(\left(1 + \frac{-1}{2} \cdot {im}^{2}\right) \cdot \frac{1}{6}\right)} \]
                              3. *-commutativeN/A

                                \[\leadsto {re}^{3} \cdot \left(\frac{1}{6} \cdot \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)}\right) \]
                              4. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\left({re}^{3}\right), \color{blue}{\left(\frac{1}{6} \cdot \left(1 + \frac{-1}{2} \cdot {im}^{2}\right)\right)}\right) \]
                              5. cube-multN/A

                                \[\leadsto \mathsf{*.f64}\left(\left(re \cdot \left(re \cdot re\right)\right), \left(\color{blue}{\frac{1}{6}} \cdot \left(1 + \frac{-1}{2} \cdot {im}^{2}\right)\right)\right) \]
                              6. unpow2N/A

                                \[\leadsto \mathsf{*.f64}\left(\left(re \cdot {re}^{2}\right), \left(\frac{1}{6} \cdot \left(1 + \frac{-1}{2} \cdot {im}^{2}\right)\right)\right) \]
                              7. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \left({re}^{2}\right)\right), \left(\color{blue}{\frac{1}{6}} \cdot \left(1 + \frac{-1}{2} \cdot {im}^{2}\right)\right)\right) \]
                              8. unpow2N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \left(re \cdot re\right)\right), \left(\frac{1}{6} \cdot \left(1 + \frac{-1}{2} \cdot {im}^{2}\right)\right)\right) \]
                              9. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \left(\frac{1}{6} \cdot \left(1 + \frac{-1}{2} \cdot {im}^{2}\right)\right)\right) \]
                              10. distribute-lft-inN/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \left(\frac{1}{6} \cdot 1 + \color{blue}{\frac{1}{6} \cdot \left(\frac{-1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                              11. metadata-evalN/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \left(\frac{1}{6} + \color{blue}{\frac{1}{6}} \cdot \left(\frac{-1}{2} \cdot {im}^{2}\right)\right)\right) \]
                              12. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(\frac{1}{6}, \color{blue}{\left(\frac{1}{6} \cdot \left(\frac{-1}{2} \cdot {im}^{2}\right)\right)}\right)\right) \]
                              13. *-commutativeN/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(\frac{1}{6}, \left(\left(\frac{-1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{\frac{1}{6}}\right)\right)\right) \]
                              14. *-commutativeN/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(\frac{1}{6}, \left(\left({im}^{2} \cdot \frac{-1}{2}\right) \cdot \frac{1}{6}\right)\right)\right) \]
                              15. associate-*l*N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(\frac{1}{6}, \left({im}^{2} \cdot \color{blue}{\left(\frac{-1}{2} \cdot \frac{1}{6}\right)}\right)\right)\right) \]
                              16. metadata-evalN/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(\frac{1}{6}, \left({im}^{2} \cdot \frac{-1}{12}\right)\right)\right) \]
                              17. metadata-evalN/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(\frac{1}{6}, \left({im}^{2} \cdot \left(\frac{1}{6} \cdot \color{blue}{\frac{-1}{2}}\right)\right)\right)\right) \]
                              18. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\left(\frac{1}{6} \cdot \frac{-1}{2}\right)}\right)\right)\right) \]
                              19. unpow2N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(\left(im \cdot im\right), \left(\color{blue}{\frac{1}{6}} \cdot \frac{-1}{2}\right)\right)\right)\right) \]
                              20. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\color{blue}{\frac{1}{6}} \cdot \frac{-1}{2}\right)\right)\right)\right) \]
                              21. metadata-eval70.4%

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{-1}{12}\right)\right)\right) \]
                            11. Simplified70.4%

                              \[\leadsto \color{blue}{\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(0.16666666666666666 + \left(im \cdot im\right) \cdot -0.08333333333333333\right)} \]
                          14. Recombined 3 regimes into one program.
                          15. Final simplification48.6%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -600000:\\ \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\ \mathbf{elif}\;re \leq 6.8 \cdot 10^{+46}:\\ \;\;\;\;1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(0.16666666666666666 + \left(im \cdot im\right) \cdot -0.08333333333333333\right)\\ \end{array} \]
                          16. Add Preprocessing

                          Alternative 19: 51.3% accurate, 8.8× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq -600000:\\ \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\ \mathbf{elif}\;re \leq 6.8 \cdot 10^{+46}:\\ \;\;\;\;1 + re \cdot \left(1 + re \cdot 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(0.16666666666666666 + \left(im \cdot im\right) \cdot -0.08333333333333333\right)\\ \end{array} \end{array} \]
                          (FPCore (re im)
                           :precision binary64
                           (if (<= re -600000.0)
                             (* 0.041666666666666664 (* (* im im) (* im im)))
                             (if (<= re 6.8e+46)
                               (+ 1.0 (* re (+ 1.0 (* re 0.5))))
                               (*
                                (* re (* re re))
                                (+ 0.16666666666666666 (* (* im im) -0.08333333333333333))))))
                          double code(double re, double im) {
                          	double tmp;
                          	if (re <= -600000.0) {
                          		tmp = 0.041666666666666664 * ((im * im) * (im * im));
                          	} else if (re <= 6.8e+46) {
                          		tmp = 1.0 + (re * (1.0 + (re * 0.5)));
                          	} else {
                          		tmp = (re * (re * re)) * (0.16666666666666666 + ((im * im) * -0.08333333333333333));
                          	}
                          	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 = 0.041666666666666664d0 * ((im * im) * (im * im))
                              else if (re <= 6.8d+46) then
                                  tmp = 1.0d0 + (re * (1.0d0 + (re * 0.5d0)))
                              else
                                  tmp = (re * (re * re)) * (0.16666666666666666d0 + ((im * im) * (-0.08333333333333333d0)))
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double re, double im) {
                          	double tmp;
                          	if (re <= -600000.0) {
                          		tmp = 0.041666666666666664 * ((im * im) * (im * im));
                          	} else if (re <= 6.8e+46) {
                          		tmp = 1.0 + (re * (1.0 + (re * 0.5)));
                          	} else {
                          		tmp = (re * (re * re)) * (0.16666666666666666 + ((im * im) * -0.08333333333333333));
                          	}
                          	return tmp;
                          }
                          
                          def code(re, im):
                          	tmp = 0
                          	if re <= -600000.0:
                          		tmp = 0.041666666666666664 * ((im * im) * (im * im))
                          	elif re <= 6.8e+46:
                          		tmp = 1.0 + (re * (1.0 + (re * 0.5)))
                          	else:
                          		tmp = (re * (re * re)) * (0.16666666666666666 + ((im * im) * -0.08333333333333333))
                          	return tmp
                          
                          function code(re, im)
                          	tmp = 0.0
                          	if (re <= -600000.0)
                          		tmp = Float64(0.041666666666666664 * Float64(Float64(im * im) * Float64(im * im)));
                          	elseif (re <= 6.8e+46)
                          		tmp = Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * 0.5))));
                          	else
                          		tmp = Float64(Float64(re * Float64(re * re)) * Float64(0.16666666666666666 + Float64(Float64(im * im) * -0.08333333333333333)));
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(re, im)
                          	tmp = 0.0;
                          	if (re <= -600000.0)
                          		tmp = 0.041666666666666664 * ((im * im) * (im * im));
                          	elseif (re <= 6.8e+46)
                          		tmp = 1.0 + (re * (1.0 + (re * 0.5)));
                          	else
                          		tmp = (re * (re * re)) * (0.16666666666666666 + ((im * im) * -0.08333333333333333));
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[re_, im_] := If[LessEqual[re, -600000.0], N[(0.041666666666666664 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 6.8e+46], N[(1.0 + N[(re * N[(1.0 + N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] * N[(0.16666666666666666 + N[(N[(im * im), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;re \leq -600000:\\
                          \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\
                          
                          \mathbf{elif}\;re \leq 6.8 \cdot 10^{+46}:\\
                          \;\;\;\;1 + re \cdot \left(1 + re \cdot 0.5\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(0.16666666666666666 + \left(im \cdot im\right) \cdot -0.08333333333333333\right)\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 3 regimes
                          2. if re < -6e5

                            1. Initial program 100.0%

                              \[e^{re} \cdot \cos im \]
                            2. Add Preprocessing
                            3. Taylor expanded in re around 0

                              \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\right)}, \mathsf{cos.f64}\left(im\right)\right) \]
                            4. Step-by-step derivation
                              1. +-commutativeN/A

                                \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                              2. +-lowering-+.f642.2%

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                            5. Simplified2.2%

                              \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \cos im \]
                            6. Taylor expanded in im around 0

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right) \]
                            7. Step-by-step derivation
                              1. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                              2. unpow2N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24} \cdot {im}^{2}} - \frac{1}{2}\right)\right)\right)\right) \]
                              3. associate-*l*N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right)\right) \]
                              4. *-commutativeN/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot \color{blue}{im}\right)\right)\right)\right) \]
                              5. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot im\right)}\right)\right)\right) \]
                              6. *-commutativeN/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                              7. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                              8. sub-negN/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right)\right) \]
                              9. metadata-evalN/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \frac{-1}{2}\right)\right)\right)\right)\right) \]
                              10. +-commutativeN/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{-1}{2} + \color{blue}{\frac{1}{24} \cdot {im}^{2}}\right)\right)\right)\right)\right) \]
                              11. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right) \]
                              12. *-commutativeN/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                              13. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                              14. unpow2N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                              15. *-lowering-*.f642.0%

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                            8. Simplified2.0%

                              \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + im \cdot \left(im \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\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}{24} \cdot {im}^{4}\right)}\right) \]
                            10. Step-by-step derivation
                              1. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\left({im}^{4}\right)}\right)\right) \]
                              2. metadata-evalN/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({im}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right)\right) \]
                              3. pow-sqrN/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right)\right) \]
                              4. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                              5. unpow2N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \left({\color{blue}{im}}^{2}\right)\right)\right)\right) \]
                              6. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({\color{blue}{im}}^{2}\right)\right)\right)\right) \]
                              7. unpow2N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                              8. *-lowering-*.f6441.3%

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                            11. Simplified41.3%

                              \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)} \]
                            12. Taylor expanded in re around 0

                              \[\leadsto \mathsf{*.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                            13. Step-by-step derivation
                              1. Simplified41.8%

                                \[\leadsto \color{blue}{1} \cdot \left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right) \]

                              if -6e5 < re < 6.7999999999999996e46

                              1. Initial program 100.0%

                                \[e^{re} \cdot \cos im \]
                              2. Add Preprocessing
                              3. Taylor expanded in im around 0

                                \[\leadsto \color{blue}{e^{re}} \]
                              4. Step-by-step derivation
                                1. exp-lowering-exp.f6456.9%

                                  \[\leadsto \mathsf{exp.f64}\left(re\right) \]
                              5. Simplified56.9%

                                \[\leadsto \color{blue}{e^{re}} \]
                              6. Taylor expanded in re around 0

                                \[\leadsto \color{blue}{1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)} \]
                              7. Step-by-step derivation
                                1. +-lowering-+.f64N/A

                                  \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)}\right) \]
                                2. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \color{blue}{\left(1 + \frac{1}{2} \cdot re\right)}\right)\right) \]
                                3. +-lowering-+.f64N/A

                                  \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{2} \cdot re\right)}\right)\right)\right) \]
                                4. *-commutativeN/A

                                  \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \color{blue}{\frac{1}{2}}\right)\right)\right)\right) \]
                                5. *-lowering-*.f6444.3%

                                  \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \color{blue}{\frac{1}{2}}\right)\right)\right)\right) \]
                              8. Simplified44.3%

                                \[\leadsto \color{blue}{1 + re \cdot \left(1 + re \cdot 0.5\right)} \]

                              if 6.7999999999999996e46 < re

                              1. Initial program 100.0%

                                \[e^{re} \cdot \cos im \]
                              2. Add Preprocessing
                              3. Taylor expanded in im around 0

                                \[\leadsto \color{blue}{e^{re} + \frac{-1}{2} \cdot \left({im}^{2} \cdot e^{re}\right)} \]
                              4. Step-by-step derivation
                                1. *-lft-identityN/A

                                  \[\leadsto 1 \cdot e^{re} + \color{blue}{\frac{-1}{2}} \cdot \left({im}^{2} \cdot e^{re}\right) \]
                                2. associate-*r*N/A

                                  \[\leadsto 1 \cdot e^{re} + \left(\frac{-1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{e^{re}} \]
                                3. distribute-rgt-inN/A

                                  \[\leadsto e^{re} \cdot \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)} \]
                                4. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\left(e^{re}\right), \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)}\right) \]
                                5. exp-lowering-exp.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \left(\color{blue}{1} + \frac{-1}{2} \cdot {im}^{2}\right)\right) \]
                                6. +-lowering-+.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                                7. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                                8. unpow2N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                                9. *-lowering-*.f6483.7%

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                              5. Simplified83.7%

                                \[\leadsto \color{blue}{e^{re} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)} \]
                              6. Taylor expanded in re around 0

                                \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                              7. Step-by-step derivation
                                1. +-lowering-+.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                                2. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                                3. +-lowering-+.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                                4. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                                5. +-lowering-+.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot re\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                                6. *-commutativeN/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left(re \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                                7. *-lowering-*.f6470.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), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                              8. Simplified70.4%

                                \[\leadsto \color{blue}{\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + re \cdot 0.16666666666666666\right)\right)\right)} \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right) \]
                              9. Taylor expanded in re around inf

                                \[\leadsto \color{blue}{\frac{1}{6} \cdot \left({re}^{3} \cdot \left(1 + \frac{-1}{2} \cdot {im}^{2}\right)\right)} \]
                              10. Step-by-step derivation
                                1. *-commutativeN/A

                                  \[\leadsto \left({re}^{3} \cdot \left(1 + \frac{-1}{2} \cdot {im}^{2}\right)\right) \cdot \color{blue}{\frac{1}{6}} \]
                                2. associate-*r*N/A

                                  \[\leadsto {re}^{3} \cdot \color{blue}{\left(\left(1 + \frac{-1}{2} \cdot {im}^{2}\right) \cdot \frac{1}{6}\right)} \]
                                3. *-commutativeN/A

                                  \[\leadsto {re}^{3} \cdot \left(\frac{1}{6} \cdot \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)}\right) \]
                                4. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\left({re}^{3}\right), \color{blue}{\left(\frac{1}{6} \cdot \left(1 + \frac{-1}{2} \cdot {im}^{2}\right)\right)}\right) \]
                                5. cube-multN/A

                                  \[\leadsto \mathsf{*.f64}\left(\left(re \cdot \left(re \cdot re\right)\right), \left(\color{blue}{\frac{1}{6}} \cdot \left(1 + \frac{-1}{2} \cdot {im}^{2}\right)\right)\right) \]
                                6. unpow2N/A

                                  \[\leadsto \mathsf{*.f64}\left(\left(re \cdot {re}^{2}\right), \left(\frac{1}{6} \cdot \left(1 + \frac{-1}{2} \cdot {im}^{2}\right)\right)\right) \]
                                7. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \left({re}^{2}\right)\right), \left(\color{blue}{\frac{1}{6}} \cdot \left(1 + \frac{-1}{2} \cdot {im}^{2}\right)\right)\right) \]
                                8. unpow2N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \left(re \cdot re\right)\right), \left(\frac{1}{6} \cdot \left(1 + \frac{-1}{2} \cdot {im}^{2}\right)\right)\right) \]
                                9. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \left(\frac{1}{6} \cdot \left(1 + \frac{-1}{2} \cdot {im}^{2}\right)\right)\right) \]
                                10. distribute-lft-inN/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \left(\frac{1}{6} \cdot 1 + \color{blue}{\frac{1}{6} \cdot \left(\frac{-1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                                11. metadata-evalN/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \left(\frac{1}{6} + \color{blue}{\frac{1}{6}} \cdot \left(\frac{-1}{2} \cdot {im}^{2}\right)\right)\right) \]
                                12. +-lowering-+.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(\frac{1}{6}, \color{blue}{\left(\frac{1}{6} \cdot \left(\frac{-1}{2} \cdot {im}^{2}\right)\right)}\right)\right) \]
                                13. *-commutativeN/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(\frac{1}{6}, \left(\left(\frac{-1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{\frac{1}{6}}\right)\right)\right) \]
                                14. *-commutativeN/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(\frac{1}{6}, \left(\left({im}^{2} \cdot \frac{-1}{2}\right) \cdot \frac{1}{6}\right)\right)\right) \]
                                15. associate-*l*N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(\frac{1}{6}, \left({im}^{2} \cdot \color{blue}{\left(\frac{-1}{2} \cdot \frac{1}{6}\right)}\right)\right)\right) \]
                                16. metadata-evalN/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(\frac{1}{6}, \left({im}^{2} \cdot \frac{-1}{12}\right)\right)\right) \]
                                17. metadata-evalN/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(\frac{1}{6}, \left({im}^{2} \cdot \left(\frac{1}{6} \cdot \color{blue}{\frac{-1}{2}}\right)\right)\right)\right) \]
                                18. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\left(\frac{1}{6} \cdot \frac{-1}{2}\right)}\right)\right)\right) \]
                                19. unpow2N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(\left(im \cdot im\right), \left(\color{blue}{\frac{1}{6}} \cdot \frac{-1}{2}\right)\right)\right)\right) \]
                                20. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\color{blue}{\frac{1}{6}} \cdot \frac{-1}{2}\right)\right)\right)\right) \]
                                21. metadata-eval70.4%

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, re\right)\right), \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{-1}{12}\right)\right)\right) \]
                              11. Simplified70.4%

                                \[\leadsto \color{blue}{\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(0.16666666666666666 + \left(im \cdot im\right) \cdot -0.08333333333333333\right)} \]
                            14. Recombined 3 regimes into one program.
                            15. Final simplification48.5%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -600000:\\ \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\ \mathbf{elif}\;re \leq 6.8 \cdot 10^{+46}:\\ \;\;\;\;1 + re \cdot \left(1 + re \cdot 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(re \cdot re\right)\right) \cdot \left(0.16666666666666666 + \left(im \cdot im\right) \cdot -0.08333333333333333\right)\\ \end{array} \]
                            16. Add Preprocessing

                            Alternative 20: 38.7% accurate, 10.7× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := -0.5 \cdot \left(im \cdot im\right)\\ \mathbf{if}\;re \leq -48000000000000:\\ \;\;\;\;\left(re + 1\right) \cdot t\_0\\ \mathbf{elif}\;re \leq 2.65 \cdot 10^{+48}:\\ \;\;\;\;re + 1\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(1 + t\_0\right)\\ \end{array} \end{array} \]
                            (FPCore (re im)
                             :precision binary64
                             (let* ((t_0 (* -0.5 (* im im))))
                               (if (<= re -48000000000000.0)
                                 (* (+ re 1.0) t_0)
                                 (if (<= re 2.65e+48) (+ re 1.0) (* re (+ 1.0 t_0))))))
                            double code(double re, double im) {
                            	double t_0 = -0.5 * (im * im);
                            	double tmp;
                            	if (re <= -48000000000000.0) {
                            		tmp = (re + 1.0) * t_0;
                            	} else if (re <= 2.65e+48) {
                            		tmp = re + 1.0;
                            	} else {
                            		tmp = re * (1.0 + 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 = (-0.5d0) * (im * im)
                                if (re <= (-48000000000000.0d0)) then
                                    tmp = (re + 1.0d0) * t_0
                                else if (re <= 2.65d+48) then
                                    tmp = re + 1.0d0
                                else
                                    tmp = re * (1.0d0 + t_0)
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double re, double im) {
                            	double t_0 = -0.5 * (im * im);
                            	double tmp;
                            	if (re <= -48000000000000.0) {
                            		tmp = (re + 1.0) * t_0;
                            	} else if (re <= 2.65e+48) {
                            		tmp = re + 1.0;
                            	} else {
                            		tmp = re * (1.0 + t_0);
                            	}
                            	return tmp;
                            }
                            
                            def code(re, im):
                            	t_0 = -0.5 * (im * im)
                            	tmp = 0
                            	if re <= -48000000000000.0:
                            		tmp = (re + 1.0) * t_0
                            	elif re <= 2.65e+48:
                            		tmp = re + 1.0
                            	else:
                            		tmp = re * (1.0 + t_0)
                            	return tmp
                            
                            function code(re, im)
                            	t_0 = Float64(-0.5 * Float64(im * im))
                            	tmp = 0.0
                            	if (re <= -48000000000000.0)
                            		tmp = Float64(Float64(re + 1.0) * t_0);
                            	elseif (re <= 2.65e+48)
                            		tmp = Float64(re + 1.0);
                            	else
                            		tmp = Float64(re * Float64(1.0 + t_0));
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(re, im)
                            	t_0 = -0.5 * (im * im);
                            	tmp = 0.0;
                            	if (re <= -48000000000000.0)
                            		tmp = (re + 1.0) * t_0;
                            	elseif (re <= 2.65e+48)
                            		tmp = re + 1.0;
                            	else
                            		tmp = re * (1.0 + t_0);
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[re_, im_] := Block[{t$95$0 = N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -48000000000000.0], N[(N[(re + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[re, 2.65e+48], N[(re + 1.0), $MachinePrecision], N[(re * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_0 := -0.5 \cdot \left(im \cdot im\right)\\
                            \mathbf{if}\;re \leq -48000000000000:\\
                            \;\;\;\;\left(re + 1\right) \cdot t\_0\\
                            
                            \mathbf{elif}\;re \leq 2.65 \cdot 10^{+48}:\\
                            \;\;\;\;re + 1\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;re \cdot \left(1 + t\_0\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if re < -4.8e13

                              1. Initial program 100.0%

                                \[e^{re} \cdot \cos im \]
                              2. Add Preprocessing
                              3. Taylor expanded in re around 0

                                \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\right)}, \mathsf{cos.f64}\left(im\right)\right) \]
                              4. Step-by-step derivation
                                1. +-commutativeN/A

                                  \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                                2. +-lowering-+.f642.2%

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                              5. Simplified2.2%

                                \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \cos im \]
                              6. Taylor expanded in im around 0

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)}\right) \]
                              7. Step-by-step derivation
                                1. +-lowering-+.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                                2. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                                3. unpow2N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                                4. *-lowering-*.f642.0%

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                              8. Simplified2.0%

                                \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + -0.5 \cdot \left(im \cdot im\right)\right)} \]
                              9. Taylor expanded in im around inf

                                \[\leadsto \color{blue}{\frac{-1}{2} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)} \]
                              10. Step-by-step derivation
                                1. associate-*r*N/A

                                  \[\leadsto \left(\frac{-1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{\left(1 + re\right)} \]
                                2. *-commutativeN/A

                                  \[\leadsto \left(1 + re\right) \cdot \color{blue}{\left(\frac{-1}{2} \cdot {im}^{2}\right)} \]
                                3. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\left(1 + re\right), \color{blue}{\left(\frac{-1}{2} \cdot {im}^{2}\right)}\right) \]
                                4. +-commutativeN/A

                                  \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \left(\color{blue}{\frac{-1}{2}} \cdot {im}^{2}\right)\right) \]
                                5. +-lowering-+.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \left(\color{blue}{\frac{-1}{2}} \cdot {im}^{2}\right)\right) \]
                                6. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{-1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right) \]
                                7. unpow2N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{-1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right) \]
                                8. *-lowering-*.f6429.2%

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right) \]
                              11. Simplified29.2%

                                \[\leadsto \color{blue}{\left(re + 1\right) \cdot \left(-0.5 \cdot \left(im \cdot im\right)\right)} \]

                              if -4.8e13 < re < 2.65e48

                              1. Initial program 100.0%

                                \[e^{re} \cdot \cos im \]
                              2. Add Preprocessing
                              3. Taylor expanded in im around 0

                                \[\leadsto \color{blue}{e^{re}} \]
                              4. Step-by-step derivation
                                1. exp-lowering-exp.f6457.8%

                                  \[\leadsto \mathsf{exp.f64}\left(re\right) \]
                              5. Simplified57.8%

                                \[\leadsto \color{blue}{e^{re}} \]
                              6. Taylor expanded in re around 0

                                \[\leadsto \color{blue}{1 + re} \]
                              7. Step-by-step derivation
                                1. +-lowering-+.f6443.1%

                                  \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{re}\right) \]
                              8. Simplified43.1%

                                \[\leadsto \color{blue}{1 + re} \]

                              if 2.65e48 < re

                              1. Initial program 100.0%

                                \[e^{re} \cdot \cos im \]
                              2. Add Preprocessing
                              3. Taylor expanded in re around 0

                                \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\right)}, \mathsf{cos.f64}\left(im\right)\right) \]
                              4. Step-by-step derivation
                                1. +-commutativeN/A

                                  \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                                2. +-lowering-+.f646.0%

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                              5. Simplified6.0%

                                \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \cos im \]
                              6. Taylor expanded in im around 0

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)}\right) \]
                              7. Step-by-step derivation
                                1. +-lowering-+.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                                2. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                                3. unpow2N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                                4. *-lowering-*.f6432.2%

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                              8. Simplified32.2%

                                \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + -0.5 \cdot \left(im \cdot im\right)\right)} \]
                              9. Taylor expanded in re around inf

                                \[\leadsto \color{blue}{re \cdot \left(1 + \frac{-1}{2} \cdot {im}^{2}\right)} \]
                              10. Step-by-step derivation
                                1. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(re, \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)}\right) \]
                                2. +-lowering-+.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                                3. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                                4. unpow2N/A

                                  \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                                5. *-lowering-*.f6432.2%

                                  \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                              11. Simplified32.2%

                                \[\leadsto \color{blue}{re \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)} \]
                            3. Recombined 3 regimes into one program.
                            4. Final simplification37.1%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -48000000000000:\\ \;\;\;\;\left(re + 1\right) \cdot \left(-0.5 \cdot \left(im \cdot im\right)\right)\\ \mathbf{elif}\;re \leq 2.65 \cdot 10^{+48}:\\ \;\;\;\;re + 1\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)\\ \end{array} \]
                            5. Add Preprocessing

                            Alternative 21: 46.6% accurate, 14.5× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq -600000:\\ \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1 + re \cdot \left(1 + re \cdot 0.5\right)\\ \end{array} \end{array} \]
                            (FPCore (re im)
                             :precision binary64
                             (if (<= re -600000.0)
                               (* 0.041666666666666664 (* (* im im) (* im im)))
                               (+ 1.0 (* re (+ 1.0 (* re 0.5))))))
                            double code(double re, double im) {
                            	double tmp;
                            	if (re <= -600000.0) {
                            		tmp = 0.041666666666666664 * ((im * im) * (im * im));
                            	} else {
                            		tmp = 1.0 + (re * (1.0 + (re * 0.5)));
                            	}
                            	return tmp;
                            }
                            
                            real(8) function code(re, im)
                                real(8), intent (in) :: re
                                real(8), intent (in) :: im
                                real(8) :: tmp
                                if (re <= (-600000.0d0)) then
                                    tmp = 0.041666666666666664d0 * ((im * im) * (im * im))
                                else
                                    tmp = 1.0d0 + (re * (1.0d0 + (re * 0.5d0)))
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double re, double im) {
                            	double tmp;
                            	if (re <= -600000.0) {
                            		tmp = 0.041666666666666664 * ((im * im) * (im * im));
                            	} else {
                            		tmp = 1.0 + (re * (1.0 + (re * 0.5)));
                            	}
                            	return tmp;
                            }
                            
                            def code(re, im):
                            	tmp = 0
                            	if re <= -600000.0:
                            		tmp = 0.041666666666666664 * ((im * im) * (im * im))
                            	else:
                            		tmp = 1.0 + (re * (1.0 + (re * 0.5)))
                            	return tmp
                            
                            function code(re, im)
                            	tmp = 0.0
                            	if (re <= -600000.0)
                            		tmp = Float64(0.041666666666666664 * Float64(Float64(im * im) * Float64(im * im)));
                            	else
                            		tmp = Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * 0.5))));
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(re, im)
                            	tmp = 0.0;
                            	if (re <= -600000.0)
                            		tmp = 0.041666666666666664 * ((im * im) * (im * im));
                            	else
                            		tmp = 1.0 + (re * (1.0 + (re * 0.5)));
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[re_, im_] := If[LessEqual[re, -600000.0], N[(0.041666666666666664 * N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(re * N[(1.0 + N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;re \leq -600000:\\
                            \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;1 + re \cdot \left(1 + re \cdot 0.5\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if re < -6e5

                              1. Initial program 100.0%

                                \[e^{re} \cdot \cos im \]
                              2. Add Preprocessing
                              3. Taylor expanded in re around 0

                                \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\right)}, \mathsf{cos.f64}\left(im\right)\right) \]
                              4. Step-by-step derivation
                                1. +-commutativeN/A

                                  \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                                2. +-lowering-+.f642.2%

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                              5. Simplified2.2%

                                \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \cos im \]
                              6. Taylor expanded in im around 0

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right) \]
                              7. Step-by-step derivation
                                1. +-lowering-+.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                                2. unpow2N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24} \cdot {im}^{2}} - \frac{1}{2}\right)\right)\right)\right) \]
                                3. associate-*l*N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)\right)}\right)\right)\right) \]
                                4. *-commutativeN/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \left(im \cdot \left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot \color{blue}{im}\right)\right)\right)\right) \]
                                5. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right) \cdot im\right)}\right)\right)\right) \]
                                6. *-commutativeN/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                                7. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} - \frac{1}{2}\right)}\right)\right)\right)\right) \]
                                8. sub-negN/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right)\right) \]
                                9. metadata-evalN/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot {im}^{2} + \frac{-1}{2}\right)\right)\right)\right)\right) \]
                                10. +-commutativeN/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{-1}{2} + \color{blue}{\frac{1}{24} \cdot {im}^{2}}\right)\right)\right)\right)\right) \]
                                11. +-lowering-+.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right) \]
                                12. *-commutativeN/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                                13. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                                14. unpow2N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                                15. *-lowering-*.f642.0%

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
                              8. Simplified2.0%

                                \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + im \cdot \left(im \cdot \left(-0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\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}{24} \cdot {im}^{4}\right)}\right) \]
                              10. Step-by-step derivation
                                1. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\left({im}^{4}\right)}\right)\right) \]
                                2. metadata-evalN/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({im}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right)\right) \]
                                3. pow-sqrN/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right)\right) \]
                                4. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                                5. unpow2N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \left({\color{blue}{im}}^{2}\right)\right)\right)\right) \]
                                6. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({\color{blue}{im}}^{2}\right)\right)\right)\right) \]
                                7. unpow2N/A

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                                8. *-lowering-*.f6441.3%

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                              11. Simplified41.3%

                                \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)} \]
                              12. Taylor expanded in re around 0

                                \[\leadsto \mathsf{*.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right)\right)\right) \]
                              13. Step-by-step derivation
                                1. Simplified41.8%

                                  \[\leadsto \color{blue}{1} \cdot \left(0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right) \]

                                if -6e5 < re

                                1. Initial program 100.0%

                                  \[e^{re} \cdot \cos im \]
                                2. Add Preprocessing
                                3. Taylor expanded in im around 0

                                  \[\leadsto \color{blue}{e^{re}} \]
                                4. Step-by-step derivation
                                  1. exp-lowering-exp.f6459.2%

                                    \[\leadsto \mathsf{exp.f64}\left(re\right) \]
                                5. Simplified59.2%

                                  \[\leadsto \color{blue}{e^{re}} \]
                                6. Taylor expanded in re around 0

                                  \[\leadsto \color{blue}{1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)} \]
                                7. Step-by-step derivation
                                  1. +-lowering-+.f64N/A

                                    \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)}\right) \]
                                  2. *-lowering-*.f64N/A

                                    \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \color{blue}{\left(1 + \frac{1}{2} \cdot re\right)}\right)\right) \]
                                  3. +-lowering-+.f64N/A

                                    \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{2} \cdot re\right)}\right)\right)\right) \]
                                  4. *-commutativeN/A

                                    \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \color{blue}{\frac{1}{2}}\right)\right)\right)\right) \]
                                  5. *-lowering-*.f6442.3%

                                    \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \color{blue}{\frac{1}{2}}\right)\right)\right)\right) \]
                                8. Simplified42.3%

                                  \[\leadsto \color{blue}{1 + re \cdot \left(1 + re \cdot 0.5\right)} \]
                              14. Recombined 2 regimes into one program.
                              15. Final simplification42.1%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -600000:\\ \;\;\;\;0.041666666666666664 \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1 + re \cdot \left(1 + re \cdot 0.5\right)\\ \end{array} \]
                              16. Add Preprocessing

                              Alternative 22: 43.3% accurate, 14.5× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq -48000000000000:\\ \;\;\;\;\left(re + 1\right) \cdot \left(-0.5 \cdot \left(im \cdot im\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1 + re \cdot \left(1 + re \cdot 0.5\right)\\ \end{array} \end{array} \]
                              (FPCore (re im)
                               :precision binary64
                               (if (<= re -48000000000000.0)
                                 (* (+ re 1.0) (* -0.5 (* im im)))
                                 (+ 1.0 (* re (+ 1.0 (* re 0.5))))))
                              double code(double re, double im) {
                              	double tmp;
                              	if (re <= -48000000000000.0) {
                              		tmp = (re + 1.0) * (-0.5 * (im * im));
                              	} else {
                              		tmp = 1.0 + (re * (1.0 + (re * 0.5)));
                              	}
                              	return tmp;
                              }
                              
                              real(8) function code(re, im)
                                  real(8), intent (in) :: re
                                  real(8), intent (in) :: im
                                  real(8) :: tmp
                                  if (re <= (-48000000000000.0d0)) then
                                      tmp = (re + 1.0d0) * ((-0.5d0) * (im * im))
                                  else
                                      tmp = 1.0d0 + (re * (1.0d0 + (re * 0.5d0)))
                                  end if
                                  code = tmp
                              end function
                              
                              public static double code(double re, double im) {
                              	double tmp;
                              	if (re <= -48000000000000.0) {
                              		tmp = (re + 1.0) * (-0.5 * (im * im));
                              	} else {
                              		tmp = 1.0 + (re * (1.0 + (re * 0.5)));
                              	}
                              	return tmp;
                              }
                              
                              def code(re, im):
                              	tmp = 0
                              	if re <= -48000000000000.0:
                              		tmp = (re + 1.0) * (-0.5 * (im * im))
                              	else:
                              		tmp = 1.0 + (re * (1.0 + (re * 0.5)))
                              	return tmp
                              
                              function code(re, im)
                              	tmp = 0.0
                              	if (re <= -48000000000000.0)
                              		tmp = Float64(Float64(re + 1.0) * Float64(-0.5 * Float64(im * im)));
                              	else
                              		tmp = Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * 0.5))));
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(re, im)
                              	tmp = 0.0;
                              	if (re <= -48000000000000.0)
                              		tmp = (re + 1.0) * (-0.5 * (im * im));
                              	else
                              		tmp = 1.0 + (re * (1.0 + (re * 0.5)));
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[re_, im_] := If[LessEqual[re, -48000000000000.0], N[(N[(re + 1.0), $MachinePrecision] * N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(re * N[(1.0 + N[(re * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;re \leq -48000000000000:\\
                              \;\;\;\;\left(re + 1\right) \cdot \left(-0.5 \cdot \left(im \cdot im\right)\right)\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;1 + re \cdot \left(1 + re \cdot 0.5\right)\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if re < -4.8e13

                                1. Initial program 100.0%

                                  \[e^{re} \cdot \cos im \]
                                2. Add Preprocessing
                                3. Taylor expanded in re around 0

                                  \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\right)}, \mathsf{cos.f64}\left(im\right)\right) \]
                                4. Step-by-step derivation
                                  1. +-commutativeN/A

                                    \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                                  2. +-lowering-+.f642.2%

                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                                5. Simplified2.2%

                                  \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \cos im \]
                                6. Taylor expanded in im around 0

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)}\right) \]
                                7. Step-by-step derivation
                                  1. +-lowering-+.f64N/A

                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                                  2. *-lowering-*.f64N/A

                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                                  3. unpow2N/A

                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                                  4. *-lowering-*.f642.0%

                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                                8. Simplified2.0%

                                  \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + -0.5 \cdot \left(im \cdot im\right)\right)} \]
                                9. Taylor expanded in im around inf

                                  \[\leadsto \color{blue}{\frac{-1}{2} \cdot \left({im}^{2} \cdot \left(1 + re\right)\right)} \]
                                10. Step-by-step derivation
                                  1. associate-*r*N/A

                                    \[\leadsto \left(\frac{-1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{\left(1 + re\right)} \]
                                  2. *-commutativeN/A

                                    \[\leadsto \left(1 + re\right) \cdot \color{blue}{\left(\frac{-1}{2} \cdot {im}^{2}\right)} \]
                                  3. *-lowering-*.f64N/A

                                    \[\leadsto \mathsf{*.f64}\left(\left(1 + re\right), \color{blue}{\left(\frac{-1}{2} \cdot {im}^{2}\right)}\right) \]
                                  4. +-commutativeN/A

                                    \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \left(\color{blue}{\frac{-1}{2}} \cdot {im}^{2}\right)\right) \]
                                  5. +-lowering-+.f64N/A

                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \left(\color{blue}{\frac{-1}{2}} \cdot {im}^{2}\right)\right) \]
                                  6. *-lowering-*.f64N/A

                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{-1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right) \]
                                  7. unpow2N/A

                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{-1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right) \]
                                  8. *-lowering-*.f6429.2%

                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right) \]
                                11. Simplified29.2%

                                  \[\leadsto \color{blue}{\left(re + 1\right) \cdot \left(-0.5 \cdot \left(im \cdot im\right)\right)} \]

                                if -4.8e13 < re

                                1. Initial program 100.0%

                                  \[e^{re} \cdot \cos im \]
                                2. Add Preprocessing
                                3. Taylor expanded in im around 0

                                  \[\leadsto \color{blue}{e^{re}} \]
                                4. Step-by-step derivation
                                  1. exp-lowering-exp.f6459.6%

                                    \[\leadsto \mathsf{exp.f64}\left(re\right) \]
                                5. Simplified59.6%

                                  \[\leadsto \color{blue}{e^{re}} \]
                                6. Taylor expanded in re around 0

                                  \[\leadsto \color{blue}{1 + re \cdot \left(1 + \frac{1}{2} \cdot re\right)} \]
                                7. Step-by-step derivation
                                  1. +-lowering-+.f64N/A

                                    \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(re \cdot \left(1 + \frac{1}{2} \cdot re\right)\right)}\right) \]
                                  2. *-lowering-*.f64N/A

                                    \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \color{blue}{\left(1 + \frac{1}{2} \cdot re\right)}\right)\right) \]
                                  3. +-lowering-+.f64N/A

                                    \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{2} \cdot re\right)}\right)\right)\right) \]
                                  4. *-commutativeN/A

                                    \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \color{blue}{\frac{1}{2}}\right)\right)\right)\right) \]
                                  5. *-lowering-*.f6441.8%

                                    \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \color{blue}{\frac{1}{2}}\right)\right)\right)\right) \]
                                8. Simplified41.8%

                                  \[\leadsto \color{blue}{1 + re \cdot \left(1 + re \cdot 0.5\right)} \]
                              3. Recombined 2 regimes into one program.
                              4. Add Preprocessing

                              Alternative 23: 33.4% accurate, 14.5× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 7.2 \cdot 10^{+46}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)\\ \end{array} \end{array} \]
                              (FPCore (re im)
                               :precision binary64
                               (if (<= re 7.2e+46) 1.0 (* re (+ 1.0 (* -0.5 (* im im))))))
                              double code(double re, double im) {
                              	double tmp;
                              	if (re <= 7.2e+46) {
                              		tmp = 1.0;
                              	} else {
                              		tmp = re * (1.0 + (-0.5 * (im * im)));
                              	}
                              	return tmp;
                              }
                              
                              real(8) function code(re, im)
                                  real(8), intent (in) :: re
                                  real(8), intent (in) :: im
                                  real(8) :: tmp
                                  if (re <= 7.2d+46) then
                                      tmp = 1.0d0
                                  else
                                      tmp = re * (1.0d0 + ((-0.5d0) * (im * im)))
                                  end if
                                  code = tmp
                              end function
                              
                              public static double code(double re, double im) {
                              	double tmp;
                              	if (re <= 7.2e+46) {
                              		tmp = 1.0;
                              	} else {
                              		tmp = re * (1.0 + (-0.5 * (im * im)));
                              	}
                              	return tmp;
                              }
                              
                              def code(re, im):
                              	tmp = 0
                              	if re <= 7.2e+46:
                              		tmp = 1.0
                              	else:
                              		tmp = re * (1.0 + (-0.5 * (im * im)))
                              	return tmp
                              
                              function code(re, im)
                              	tmp = 0.0
                              	if (re <= 7.2e+46)
                              		tmp = 1.0;
                              	else
                              		tmp = Float64(re * Float64(1.0 + Float64(-0.5 * Float64(im * im))));
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(re, im)
                              	tmp = 0.0;
                              	if (re <= 7.2e+46)
                              		tmp = 1.0;
                              	else
                              		tmp = re * (1.0 + (-0.5 * (im * im)));
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[re_, im_] := If[LessEqual[re, 7.2e+46], 1.0, N[(re * N[(1.0 + N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;re \leq 7.2 \cdot 10^{+46}:\\
                              \;\;\;\;1\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;re \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if re < 7.1999999999999997e46

                                1. Initial program 100.0%

                                  \[e^{re} \cdot \cos im \]
                                2. Add Preprocessing
                                3. Taylor expanded in im around 0

                                  \[\leadsto \color{blue}{e^{re}} \]
                                4. Step-by-step derivation
                                  1. exp-lowering-exp.f6472.5%

                                    \[\leadsto \mathsf{exp.f64}\left(re\right) \]
                                5. Simplified72.5%

                                  \[\leadsto \color{blue}{e^{re}} \]
                                6. Taylor expanded in re around 0

                                  \[\leadsto \color{blue}{1} \]
                                7. Step-by-step derivation
                                  1. Simplified29.0%

                                    \[\leadsto \color{blue}{1} \]

                                  if 7.1999999999999997e46 < re

                                  1. Initial program 100.0%

                                    \[e^{re} \cdot \cos im \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in re around 0

                                    \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + re\right)}, \mathsf{cos.f64}\left(im\right)\right) \]
                                  4. Step-by-step derivation
                                    1. +-commutativeN/A

                                      \[\leadsto \mathsf{*.f64}\left(\left(re + 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                                    2. +-lowering-+.f645.9%

                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{cos.f64}\left(\color{blue}{im}\right)\right) \]
                                  5. Simplified5.9%

                                    \[\leadsto \color{blue}{\left(re + 1\right)} \cdot \cos im \]
                                  6. Taylor expanded in im around 0

                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)}\right) \]
                                  7. Step-by-step derivation
                                    1. +-lowering-+.f64N/A

                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                                    2. *-lowering-*.f64N/A

                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                                    3. unpow2N/A

                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                                    4. *-lowering-*.f6431.6%

                                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(re, 1\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                                  8. Simplified31.6%

                                    \[\leadsto \left(re + 1\right) \cdot \color{blue}{\left(1 + -0.5 \cdot \left(im \cdot im\right)\right)} \]
                                  9. Taylor expanded in re around inf

                                    \[\leadsto \color{blue}{re \cdot \left(1 + \frac{-1}{2} \cdot {im}^{2}\right)} \]
                                  10. Step-by-step derivation
                                    1. *-lowering-*.f64N/A

                                      \[\leadsto \mathsf{*.f64}\left(re, \color{blue}{\left(1 + \frac{-1}{2} \cdot {im}^{2}\right)}\right) \]
                                    2. +-lowering-+.f64N/A

                                      \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                                    3. *-lowering-*.f64N/A

                                      \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                                    4. unpow2N/A

                                      \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                                    5. *-lowering-*.f6431.6%

                                      \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right) \]
                                  11. Simplified31.6%

                                    \[\leadsto \color{blue}{re \cdot \left(1 + -0.5 \cdot \left(im \cdot im\right)\right)} \]
                                8. Recombined 2 regimes into one program.
                                9. Add Preprocessing

                                Alternative 24: 31.2% accurate, 16.9× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 1.7 \cdot 10^{-174}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;1 + -0.5 \cdot \left(im \cdot im\right)\\ \end{array} \end{array} \]
                                (FPCore (re im)
                                 :precision binary64
                                 (if (<= re 1.7e-174) 1.0 (+ 1.0 (* -0.5 (* im im)))))
                                double code(double re, double im) {
                                	double tmp;
                                	if (re <= 1.7e-174) {
                                		tmp = 1.0;
                                	} else {
                                		tmp = 1.0 + (-0.5 * (im * im));
                                	}
                                	return tmp;
                                }
                                
                                real(8) function code(re, im)
                                    real(8), intent (in) :: re
                                    real(8), intent (in) :: im
                                    real(8) :: tmp
                                    if (re <= 1.7d-174) then
                                        tmp = 1.0d0
                                    else
                                        tmp = 1.0d0 + ((-0.5d0) * (im * im))
                                    end if
                                    code = tmp
                                end function
                                
                                public static double code(double re, double im) {
                                	double tmp;
                                	if (re <= 1.7e-174) {
                                		tmp = 1.0;
                                	} else {
                                		tmp = 1.0 + (-0.5 * (im * im));
                                	}
                                	return tmp;
                                }
                                
                                def code(re, im):
                                	tmp = 0
                                	if re <= 1.7e-174:
                                		tmp = 1.0
                                	else:
                                		tmp = 1.0 + (-0.5 * (im * im))
                                	return tmp
                                
                                function code(re, im)
                                	tmp = 0.0
                                	if (re <= 1.7e-174)
                                		tmp = 1.0;
                                	else
                                		tmp = Float64(1.0 + Float64(-0.5 * Float64(im * im)));
                                	end
                                	return tmp
                                end
                                
                                function tmp_2 = code(re, im)
                                	tmp = 0.0;
                                	if (re <= 1.7e-174)
                                		tmp = 1.0;
                                	else
                                		tmp = 1.0 + (-0.5 * (im * im));
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[re_, im_] := If[LessEqual[re, 1.7e-174], 1.0, N[(1.0 + N[(-0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;re \leq 1.7 \cdot 10^{-174}:\\
                                \;\;\;\;1\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;1 + -0.5 \cdot \left(im \cdot im\right)\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if re < 1.7000000000000001e-174

                                  1. Initial program 100.0%

                                    \[e^{re} \cdot \cos im \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in im around 0

                                    \[\leadsto \color{blue}{e^{re}} \]
                                  4. Step-by-step derivation
                                    1. exp-lowering-exp.f6473.5%

                                      \[\leadsto \mathsf{exp.f64}\left(re\right) \]
                                  5. Simplified73.5%

                                    \[\leadsto \color{blue}{e^{re}} \]
                                  6. Taylor expanded in re around 0

                                    \[\leadsto \color{blue}{1} \]
                                  7. Step-by-step derivation
                                    1. Simplified27.0%

                                      \[\leadsto \color{blue}{1} \]

                                    if 1.7000000000000001e-174 < re

                                    1. Initial program 100.0%

                                      \[e^{re} \cdot \cos im \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in re around 0

                                      \[\leadsto \color{blue}{\cos im} \]
                                    4. Step-by-step derivation
                                      1. cos-lowering-cos.f6432.4%

                                        \[\leadsto \mathsf{cos.f64}\left(im\right) \]
                                    5. Simplified32.4%

                                      \[\leadsto \color{blue}{\cos im} \]
                                    6. Taylor expanded in im around 0

                                      \[\leadsto \color{blue}{1 + \frac{-1}{2} \cdot {im}^{2}} \]
                                    7. Step-by-step derivation
                                      1. +-lowering-+.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{2} \cdot {im}^{2}\right)}\right) \]
                                      2. *-lowering-*.f64N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right) \]
                                      3. unpow2N/A

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right) \]
                                      4. *-lowering-*.f6430.6%

                                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right) \]
                                    8. Simplified30.6%

                                      \[\leadsto \color{blue}{1 + -0.5 \cdot \left(im \cdot im\right)} \]
                                  8. Recombined 2 regimes into one program.
                                  9. Add Preprocessing

                                  Alternative 25: 28.8% accurate, 67.7× speedup?

                                  \[\begin{array}{l} \\ re + 1 \end{array} \]
                                  (FPCore (re im) :precision binary64 (+ re 1.0))
                                  double code(double re, double im) {
                                  	return re + 1.0;
                                  }
                                  
                                  real(8) function code(re, im)
                                      real(8), intent (in) :: re
                                      real(8), intent (in) :: im
                                      code = re + 1.0d0
                                  end function
                                  
                                  public static double code(double re, double im) {
                                  	return re + 1.0;
                                  }
                                  
                                  def code(re, im):
                                  	return re + 1.0
                                  
                                  function code(re, im)
                                  	return Float64(re + 1.0)
                                  end
                                  
                                  function tmp = code(re, im)
                                  	tmp = re + 1.0;
                                  end
                                  
                                  code[re_, im_] := N[(re + 1.0), $MachinePrecision]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  re + 1
                                  \end{array}
                                  
                                  Derivation
                                  1. Initial program 100.0%

                                    \[e^{re} \cdot \cos im \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in im around 0

                                    \[\leadsto \color{blue}{e^{re}} \]
                                  4. Step-by-step derivation
                                    1. exp-lowering-exp.f6471.1%

                                      \[\leadsto \mathsf{exp.f64}\left(re\right) \]
                                  5. Simplified71.1%

                                    \[\leadsto \color{blue}{e^{re}} \]
                                  6. Taylor expanded in re around 0

                                    \[\leadsto \color{blue}{1 + re} \]
                                  7. Step-by-step derivation
                                    1. +-lowering-+.f6424.1%

                                      \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{re}\right) \]
                                  8. Simplified24.1%

                                    \[\leadsto \color{blue}{1 + re} \]
                                  9. Final simplification24.1%

                                    \[\leadsto re + 1 \]
                                  10. Add Preprocessing

                                  Alternative 26: 28.3% accurate, 203.0× speedup?

                                  \[\begin{array}{l} \\ 1 \end{array} \]
                                  (FPCore (re im) :precision binary64 1.0)
                                  double code(double re, double im) {
                                  	return 1.0;
                                  }
                                  
                                  real(8) function code(re, im)
                                      real(8), intent (in) :: re
                                      real(8), intent (in) :: im
                                      code = 1.0d0
                                  end function
                                  
                                  public static double code(double re, double im) {
                                  	return 1.0;
                                  }
                                  
                                  def code(re, im):
                                  	return 1.0
                                  
                                  function code(re, im)
                                  	return 1.0
                                  end
                                  
                                  function tmp = code(re, im)
                                  	tmp = 1.0;
                                  end
                                  
                                  code[re_, im_] := 1.0
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  1
                                  \end{array}
                                  
                                  Derivation
                                  1. Initial program 100.0%

                                    \[e^{re} \cdot \cos im \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in im around 0

                                    \[\leadsto \color{blue}{e^{re}} \]
                                  4. Step-by-step derivation
                                    1. exp-lowering-exp.f6471.1%

                                      \[\leadsto \mathsf{exp.f64}\left(re\right) \]
                                  5. Simplified71.1%

                                    \[\leadsto \color{blue}{e^{re}} \]
                                  6. Taylor expanded in re around 0

                                    \[\leadsto \color{blue}{1} \]
                                  7. Step-by-step derivation
                                    1. Simplified23.9%

                                      \[\leadsto \color{blue}{1} \]
                                    2. Add Preprocessing

                                    Reproduce

                                    ?
                                    herbie shell --seed 2024138 
                                    (FPCore (re im)
                                      :name "math.exp on complex, real part"
                                      :precision binary64
                                      (* (exp re) (cos im)))