math.cos on complex, real part

Percentage Accurate: 100.0% → 100.0%
Time: 12.5s
Alternatives: 29
Speedup: 1.5×

Specification

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

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

\\
\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\end{array}

Alternative 1: 100.0% accurate, 1.5× speedup?

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

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

    \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. *-commutativeN/A

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(e^{im} + e^{\mathsf{neg}\left(im\right)}\right)\right), \cos re\right) \]
    6. cosh-undefN/A

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \cosh im\right), \cos \color{blue}{re}\right) \]
    10. cosh-lowering-cosh.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \mathsf{cosh.f64}\left(im\right)\right), \cos re\right) \]
    11. cos-lowering-cos.f64100.0%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \mathsf{cosh.f64}\left(im\right)\right), \mathsf{cos.f64}\left(re\right)\right) \]
  4. Applied egg-rr100.0%

    \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right) \cdot \cos re} \]
  5. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(1 \cdot \cosh im\right), \color{blue}{\cos re}\right) \]
    2. *-lft-identityN/A

      \[\leadsto \mathsf{*.f64}\left(\cosh im, \cos \color{blue}{re}\right) \]
    3. cosh-lowering-cosh.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cosh.f64}\left(im\right), \cos \color{blue}{re}\right) \]
    4. cos-lowering-cos.f64100.0%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cosh.f64}\left(im\right), \mathsf{cos.f64}\left(re\right)\right) \]
  6. Applied egg-rr100.0%

    \[\leadsto \color{blue}{\cosh im \cdot \cos re} \]
  7. Final simplification100.0%

    \[\leadsto \cos re \cdot \cosh im \]
  8. Add Preprocessing

Alternative 2: 94.8% accurate, 2.4× speedup?

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

\\
\begin{array}{l}
t_0 := 0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\\
\mathbf{if}\;im \leq 235:\\
\;\;\;\;\cos re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot t\_0\right)\right)\right)\right)\\

\mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\
\;\;\;\;\cosh im\\

\mathbf{else}:\\
\;\;\;\;\cos re \cdot \left(1 + t\_0 \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < 235

    1. Initial program 100.0%

      \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(e^{im} + e^{\mathsf{neg}\left(im\right)}\right)\right), \cos re\right) \]
      6. cosh-undefN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \cosh im\right), \cos \color{blue}{re}\right) \]
      10. cosh-lowering-cosh.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \mathsf{cosh.f64}\left(im\right)\right), \cos re\right) \]
      11. cos-lowering-cos.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \mathsf{cosh.f64}\left(im\right)\right), \mathsf{cos.f64}\left(re\right)\right) \]
    4. Applied egg-rr100.0%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{2} + {im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)}, \mathsf{cos.f64}\left(re\right)\right) \]
    6. Simplified93.2%

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

    if 235 < im < 4.6000000000000001e51

    1. Initial program 100.0%

      \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(e^{im} + e^{\mathsf{neg}\left(im\right)}\right)\right), \cos re\right) \]
      6. cosh-undefN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \cosh im\right), \cos \color{blue}{re}\right) \]
      10. cosh-lowering-cosh.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \mathsf{cosh.f64}\left(im\right)\right), \cos re\right) \]
      11. cos-lowering-cos.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \mathsf{cosh.f64}\left(im\right)\right), \mathsf{cos.f64}\left(re\right)\right) \]
    4. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right) \cdot \cos re} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(1 \cdot \cosh im\right), \color{blue}{\cos re}\right) \]
      2. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\cosh im, \cos \color{blue}{re}\right) \]
      3. cosh-lowering-cosh.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cosh.f64}\left(im\right), \cos \color{blue}{re}\right) \]
      4. cos-lowering-cos.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cosh.f64}\left(im\right), \mathsf{cos.f64}\left(re\right)\right) \]
    6. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\cosh im \cdot \cos re} \]
    7. Taylor expanded in re around 0

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cosh.f64}\left(im\right), \color{blue}{1}\right) \]
    8. Step-by-step derivation
      1. Simplified86.7%

        \[\leadsto \cosh im \cdot \color{blue}{1} \]

      if 4.6000000000000001e51 < im

      1. Initial program 100.0%

        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
      2. Add Preprocessing
      3. Taylor expanded in im around 0

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

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

          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
        3. distribute-lft-inN/A

          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
        4. associate-+l+N/A

          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
      5. Simplified100.0%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{720}\right)\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, im\right)\right)\right)\right), \color{blue}{1}\right)\right) \]
      7. Step-by-step derivation
        1. Simplified100.0%

          \[\leadsto \cos re \cdot \left(\left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \color{blue}{1}\right) \]
      8. Recombined 3 regimes into one program.
      9. Final simplification94.1%

        \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 235:\\ \;\;\;\;\cos re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\right)\\ \mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\ \;\;\;\;\cosh im\\ \mathbf{else}:\\ \;\;\;\;\cos re \cdot \left(1 + \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\right)\\ \end{array} \]
      10. Add Preprocessing

      Alternative 3: 74.1% accurate, 2.4× speedup?

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

        1. Initial program 100.0%

          \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
        2. Add Preprocessing
        3. Taylor expanded in im around 0

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

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

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

        if 3.7e-9 < im < 4.6000000000000001e51

        1. Initial program 99.9%

          \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. *-commutativeN/A

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(e^{im} + e^{\mathsf{neg}\left(im\right)}\right)\right), \cos re\right) \]
          6. cosh-undefN/A

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \cosh im\right), \cos \color{blue}{re}\right) \]
          10. cosh-lowering-cosh.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \mathsf{cosh.f64}\left(im\right)\right), \cos re\right) \]
          11. cos-lowering-cos.f6499.9%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \mathsf{cosh.f64}\left(im\right)\right), \mathsf{cos.f64}\left(re\right)\right) \]
        4. Applied egg-rr99.9%

          \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right) \cdot \cos re} \]
        5. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(1 \cdot \cosh im\right), \color{blue}{\cos re}\right) \]
          2. *-lft-identityN/A

            \[\leadsto \mathsf{*.f64}\left(\cosh im, \cos \color{blue}{re}\right) \]
          3. cosh-lowering-cosh.f64N/A

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

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

          \[\leadsto \color{blue}{\cosh im \cdot \cos re} \]
        7. Taylor expanded in re around 0

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

            \[\leadsto \cosh im \cdot \color{blue}{1} \]

          if 4.6000000000000001e51 < im

          1. Initial program 100.0%

            \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
          2. Add Preprocessing
          3. Taylor expanded in im around 0

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

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

              \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
            3. distribute-lft-inN/A

              \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
            4. associate-+l+N/A

              \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
          5. Simplified100.0%

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{720}\right)\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, im\right)\right)\right)\right), \color{blue}{1}\right)\right) \]
          7. Step-by-step derivation
            1. Simplified100.0%

              \[\leadsto \cos re \cdot \left(\left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \color{blue}{1}\right) \]
          8. Recombined 3 regimes into one program.
          9. Final simplification71.5%

            \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\ \;\;\;\;\cos re\\ \mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\ \;\;\;\;\cosh im\\ \mathbf{else}:\\ \;\;\;\;\cos re \cdot \left(1 + \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\right)\\ \end{array} \]
          10. Add Preprocessing

          Alternative 4: 73.6% accurate, 2.5× speedup?

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

            1. Initial program 100.0%

              \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
            2. Add Preprocessing
            3. Taylor expanded in im around 0

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

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

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

            if 3.7e-9 < im < 1.4e77

            1. Initial program 99.9%

              \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. *-commutativeN/A

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(e^{im} + e^{\mathsf{neg}\left(im\right)}\right)\right), \cos re\right) \]
              6. cosh-undefN/A

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \cosh im\right), \cos \color{blue}{re}\right) \]
              10. cosh-lowering-cosh.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \mathsf{cosh.f64}\left(im\right)\right), \cos re\right) \]
              11. cos-lowering-cos.f6499.9%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \mathsf{cosh.f64}\left(im\right)\right), \mathsf{cos.f64}\left(re\right)\right) \]
            4. Applied egg-rr99.9%

              \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right) \cdot \cos re} \]
            5. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\left(1 \cdot \cosh im\right), \color{blue}{\cos re}\right) \]
              2. *-lft-identityN/A

                \[\leadsto \mathsf{*.f64}\left(\cosh im, \cos \color{blue}{re}\right) \]
              3. cosh-lowering-cosh.f64N/A

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

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

              \[\leadsto \color{blue}{\cosh im \cdot \cos re} \]
            7. Taylor expanded in re around 0

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

                \[\leadsto \cosh im \cdot \color{blue}{1} \]

              if 1.4e77 < im

              1. Initial program 100.0%

                \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
              2. Add Preprocessing
              3. Taylor expanded in im around 0

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

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

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

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

                  \[\leadsto \left(\cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \cos re\right) + {im}^{\color{blue}{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                5. distribute-rgt1-inN/A

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

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

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

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

                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(\frac{1}{2} \cdot im\right)\right) \cdot \cos re \]
                10. distribute-rgt-outN/A

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

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

                  \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(im \cdot \left(\frac{1}{2} \cdot im\right) + \color{blue}{1}\right)\right) \]
              5. Simplified100.0%

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\ \;\;\;\;\cos re\\ \mathbf{elif}\;im \leq 1.4 \cdot 10^{+77}:\\ \;\;\;\;\cosh im\\ \mathbf{else}:\\ \;\;\;\;\cos re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right)\\ \end{array} \]
            11. Add Preprocessing

            Alternative 5: 73.6% accurate, 2.5× speedup?

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

              1. Initial program 100.0%

                \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
              2. Add Preprocessing
              3. Taylor expanded in im around 0

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

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

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

              if 3.7e-9 < im < 1.4e77

              1. Initial program 99.9%

                \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. *-commutativeN/A

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(e^{im} + e^{\mathsf{neg}\left(im\right)}\right)\right), \cos re\right) \]
                6. cosh-undefN/A

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \cosh im\right), \cos \color{blue}{re}\right) \]
                10. cosh-lowering-cosh.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \mathsf{cosh.f64}\left(im\right)\right), \cos re\right) \]
                11. cos-lowering-cos.f6499.9%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \mathsf{cosh.f64}\left(im\right)\right), \mathsf{cos.f64}\left(re\right)\right) \]
              4. Applied egg-rr99.9%

                \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right) \cdot \cos re} \]
              5. Step-by-step derivation
                1. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(\left(1 \cdot \cosh im\right), \color{blue}{\cos re}\right) \]
                2. *-lft-identityN/A

                  \[\leadsto \mathsf{*.f64}\left(\cosh im, \cos \color{blue}{re}\right) \]
                3. cosh-lowering-cosh.f64N/A

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

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

                \[\leadsto \color{blue}{\cosh im \cdot \cos re} \]
              7. Taylor expanded in re around 0

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

                  \[\leadsto \cosh im \cdot \color{blue}{1} \]

                if 1.4e77 < im

                1. Initial program 100.0%

                  \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                2. Add Preprocessing
                3. Taylor expanded in im around 0

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

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

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

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

                    \[\leadsto \left(\cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \cos re\right) + {im}^{\color{blue}{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                  5. distribute-rgt1-inN/A

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

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

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

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

                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(\frac{1}{2} \cdot im\right)\right) \cdot \cos re \]
                  10. distribute-rgt-outN/A

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

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

                    \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(im \cdot \left(\frac{1}{2} \cdot im\right) + \color{blue}{1}\right)\right) \]
                5. Simplified100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\ \;\;\;\;\cos re\\ \mathbf{elif}\;im \leq 1.4 \cdot 10^{+77}:\\ \;\;\;\;\cosh im\\ \mathbf{else}:\\ \;\;\;\;\cos re \cdot \left(1 + im \cdot \left(im \cdot \left(0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right)\right)\\ \end{array} \]
              11. Add Preprocessing

              Alternative 6: 73.6% accurate, 2.5× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\ \;\;\;\;\cos re\\ \mathbf{elif}\;im \leq 1.4 \cdot 10^{+77}:\\ \;\;\;\;\cosh im\\ \mathbf{else}:\\ \;\;\;\;\cos re \cdot \left(im \cdot \left(im \cdot \left(0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right)\right)\\ \end{array} \end{array} \]
              (FPCore (re im)
               :precision binary64
               (if (<= im 3.7e-9)
                 (cos re)
                 (if (<= im 1.4e+77)
                   (cosh im)
                   (* (cos re) (* im (* im (* 0.041666666666666664 (* im im))))))))
              double code(double re, double im) {
              	double tmp;
              	if (im <= 3.7e-9) {
              		tmp = cos(re);
              	} else if (im <= 1.4e+77) {
              		tmp = cosh(im);
              	} else {
              		tmp = cos(re) * (im * (im * (0.041666666666666664 * (im * im))));
              	}
              	return tmp;
              }
              
              real(8) function code(re, im)
                  real(8), intent (in) :: re
                  real(8), intent (in) :: im
                  real(8) :: tmp
                  if (im <= 3.7d-9) then
                      tmp = cos(re)
                  else if (im <= 1.4d+77) then
                      tmp = cosh(im)
                  else
                      tmp = cos(re) * (im * (im * (0.041666666666666664d0 * (im * im))))
                  end if
                  code = tmp
              end function
              
              public static double code(double re, double im) {
              	double tmp;
              	if (im <= 3.7e-9) {
              		tmp = Math.cos(re);
              	} else if (im <= 1.4e+77) {
              		tmp = Math.cosh(im);
              	} else {
              		tmp = Math.cos(re) * (im * (im * (0.041666666666666664 * (im * im))));
              	}
              	return tmp;
              }
              
              def code(re, im):
              	tmp = 0
              	if im <= 3.7e-9:
              		tmp = math.cos(re)
              	elif im <= 1.4e+77:
              		tmp = math.cosh(im)
              	else:
              		tmp = math.cos(re) * (im * (im * (0.041666666666666664 * (im * im))))
              	return tmp
              
              function code(re, im)
              	tmp = 0.0
              	if (im <= 3.7e-9)
              		tmp = cos(re);
              	elseif (im <= 1.4e+77)
              		tmp = cosh(im);
              	else
              		tmp = Float64(cos(re) * Float64(im * Float64(im * Float64(0.041666666666666664 * Float64(im * im)))));
              	end
              	return tmp
              end
              
              function tmp_2 = code(re, im)
              	tmp = 0.0;
              	if (im <= 3.7e-9)
              		tmp = cos(re);
              	elseif (im <= 1.4e+77)
              		tmp = cosh(im);
              	else
              		tmp = cos(re) * (im * (im * (0.041666666666666664 * (im * im))));
              	end
              	tmp_2 = tmp;
              end
              
              code[re_, im_] := If[LessEqual[im, 3.7e-9], N[Cos[re], $MachinePrecision], If[LessEqual[im, 1.4e+77], N[Cosh[im], $MachinePrecision], N[(N[Cos[re], $MachinePrecision] * N[(im * N[(im * N[(0.041666666666666664 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\
              \;\;\;\;\cos re\\
              
              \mathbf{elif}\;im \leq 1.4 \cdot 10^{+77}:\\
              \;\;\;\;\cosh im\\
              
              \mathbf{else}:\\
              \;\;\;\;\cos re \cdot \left(im \cdot \left(im \cdot \left(0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right)\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if im < 3.7e-9

                1. Initial program 100.0%

                  \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                2. Add Preprocessing
                3. Taylor expanded in im around 0

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

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

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

                if 3.7e-9 < im < 1.4e77

                1. Initial program 99.9%

                  \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. *-commutativeN/A

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(e^{im} + e^{\mathsf{neg}\left(im\right)}\right)\right), \cos re\right) \]
                  6. cosh-undefN/A

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \cosh im\right), \cos \color{blue}{re}\right) \]
                  10. cosh-lowering-cosh.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \mathsf{cosh.f64}\left(im\right)\right), \cos re\right) \]
                  11. cos-lowering-cos.f6499.9%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \mathsf{cosh.f64}\left(im\right)\right), \mathsf{cos.f64}\left(re\right)\right) \]
                4. Applied egg-rr99.9%

                  \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right) \cdot \cos re} \]
                5. Step-by-step derivation
                  1. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\left(1 \cdot \cosh im\right), \color{blue}{\cos re}\right) \]
                  2. *-lft-identityN/A

                    \[\leadsto \mathsf{*.f64}\left(\cosh im, \cos \color{blue}{re}\right) \]
                  3. cosh-lowering-cosh.f64N/A

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

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

                  \[\leadsto \color{blue}{\cosh im \cdot \cos re} \]
                7. Taylor expanded in re around 0

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

                    \[\leadsto \cosh im \cdot \color{blue}{1} \]

                  if 1.4e77 < im

                  1. Initial program 100.0%

                    \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                  2. Add Preprocessing
                  3. Taylor expanded in im around 0

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

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

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

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

                      \[\leadsto \left(\cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \cos re\right) + {im}^{\color{blue}{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                    5. distribute-rgt1-inN/A

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

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

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

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

                      \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(\frac{1}{2} \cdot im\right)\right) \cdot \cos re \]
                    10. distribute-rgt-outN/A

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

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

                      \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(im \cdot \left(\frac{1}{2} \cdot im\right) + \color{blue}{1}\right)\right) \]
                  5. Simplified100.0%

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

                    \[\leadsto \color{blue}{\frac{1}{24} \cdot \left({im}^{4} \cdot \cos re\right)} \]
                  7. Step-by-step derivation
                    1. associate-*r*N/A

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

                      \[\leadsto \cos re \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{4}\right)} \]
                    3. metadata-evalN/A

                      \[\leadsto \cos re \cdot \left(\frac{1}{24} \cdot {im}^{\left(2 \cdot \color{blue}{2}\right)}\right) \]
                    4. pow-sqrN/A

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right) \]
                    16. *-lowering-*.f64100.0%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right) \]
                  8. Simplified100.0%

                    \[\leadsto \color{blue}{\cos re \cdot \left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)} \]
                9. Recombined 3 regimes into one program.
                10. Final simplification69.9%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\ \;\;\;\;\cos re\\ \mathbf{elif}\;im \leq 1.4 \cdot 10^{+77}:\\ \;\;\;\;\cosh im\\ \mathbf{else}:\\ \;\;\;\;\cos re \cdot \left(im \cdot \left(im \cdot \left(0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right)\right)\\ \end{array} \]
                11. Add Preprocessing

                Alternative 7: 71.9% accurate, 2.6× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\ \;\;\;\;\cos re\\ \mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\cosh im\\ \mathbf{else}:\\ \;\;\;\;\cos re \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\\ \end{array} \end{array} \]
                (FPCore (re im)
                 :precision binary64
                 (if (<= im 3.7e-9)
                   (cos re)
                   (if (<= im 1.35e+154) (cosh im) (* (cos re) (* 0.5 (* im im))))))
                double code(double re, double im) {
                	double tmp;
                	if (im <= 3.7e-9) {
                		tmp = cos(re);
                	} else if (im <= 1.35e+154) {
                		tmp = cosh(im);
                	} else {
                		tmp = cos(re) * (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 (im <= 3.7d-9) then
                        tmp = cos(re)
                    else if (im <= 1.35d+154) then
                        tmp = cosh(im)
                    else
                        tmp = cos(re) * (0.5d0 * (im * im))
                    end if
                    code = tmp
                end function
                
                public static double code(double re, double im) {
                	double tmp;
                	if (im <= 3.7e-9) {
                		tmp = Math.cos(re);
                	} else if (im <= 1.35e+154) {
                		tmp = Math.cosh(im);
                	} else {
                		tmp = Math.cos(re) * (0.5 * (im * im));
                	}
                	return tmp;
                }
                
                def code(re, im):
                	tmp = 0
                	if im <= 3.7e-9:
                		tmp = math.cos(re)
                	elif im <= 1.35e+154:
                		tmp = math.cosh(im)
                	else:
                		tmp = math.cos(re) * (0.5 * (im * im))
                	return tmp
                
                function code(re, im)
                	tmp = 0.0
                	if (im <= 3.7e-9)
                		tmp = cos(re);
                	elseif (im <= 1.35e+154)
                		tmp = cosh(im);
                	else
                		tmp = Float64(cos(re) * Float64(0.5 * Float64(im * im)));
                	end
                	return tmp
                end
                
                function tmp_2 = code(re, im)
                	tmp = 0.0;
                	if (im <= 3.7e-9)
                		tmp = cos(re);
                	elseif (im <= 1.35e+154)
                		tmp = cosh(im);
                	else
                		tmp = cos(re) * (0.5 * (im * im));
                	end
                	tmp_2 = tmp;
                end
                
                code[re_, im_] := If[LessEqual[im, 3.7e-9], N[Cos[re], $MachinePrecision], If[LessEqual[im, 1.35e+154], N[Cosh[im], $MachinePrecision], N[(N[Cos[re], $MachinePrecision] * N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\
                \;\;\;\;\cos re\\
                
                \mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
                \;\;\;\;\cosh im\\
                
                \mathbf{else}:\\
                \;\;\;\;\cos re \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if im < 3.7e-9

                  1. Initial program 100.0%

                    \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                  2. Add Preprocessing
                  3. Taylor expanded in im around 0

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

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

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

                  if 3.7e-9 < im < 1.35000000000000003e154

                  1. Initial program 100.0%

                    \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                  2. Add Preprocessing
                  3. Step-by-step derivation
                    1. *-commutativeN/A

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

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(e^{im} + e^{\mathsf{neg}\left(im\right)}\right)\right), \cos re\right) \]
                    6. cosh-undefN/A

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \cosh im\right), \cos \color{blue}{re}\right) \]
                    10. cosh-lowering-cosh.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \mathsf{cosh.f64}\left(im\right)\right), \cos re\right) \]
                    11. cos-lowering-cos.f64100.0%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \mathsf{cosh.f64}\left(im\right)\right), \mathsf{cos.f64}\left(re\right)\right) \]
                  4. Applied egg-rr100.0%

                    \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right) \cdot \cos re} \]
                  5. Step-by-step derivation
                    1. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\left(1 \cdot \cosh im\right), \color{blue}{\cos re}\right) \]
                    2. *-lft-identityN/A

                      \[\leadsto \mathsf{*.f64}\left(\cosh im, \cos \color{blue}{re}\right) \]
                    3. cosh-lowering-cosh.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{cosh.f64}\left(im\right), \cos \color{blue}{re}\right) \]
                    4. cos-lowering-cos.f64100.0%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{cosh.f64}\left(im\right), \mathsf{cos.f64}\left(re\right)\right) \]
                  6. Applied egg-rr100.0%

                    \[\leadsto \color{blue}{\cosh im \cdot \cos re} \]
                  7. Taylor expanded in re around 0

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

                      \[\leadsto \cosh im \cdot \color{blue}{1} \]

                    if 1.35000000000000003e154 < im

                    1. Initial program 100.0%

                      \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in im around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.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. Simplified100.0%

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\ \;\;\;\;\cos re\\ \mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\cosh im\\ \mathbf{else}:\\ \;\;\;\;\cos re \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\\ \end{array} \]
                  11. Add Preprocessing

                  Alternative 8: 68.9% accurate, 2.8× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\ \;\;\;\;\cos re\\ \mathbf{elif}\;im \leq 2 \cdot 10^{+132}:\\ \;\;\;\;\cosh im\\ \mathbf{else}:\\ \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\ \end{array} \end{array} \]
                  (FPCore (re im)
                   :precision binary64
                   (if (<= im 3.7e-9)
                     (cos re)
                     (if (<= im 2e+132)
                       (cosh im)
                       (*
                        (* (* im im) (* im im))
                        (+ 0.041666666666666664 (* (* re re) -0.020833333333333332))))))
                  double code(double re, double im) {
                  	double tmp;
                  	if (im <= 3.7e-9) {
                  		tmp = cos(re);
                  	} else if (im <= 2e+132) {
                  		tmp = cosh(im);
                  	} else {
                  		tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(re, im)
                      real(8), intent (in) :: re
                      real(8), intent (in) :: im
                      real(8) :: tmp
                      if (im <= 3.7d-9) then
                          tmp = cos(re)
                      else if (im <= 2d+132) then
                          tmp = cosh(im)
                      else
                          tmp = ((im * im) * (im * im)) * (0.041666666666666664d0 + ((re * re) * (-0.020833333333333332d0)))
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double re, double im) {
                  	double tmp;
                  	if (im <= 3.7e-9) {
                  		tmp = Math.cos(re);
                  	} else if (im <= 2e+132) {
                  		tmp = Math.cosh(im);
                  	} else {
                  		tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
                  	}
                  	return tmp;
                  }
                  
                  def code(re, im):
                  	tmp = 0
                  	if im <= 3.7e-9:
                  		tmp = math.cos(re)
                  	elif im <= 2e+132:
                  		tmp = math.cosh(im)
                  	else:
                  		tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332))
                  	return tmp
                  
                  function code(re, im)
                  	tmp = 0.0
                  	if (im <= 3.7e-9)
                  		tmp = cos(re);
                  	elseif (im <= 2e+132)
                  		tmp = cosh(im);
                  	else
                  		tmp = Float64(Float64(Float64(im * im) * Float64(im * im)) * Float64(0.041666666666666664 + Float64(Float64(re * re) * -0.020833333333333332)));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(re, im)
                  	tmp = 0.0;
                  	if (im <= 3.7e-9)
                  		tmp = cos(re);
                  	elseif (im <= 2e+132)
                  		tmp = cosh(im);
                  	else
                  		tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[re_, im_] := If[LessEqual[im, 3.7e-9], N[Cos[re], $MachinePrecision], If[LessEqual[im, 2e+132], N[Cosh[im], $MachinePrecision], N[(N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(re * re), $MachinePrecision] * -0.020833333333333332), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\
                  \;\;\;\;\cos re\\
                  
                  \mathbf{elif}\;im \leq 2 \cdot 10^{+132}:\\
                  \;\;\;\;\cosh im\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if im < 3.7e-9

                    1. Initial program 100.0%

                      \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in im around 0

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

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

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

                    if 3.7e-9 < im < 1.99999999999999998e132

                    1. Initial program 100.0%

                      \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                    2. Add Preprocessing
                    3. Step-by-step derivation
                      1. *-commutativeN/A

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

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

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

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

                        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(e^{im} + e^{\mathsf{neg}\left(im\right)}\right)\right), \cos re\right) \]
                      6. cosh-undefN/A

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

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

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

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \cosh im\right), \cos \color{blue}{re}\right) \]
                      10. cosh-lowering-cosh.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \mathsf{cosh.f64}\left(im\right)\right), \cos re\right) \]
                      11. cos-lowering-cos.f64100.0%

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \mathsf{cosh.f64}\left(im\right)\right), \mathsf{cos.f64}\left(re\right)\right) \]
                    4. Applied egg-rr100.0%

                      \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right) \cdot \cos re} \]
                    5. Step-by-step derivation
                      1. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\left(1 \cdot \cosh im\right), \color{blue}{\cos re}\right) \]
                      2. *-lft-identityN/A

                        \[\leadsto \mathsf{*.f64}\left(\cosh im, \cos \color{blue}{re}\right) \]
                      3. cosh-lowering-cosh.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{cosh.f64}\left(im\right), \cos \color{blue}{re}\right) \]
                      4. cos-lowering-cos.f64100.0%

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{cosh.f64}\left(im\right), \mathsf{cos.f64}\left(re\right)\right) \]
                    6. Applied egg-rr100.0%

                      \[\leadsto \color{blue}{\cosh im \cdot \cos re} \]
                    7. Taylor expanded in re around 0

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

                        \[\leadsto \cosh im \cdot \color{blue}{1} \]

                      if 1.99999999999999998e132 < im

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

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

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

                          \[\leadsto \left(\cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \cos re\right) + {im}^{\color{blue}{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        5. distribute-rgt1-inN/A

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

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

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

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

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(\frac{1}{2} \cdot im\right)\right) \cdot \cos re \]
                        10. distribute-rgt-outN/A

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

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

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(im \cdot \left(\frac{1}{2} \cdot im\right) + \color{blue}{1}\right)\right) \]
                      5. Simplified100.0%

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

                        \[\leadsto \color{blue}{\frac{1}{24} \cdot \left({im}^{4} \cdot \cos re\right)} \]
                      7. Step-by-step derivation
                        1. associate-*r*N/A

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

                          \[\leadsto \cos re \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{4}\right)} \]
                        3. metadata-evalN/A

                          \[\leadsto \cos re \cdot \left(\frac{1}{24} \cdot {im}^{\left(2 \cdot \color{blue}{2}\right)}\right) \]
                        4. pow-sqrN/A

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right) \]
                        16. *-lowering-*.f64100.0%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right) \]
                      8. Simplified100.0%

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

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

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

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

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

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

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

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + {im}^{4} \cdot \color{blue}{\left({re}^{2} \cdot \frac{-1}{48}\right)} \]
                        7. distribute-lft-outN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)} \]
                    9. Recombined 3 regimes into one program.
                    10. Final simplification66.8%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\ \;\;\;\;\cos re\\ \mathbf{elif}\;im \leq 2 \cdot 10^{+132}:\\ \;\;\;\;\cosh im\\ \mathbf{else}:\\ \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\ \end{array} \]
                    11. Add Preprocessing

                    Alternative 9: 68.0% accurate, 2.9× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\\ t_1 := 0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\\ t_2 := \left(im \cdot im\right) \cdot t\_1\\ \mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\ \;\;\;\;\cos re\\ \mathbf{elif}\;im \leq 1.45 \cdot 10^{+26}:\\ \;\;\;\;\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + re \cdot \left(re \cdot 0.041666666666666664\right)\right)\right) \cdot \left(t\_0 \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)\\ \mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\ \;\;\;\;\frac{im \cdot \left(\left(im \cdot t\_1\right) \cdot t\_2\right) + -1}{t\_2 + -1}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot t\_0\right)\right)\right)\right) \cdot \left(1 + re \cdot \left(re \cdot -0.5\right)\right)\\ \end{array} \end{array} \]
                    (FPCore (re im)
                     :precision binary64
                     (let* ((t_0 (+ 0.041666666666666664 (* (* im im) 0.001388888888888889)))
                            (t_1
                             (+
                              0.5
                              (*
                               (* im im)
                               (+ 0.041666666666666664 (* im (* im 0.001388888888888889))))))
                            (t_2 (* (* im im) t_1)))
                       (if (<= im 3.7e-9)
                         (cos re)
                         (if (<= im 1.45e+26)
                           (*
                            (+ 1.0 (* (* re re) (+ -0.5 (* re (* re 0.041666666666666664)))))
                            (+ (* t_0 (* im (* im (* im im)))) (+ 1.0 (* 0.5 (* im im)))))
                           (if (<= im 4.6e+51)
                             (/ (+ (* im (* (* im t_1) t_2)) -1.0) (+ t_2 -1.0))
                             (*
                              (+ 1.0 (* im (* im (+ 0.5 (* im (* im t_0))))))
                              (+ 1.0 (* re (* re -0.5)))))))))
                    double code(double re, double im) {
                    	double t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
                    	double t_1 = 0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889))));
                    	double t_2 = (im * im) * t_1;
                    	double tmp;
                    	if (im <= 3.7e-9) {
                    		tmp = cos(re);
                    	} else if (im <= 1.45e+26) {
                    		tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_0 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im))));
                    	} else if (im <= 4.6e+51) {
                    		tmp = ((im * ((im * t_1) * t_2)) + -1.0) / (t_2 + -1.0);
                    	} else {
                    		tmp = (1.0 + (im * (im * (0.5 + (im * (im * t_0)))))) * (1.0 + (re * (re * -0.5)));
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(re, im)
                        real(8), intent (in) :: re
                        real(8), intent (in) :: im
                        real(8) :: t_0
                        real(8) :: t_1
                        real(8) :: t_2
                        real(8) :: tmp
                        t_0 = 0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)
                        t_1 = 0.5d0 + ((im * im) * (0.041666666666666664d0 + (im * (im * 0.001388888888888889d0))))
                        t_2 = (im * im) * t_1
                        if (im <= 3.7d-9) then
                            tmp = cos(re)
                        else if (im <= 1.45d+26) then
                            tmp = (1.0d0 + ((re * re) * ((-0.5d0) + (re * (re * 0.041666666666666664d0))))) * ((t_0 * (im * (im * (im * im)))) + (1.0d0 + (0.5d0 * (im * im))))
                        else if (im <= 4.6d+51) then
                            tmp = ((im * ((im * t_1) * t_2)) + (-1.0d0)) / (t_2 + (-1.0d0))
                        else
                            tmp = (1.0d0 + (im * (im * (0.5d0 + (im * (im * t_0)))))) * (1.0d0 + (re * (re * (-0.5d0))))
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double re, double im) {
                    	double t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
                    	double t_1 = 0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889))));
                    	double t_2 = (im * im) * t_1;
                    	double tmp;
                    	if (im <= 3.7e-9) {
                    		tmp = Math.cos(re);
                    	} else if (im <= 1.45e+26) {
                    		tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_0 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im))));
                    	} else if (im <= 4.6e+51) {
                    		tmp = ((im * ((im * t_1) * t_2)) + -1.0) / (t_2 + -1.0);
                    	} else {
                    		tmp = (1.0 + (im * (im * (0.5 + (im * (im * t_0)))))) * (1.0 + (re * (re * -0.5)));
                    	}
                    	return tmp;
                    }
                    
                    def code(re, im):
                    	t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889)
                    	t_1 = 0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889))))
                    	t_2 = (im * im) * t_1
                    	tmp = 0
                    	if im <= 3.7e-9:
                    		tmp = math.cos(re)
                    	elif im <= 1.45e+26:
                    		tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_0 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im))))
                    	elif im <= 4.6e+51:
                    		tmp = ((im * ((im * t_1) * t_2)) + -1.0) / (t_2 + -1.0)
                    	else:
                    		tmp = (1.0 + (im * (im * (0.5 + (im * (im * t_0)))))) * (1.0 + (re * (re * -0.5)))
                    	return tmp
                    
                    function code(re, im)
                    	t_0 = Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889))
                    	t_1 = Float64(0.5 + Float64(Float64(im * im) * Float64(0.041666666666666664 + Float64(im * Float64(im * 0.001388888888888889)))))
                    	t_2 = Float64(Float64(im * im) * t_1)
                    	tmp = 0.0
                    	if (im <= 3.7e-9)
                    		tmp = cos(re);
                    	elseif (im <= 1.45e+26)
                    		tmp = Float64(Float64(1.0 + Float64(Float64(re * re) * Float64(-0.5 + Float64(re * Float64(re * 0.041666666666666664))))) * Float64(Float64(t_0 * Float64(im * Float64(im * Float64(im * im)))) + Float64(1.0 + Float64(0.5 * Float64(im * im)))));
                    	elseif (im <= 4.6e+51)
                    		tmp = Float64(Float64(Float64(im * Float64(Float64(im * t_1) * t_2)) + -1.0) / Float64(t_2 + -1.0));
                    	else
                    		tmp = Float64(Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * t_0)))))) * Float64(1.0 + Float64(re * Float64(re * -0.5))));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(re, im)
                    	t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
                    	t_1 = 0.5 + ((im * im) * (0.041666666666666664 + (im * (im * 0.001388888888888889))));
                    	t_2 = (im * im) * t_1;
                    	tmp = 0.0;
                    	if (im <= 3.7e-9)
                    		tmp = cos(re);
                    	elseif (im <= 1.45e+26)
                    		tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_0 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im))));
                    	elseif (im <= 4.6e+51)
                    		tmp = ((im * ((im * t_1) * t_2)) + -1.0) / (t_2 + -1.0);
                    	else
                    		tmp = (1.0 + (im * (im * (0.5 + (im * (im * t_0)))))) * (1.0 + (re * (re * -0.5)));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[re_, im_] := Block[{t$95$0 = N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 + N[(N[(im * im), $MachinePrecision] * N[(0.041666666666666664 + N[(im * N[(im * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(im * im), $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[im, 3.7e-9], N[Cos[re], $MachinePrecision], If[LessEqual[im, 1.45e+26], N[(N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.5 + N[(re * N[(re * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 * N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4.6e+51], N[(N[(N[(im * N[(N[(im * t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] / N[(t$95$2 + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(re * N[(re * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := 0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\\
                    t_1 := 0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\\
                    t_2 := \left(im \cdot im\right) \cdot t\_1\\
                    \mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\
                    \;\;\;\;\cos re\\
                    
                    \mathbf{elif}\;im \leq 1.45 \cdot 10^{+26}:\\
                    \;\;\;\;\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + re \cdot \left(re \cdot 0.041666666666666664\right)\right)\right) \cdot \left(t\_0 \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)\\
                    
                    \mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\
                    \;\;\;\;\frac{im \cdot \left(\left(im \cdot t\_1\right) \cdot t\_2\right) + -1}{t\_2 + -1}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot t\_0\right)\right)\right)\right) \cdot \left(1 + re \cdot \left(re \cdot -0.5\right)\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 4 regimes
                    2. if im < 3.7e-9

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

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

                      if 3.7e-9 < im < 1.45e26

                      1. Initial program 99.8%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified16.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 1.45e26 < im < 4.6000000000000001e51

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified6.3%

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified5.6%

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

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

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

                          \[\leadsto \mathsf{/.f64}\left(\left(\left(im \cdot \left(im \cdot \left(\frac{1}{2} + im \cdot \left(im \cdot \left(\frac{1}{24} + \left(im \cdot im\right) \cdot \frac{1}{720}\right)\right)\right)\right)\right) \cdot \left(im \cdot \left(im \cdot \left(\frac{1}{2} + im \cdot \left(im \cdot \left(\frac{1}{24} + \left(im \cdot im\right) \cdot \frac{1}{720}\right)\right)\right)\right)\right) - 1 \cdot 1\right), \color{blue}{\left(im \cdot \left(im \cdot \left(\frac{1}{2} + im \cdot \left(im \cdot \left(\frac{1}{24} + \left(im \cdot im\right) \cdot \frac{1}{720}\right)\right)\right)\right) - 1\right)}\right) \]
                      10. Applied egg-rr88.9%

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

                      if 4.6000000000000001e51 < im

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified100.0%

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

                        \[\leadsto \color{blue}{1 + \left(\frac{-1}{2} \cdot \left({re}^{2} \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right) + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)} \]
                      7. Simplified75.5%

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 3.7 \cdot 10^{-9}:\\ \;\;\;\;\cos re\\ \mathbf{elif}\;im \leq 1.45 \cdot 10^{+26}:\\ \;\;\;\;\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + re \cdot \left(re \cdot 0.041666666666666664\right)\right)\right) \cdot \left(\left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)\\ \mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\ \;\;\;\;\frac{im \cdot \left(\left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\right)\right)\right) + -1}{\left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\right) + -1}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\right) \cdot \left(1 + re \cdot \left(re \cdot -0.5\right)\right)\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 10: 46.2% accurate, 5.0× speedup?

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

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified86.8%

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified55.7%

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

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

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

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

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

                      if 4.6000000000000001e51 < im

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified100.0%

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

                        \[\leadsto \color{blue}{1 + \left(\frac{-1}{2} \cdot \left({re}^{2} \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right) + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)} \]
                      7. Simplified75.5%

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 4.6 \cdot 10^{+51}:\\ \;\;\;\;\frac{im \cdot \left(\left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\right)\right)\right) + -1}{\left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\right) + -1}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\right) \cdot \left(1 + re \cdot \left(re \cdot -0.5\right)\right)\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 11: 60.5% accurate, 5.1× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\\ t_1 := \left(im \cdot im\right) \cdot t\_0\\ t_2 := 0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\\ t_3 := 1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot t\_2\right)\right)\right)\\ \mathbf{if}\;im \leq 380:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;im \leq 9.5 \cdot 10^{+30}:\\ \;\;\;\;\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + re \cdot \left(re \cdot 0.041666666666666664\right)\right)\right) \cdot \left(t\_2 \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)\\ \mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\ \;\;\;\;1 + im \cdot \frac{im \cdot \left(0.25 - \left(im \cdot im\right) \cdot \left(t\_0 \cdot t\_1\right)\right)}{0.5 - t\_1}\\ \mathbf{else}:\\ \;\;\;\;t\_3 \cdot \left(1 + re \cdot \left(re \cdot -0.5\right)\right)\\ \end{array} \end{array} \]
                    (FPCore (re im)
                     :precision binary64
                     (let* ((t_0 (+ 0.041666666666666664 (* im (* im 0.001388888888888889))))
                            (t_1 (* (* im im) t_0))
                            (t_2 (+ 0.041666666666666664 (* (* im im) 0.001388888888888889)))
                            (t_3 (+ 1.0 (* im (* im (+ 0.5 (* im (* im t_2))))))))
                       (if (<= im 380.0)
                         t_3
                         (if (<= im 9.5e+30)
                           (*
                            (+ 1.0 (* (* re re) (+ -0.5 (* re (* re 0.041666666666666664)))))
                            (+ (* t_2 (* im (* im (* im im)))) (+ 1.0 (* 0.5 (* im im)))))
                           (if (<= im 4.6e+51)
                             (+
                              1.0
                              (* im (/ (* im (- 0.25 (* (* im im) (* t_0 t_1)))) (- 0.5 t_1))))
                             (* t_3 (+ 1.0 (* re (* re -0.5)))))))))
                    double code(double re, double im) {
                    	double t_0 = 0.041666666666666664 + (im * (im * 0.001388888888888889));
                    	double t_1 = (im * im) * t_0;
                    	double t_2 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
                    	double t_3 = 1.0 + (im * (im * (0.5 + (im * (im * t_2)))));
                    	double tmp;
                    	if (im <= 380.0) {
                    		tmp = t_3;
                    	} else if (im <= 9.5e+30) {
                    		tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_2 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im))));
                    	} else if (im <= 4.6e+51) {
                    		tmp = 1.0 + (im * ((im * (0.25 - ((im * im) * (t_0 * t_1)))) / (0.5 - t_1)));
                    	} else {
                    		tmp = t_3 * (1.0 + (re * (re * -0.5)));
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(re, im)
                        real(8), intent (in) :: re
                        real(8), intent (in) :: im
                        real(8) :: t_0
                        real(8) :: t_1
                        real(8) :: t_2
                        real(8) :: t_3
                        real(8) :: tmp
                        t_0 = 0.041666666666666664d0 + (im * (im * 0.001388888888888889d0))
                        t_1 = (im * im) * t_0
                        t_2 = 0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)
                        t_3 = 1.0d0 + (im * (im * (0.5d0 + (im * (im * t_2)))))
                        if (im <= 380.0d0) then
                            tmp = t_3
                        else if (im <= 9.5d+30) then
                            tmp = (1.0d0 + ((re * re) * ((-0.5d0) + (re * (re * 0.041666666666666664d0))))) * ((t_2 * (im * (im * (im * im)))) + (1.0d0 + (0.5d0 * (im * im))))
                        else if (im <= 4.6d+51) then
                            tmp = 1.0d0 + (im * ((im * (0.25d0 - ((im * im) * (t_0 * t_1)))) / (0.5d0 - t_1)))
                        else
                            tmp = t_3 * (1.0d0 + (re * (re * (-0.5d0))))
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double re, double im) {
                    	double t_0 = 0.041666666666666664 + (im * (im * 0.001388888888888889));
                    	double t_1 = (im * im) * t_0;
                    	double t_2 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
                    	double t_3 = 1.0 + (im * (im * (0.5 + (im * (im * t_2)))));
                    	double tmp;
                    	if (im <= 380.0) {
                    		tmp = t_3;
                    	} else if (im <= 9.5e+30) {
                    		tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_2 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im))));
                    	} else if (im <= 4.6e+51) {
                    		tmp = 1.0 + (im * ((im * (0.25 - ((im * im) * (t_0 * t_1)))) / (0.5 - t_1)));
                    	} else {
                    		tmp = t_3 * (1.0 + (re * (re * -0.5)));
                    	}
                    	return tmp;
                    }
                    
                    def code(re, im):
                    	t_0 = 0.041666666666666664 + (im * (im * 0.001388888888888889))
                    	t_1 = (im * im) * t_0
                    	t_2 = 0.041666666666666664 + ((im * im) * 0.001388888888888889)
                    	t_3 = 1.0 + (im * (im * (0.5 + (im * (im * t_2)))))
                    	tmp = 0
                    	if im <= 380.0:
                    		tmp = t_3
                    	elif im <= 9.5e+30:
                    		tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_2 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im))))
                    	elif im <= 4.6e+51:
                    		tmp = 1.0 + (im * ((im * (0.25 - ((im * im) * (t_0 * t_1)))) / (0.5 - t_1)))
                    	else:
                    		tmp = t_3 * (1.0 + (re * (re * -0.5)))
                    	return tmp
                    
                    function code(re, im)
                    	t_0 = Float64(0.041666666666666664 + Float64(im * Float64(im * 0.001388888888888889)))
                    	t_1 = Float64(Float64(im * im) * t_0)
                    	t_2 = Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889))
                    	t_3 = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * t_2))))))
                    	tmp = 0.0
                    	if (im <= 380.0)
                    		tmp = t_3;
                    	elseif (im <= 9.5e+30)
                    		tmp = Float64(Float64(1.0 + Float64(Float64(re * re) * Float64(-0.5 + Float64(re * Float64(re * 0.041666666666666664))))) * Float64(Float64(t_2 * Float64(im * Float64(im * Float64(im * im)))) + Float64(1.0 + Float64(0.5 * Float64(im * im)))));
                    	elseif (im <= 4.6e+51)
                    		tmp = Float64(1.0 + Float64(im * Float64(Float64(im * Float64(0.25 - Float64(Float64(im * im) * Float64(t_0 * t_1)))) / Float64(0.5 - t_1))));
                    	else
                    		tmp = Float64(t_3 * Float64(1.0 + Float64(re * Float64(re * -0.5))));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(re, im)
                    	t_0 = 0.041666666666666664 + (im * (im * 0.001388888888888889));
                    	t_1 = (im * im) * t_0;
                    	t_2 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
                    	t_3 = 1.0 + (im * (im * (0.5 + (im * (im * t_2)))));
                    	tmp = 0.0;
                    	if (im <= 380.0)
                    		tmp = t_3;
                    	elseif (im <= 9.5e+30)
                    		tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_2 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im))));
                    	elseif (im <= 4.6e+51)
                    		tmp = 1.0 + (im * ((im * (0.25 - ((im * im) * (t_0 * t_1)))) / (0.5 - t_1)));
                    	else
                    		tmp = t_3 * (1.0 + (re * (re * -0.5)));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[re_, im_] := Block[{t$95$0 = N[(0.041666666666666664 + N[(im * N[(im * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(im * im), $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 380.0], t$95$3, If[LessEqual[im, 9.5e+30], N[(N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.5 + N[(re * N[(re * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$2 * N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4.6e+51], N[(1.0 + N[(im * N[(N[(im * N[(0.25 - N[(N[(im * im), $MachinePrecision] * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(0.5 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[(1.0 + N[(re * N[(re * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := 0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\\
                    t_1 := \left(im \cdot im\right) \cdot t\_0\\
                    t_2 := 0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\\
                    t_3 := 1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot t\_2\right)\right)\right)\\
                    \mathbf{if}\;im \leq 380:\\
                    \;\;\;\;t\_3\\
                    
                    \mathbf{elif}\;im \leq 9.5 \cdot 10^{+30}:\\
                    \;\;\;\;\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + re \cdot \left(re \cdot 0.041666666666666664\right)\right)\right) \cdot \left(t\_2 \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)\\
                    
                    \mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\
                    \;\;\;\;1 + im \cdot \frac{im \cdot \left(0.25 - \left(im \cdot im\right) \cdot \left(t\_0 \cdot t\_1\right)\right)}{0.5 - t\_1}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_3 \cdot \left(1 + re \cdot \left(re \cdot -0.5\right)\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 4 regimes
                    2. if im < 380

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified93.2%

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified59.7%

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

                      if 380 < im < 9.5000000000000003e30

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified4.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 9.5000000000000003e30 < im < 4.6000000000000001e51

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified6.7%

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified5.8%

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{/.f64}\left(\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(im \cdot \left(im \cdot \left(\frac{1}{24} + \left(im \cdot im\right) \cdot \frac{1}{720}\right)\right)\right) \cdot \left(im \cdot \left(im \cdot \left(\frac{1}{24} + \left(im \cdot im\right) \cdot \frac{1}{720}\right)\right)\right)\right) \cdot im\right), \color{blue}{\left(\frac{1}{2} - im \cdot \left(im \cdot \left(\frac{1}{24} + \left(im \cdot im\right) \cdot \frac{1}{720}\right)\right)\right)}\right)\right)\right) \]
                      10. Applied egg-rr72.2%

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

                      if 4.6000000000000001e51 < im

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified100.0%

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

                        \[\leadsto \color{blue}{1 + \left(\frac{-1}{2} \cdot \left({re}^{2} \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right) + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)} \]
                      7. Simplified75.5%

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 380:\\ \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\\ \mathbf{elif}\;im \leq 9.5 \cdot 10^{+30}:\\ \;\;\;\;\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + re \cdot \left(re \cdot 0.041666666666666664\right)\right)\right) \cdot \left(\left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)\\ \mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\ \;\;\;\;1 + im \cdot \frac{im \cdot \left(0.25 - \left(im \cdot im\right) \cdot \left(\left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\right)\right)\right)}{0.5 - \left(im \cdot im\right) \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\right) \cdot \left(1 + re \cdot \left(re \cdot -0.5\right)\right)\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 12: 60.3% accurate, 5.3× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := im \cdot \left(im \cdot im\right)\\ t_1 := 0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\\ t_2 := 1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot t\_1\right)\right)\right)\\ t_3 := im \cdot \left(im \cdot 0.001388888888888889\right)\\ \mathbf{if}\;im \leq 320:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;im \leq 9.5 \cdot 10^{+30}:\\ \;\;\;\;\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + re \cdot \left(re \cdot 0.041666666666666664\right)\right)\right) \cdot \left(t\_1 \cdot \left(im \cdot t\_0\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)\\ \mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\ \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + \frac{\left(im \cdot im\right) \cdot \left(7.233796296296296 \cdot 10^{-5} + t\_0 \cdot \left(t\_0 \cdot 2.6791838134430728 \cdot 10^{-9}\right)\right)}{0.001736111111111111 + t\_3 \cdot \left(t\_3 - 0.041666666666666664\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2 \cdot \left(1 + re \cdot \left(re \cdot -0.5\right)\right)\\ \end{array} \end{array} \]
                    (FPCore (re im)
                     :precision binary64
                     (let* ((t_0 (* im (* im im)))
                            (t_1 (+ 0.041666666666666664 (* (* im im) 0.001388888888888889)))
                            (t_2 (+ 1.0 (* im (* im (+ 0.5 (* im (* im t_1)))))))
                            (t_3 (* im (* im 0.001388888888888889))))
                       (if (<= im 320.0)
                         t_2
                         (if (<= im 9.5e+30)
                           (*
                            (+ 1.0 (* (* re re) (+ -0.5 (* re (* re 0.041666666666666664)))))
                            (+ (* t_1 (* im t_0)) (+ 1.0 (* 0.5 (* im im)))))
                           (if (<= im 4.6e+51)
                             (+
                              1.0
                              (*
                               im
                               (*
                                im
                                (+
                                 0.5
                                 (/
                                  (*
                                   (* im im)
                                   (+ 7.233796296296296e-5 (* t_0 (* t_0 2.6791838134430728e-9))))
                                  (+
                                   0.001736111111111111
                                   (* t_3 (- t_3 0.041666666666666664))))))))
                             (* t_2 (+ 1.0 (* re (* re -0.5)))))))))
                    double code(double re, double im) {
                    	double t_0 = im * (im * im);
                    	double t_1 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
                    	double t_2 = 1.0 + (im * (im * (0.5 + (im * (im * t_1)))));
                    	double t_3 = im * (im * 0.001388888888888889);
                    	double tmp;
                    	if (im <= 320.0) {
                    		tmp = t_2;
                    	} else if (im <= 9.5e+30) {
                    		tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_1 * (im * t_0)) + (1.0 + (0.5 * (im * im))));
                    	} else if (im <= 4.6e+51) {
                    		tmp = 1.0 + (im * (im * (0.5 + (((im * im) * (7.233796296296296e-5 + (t_0 * (t_0 * 2.6791838134430728e-9)))) / (0.001736111111111111 + (t_3 * (t_3 - 0.041666666666666664)))))));
                    	} else {
                    		tmp = t_2 * (1.0 + (re * (re * -0.5)));
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(re, im)
                        real(8), intent (in) :: re
                        real(8), intent (in) :: im
                        real(8) :: t_0
                        real(8) :: t_1
                        real(8) :: t_2
                        real(8) :: t_3
                        real(8) :: tmp
                        t_0 = im * (im * im)
                        t_1 = 0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)
                        t_2 = 1.0d0 + (im * (im * (0.5d0 + (im * (im * t_1)))))
                        t_3 = im * (im * 0.001388888888888889d0)
                        if (im <= 320.0d0) then
                            tmp = t_2
                        else if (im <= 9.5d+30) then
                            tmp = (1.0d0 + ((re * re) * ((-0.5d0) + (re * (re * 0.041666666666666664d0))))) * ((t_1 * (im * t_0)) + (1.0d0 + (0.5d0 * (im * im))))
                        else if (im <= 4.6d+51) then
                            tmp = 1.0d0 + (im * (im * (0.5d0 + (((im * im) * (7.233796296296296d-5 + (t_0 * (t_0 * 2.6791838134430728d-9)))) / (0.001736111111111111d0 + (t_3 * (t_3 - 0.041666666666666664d0)))))))
                        else
                            tmp = t_2 * (1.0d0 + (re * (re * (-0.5d0))))
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double re, double im) {
                    	double t_0 = im * (im * im);
                    	double t_1 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
                    	double t_2 = 1.0 + (im * (im * (0.5 + (im * (im * t_1)))));
                    	double t_3 = im * (im * 0.001388888888888889);
                    	double tmp;
                    	if (im <= 320.0) {
                    		tmp = t_2;
                    	} else if (im <= 9.5e+30) {
                    		tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_1 * (im * t_0)) + (1.0 + (0.5 * (im * im))));
                    	} else if (im <= 4.6e+51) {
                    		tmp = 1.0 + (im * (im * (0.5 + (((im * im) * (7.233796296296296e-5 + (t_0 * (t_0 * 2.6791838134430728e-9)))) / (0.001736111111111111 + (t_3 * (t_3 - 0.041666666666666664)))))));
                    	} else {
                    		tmp = t_2 * (1.0 + (re * (re * -0.5)));
                    	}
                    	return tmp;
                    }
                    
                    def code(re, im):
                    	t_0 = im * (im * im)
                    	t_1 = 0.041666666666666664 + ((im * im) * 0.001388888888888889)
                    	t_2 = 1.0 + (im * (im * (0.5 + (im * (im * t_1)))))
                    	t_3 = im * (im * 0.001388888888888889)
                    	tmp = 0
                    	if im <= 320.0:
                    		tmp = t_2
                    	elif im <= 9.5e+30:
                    		tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_1 * (im * t_0)) + (1.0 + (0.5 * (im * im))))
                    	elif im <= 4.6e+51:
                    		tmp = 1.0 + (im * (im * (0.5 + (((im * im) * (7.233796296296296e-5 + (t_0 * (t_0 * 2.6791838134430728e-9)))) / (0.001736111111111111 + (t_3 * (t_3 - 0.041666666666666664)))))))
                    	else:
                    		tmp = t_2 * (1.0 + (re * (re * -0.5)))
                    	return tmp
                    
                    function code(re, im)
                    	t_0 = Float64(im * Float64(im * im))
                    	t_1 = Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889))
                    	t_2 = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * t_1))))))
                    	t_3 = Float64(im * Float64(im * 0.001388888888888889))
                    	tmp = 0.0
                    	if (im <= 320.0)
                    		tmp = t_2;
                    	elseif (im <= 9.5e+30)
                    		tmp = Float64(Float64(1.0 + Float64(Float64(re * re) * Float64(-0.5 + Float64(re * Float64(re * 0.041666666666666664))))) * Float64(Float64(t_1 * Float64(im * t_0)) + Float64(1.0 + Float64(0.5 * Float64(im * im)))));
                    	elseif (im <= 4.6e+51)
                    		tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(Float64(Float64(im * im) * Float64(7.233796296296296e-5 + Float64(t_0 * Float64(t_0 * 2.6791838134430728e-9)))) / Float64(0.001736111111111111 + Float64(t_3 * Float64(t_3 - 0.041666666666666664))))))));
                    	else
                    		tmp = Float64(t_2 * Float64(1.0 + Float64(re * Float64(re * -0.5))));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(re, im)
                    	t_0 = im * (im * im);
                    	t_1 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
                    	t_2 = 1.0 + (im * (im * (0.5 + (im * (im * t_1)))));
                    	t_3 = im * (im * 0.001388888888888889);
                    	tmp = 0.0;
                    	if (im <= 320.0)
                    		tmp = t_2;
                    	elseif (im <= 9.5e+30)
                    		tmp = (1.0 + ((re * re) * (-0.5 + (re * (re * 0.041666666666666664))))) * ((t_1 * (im * t_0)) + (1.0 + (0.5 * (im * im))));
                    	elseif (im <= 4.6e+51)
                    		tmp = 1.0 + (im * (im * (0.5 + (((im * im) * (7.233796296296296e-5 + (t_0 * (t_0 * 2.6791838134430728e-9)))) / (0.001736111111111111 + (t_3 * (t_3 - 0.041666666666666664)))))));
                    	else
                    		tmp = t_2 * (1.0 + (re * (re * -0.5)));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[re_, im_] := Block[{t$95$0 = N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(im * N[(im * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 320.0], t$95$2, If[LessEqual[im, 9.5e+30], N[(N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.5 + N[(re * N[(re * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 * N[(im * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4.6e+51], N[(1.0 + N[(im * N[(im * N[(0.5 + N[(N[(N[(im * im), $MachinePrecision] * N[(7.233796296296296e-5 + N[(t$95$0 * N[(t$95$0 * 2.6791838134430728e-9), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(0.001736111111111111 + N[(t$95$3 * N[(t$95$3 - 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(1.0 + N[(re * N[(re * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := im \cdot \left(im \cdot im\right)\\
                    t_1 := 0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\\
                    t_2 := 1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot t\_1\right)\right)\right)\\
                    t_3 := im \cdot \left(im \cdot 0.001388888888888889\right)\\
                    \mathbf{if}\;im \leq 320:\\
                    \;\;\;\;t\_2\\
                    
                    \mathbf{elif}\;im \leq 9.5 \cdot 10^{+30}:\\
                    \;\;\;\;\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + re \cdot \left(re \cdot 0.041666666666666664\right)\right)\right) \cdot \left(t\_1 \cdot \left(im \cdot t\_0\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)\\
                    
                    \mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\
                    \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + \frac{\left(im \cdot im\right) \cdot \left(7.233796296296296 \cdot 10^{-5} + t\_0 \cdot \left(t\_0 \cdot 2.6791838134430728 \cdot 10^{-9}\right)\right)}{0.001736111111111111 + t\_3 \cdot \left(t\_3 - 0.041666666666666664\right)}\right)\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_2 \cdot \left(1 + re \cdot \left(re \cdot -0.5\right)\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 4 regimes
                    2. if im < 320

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified93.2%

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified59.7%

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

                      if 320 < im < 9.5000000000000003e30

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified4.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 9.5000000000000003e30 < im < 4.6000000000000001e51

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified6.7%

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified5.8%

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

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

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

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

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

                        \[\leadsto 1 + im \cdot \left(im \cdot \left(0.5 + \color{blue}{\frac{\left(im \cdot im\right) \cdot \left(7.233796296296296 \cdot 10^{-5} + \left(im \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot 2.6791838134430728 \cdot 10^{-9}\right)\right)}{0.001736111111111111 + \left(im \cdot \left(im \cdot 0.001388888888888889\right)\right) \cdot \left(im \cdot \left(im \cdot 0.001388888888888889\right) - 0.041666666666666664\right)}}\right)\right) \]

                      if 4.6000000000000001e51 < im

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified100.0%

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

                        \[\leadsto \color{blue}{1 + \left(\frac{-1}{2} \cdot \left({re}^{2} \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right) + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)} \]
                      7. Simplified75.5%

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 320:\\ \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\\ \mathbf{elif}\;im \leq 9.5 \cdot 10^{+30}:\\ \;\;\;\;\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + re \cdot \left(re \cdot 0.041666666666666664\right)\right)\right) \cdot \left(\left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)\\ \mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\ \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + \frac{\left(im \cdot im\right) \cdot \left(7.233796296296296 \cdot 10^{-5} + \left(im \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot 2.6791838134430728 \cdot 10^{-9}\right)\right)}{0.001736111111111111 + \left(im \cdot \left(im \cdot 0.001388888888888889\right)\right) \cdot \left(im \cdot \left(im \cdot 0.001388888888888889\right) - 0.041666666666666664\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\right) \cdot \left(1 + re \cdot \left(re \cdot -0.5\right)\right)\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 13: 59.7% accurate, 6.5× speedup?

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

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified93.2%

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified59.7%

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

                      if 360 < im < 5.2000000000000003e134

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified58.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 5.2000000000000003e134 < im

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

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

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

                          \[\leadsto \left(\cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \cos re\right) + {im}^{\color{blue}{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        5. distribute-rgt1-inN/A

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

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

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

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

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(\frac{1}{2} \cdot im\right)\right) \cdot \cos re \]
                        10. distribute-rgt-outN/A

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

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

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(im \cdot \left(\frac{1}{2} \cdot im\right) + \color{blue}{1}\right)\right) \]
                      5. Simplified100.0%

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

                        \[\leadsto \color{blue}{\frac{1}{24} \cdot \left({im}^{4} \cdot \cos re\right)} \]
                      7. Step-by-step derivation
                        1. associate-*r*N/A

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

                          \[\leadsto \cos re \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{4}\right)} \]
                        3. metadata-evalN/A

                          \[\leadsto \cos re \cdot \left(\frac{1}{24} \cdot {im}^{\left(2 \cdot \color{blue}{2}\right)}\right) \]
                        4. pow-sqrN/A

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right) \]
                        16. *-lowering-*.f64100.0%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right) \]
                      8. Simplified100.0%

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

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

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

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

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

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

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

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + {im}^{4} \cdot \color{blue}{\left({re}^{2} \cdot \frac{-1}{48}\right)} \]
                        7. distribute-lft-outN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)} \]
                    3. Recombined 3 regimes into one program.
                    4. Add Preprocessing

                    Alternative 14: 59.9% accurate, 8.3× speedup?

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

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified93.2%

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified59.7%

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

                      if 420 < im < 1.18e51

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

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

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

                          \[\leadsto \left(\cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \cos re\right) + {im}^{\color{blue}{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        5. distribute-rgt1-inN/A

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

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

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

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

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(\frac{1}{2} \cdot im\right)\right) \cdot \cos re \]
                        10. distribute-rgt-outN/A

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

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

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(im \cdot \left(\frac{1}{2} \cdot im\right) + \color{blue}{1}\right)\right) \]
                      5. Simplified4.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 1.18e51 < im

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified100.0%

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

                        \[\leadsto \color{blue}{1 + \left(\frac{-1}{2} \cdot \left({re}^{2} \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right) + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)} \]
                      7. Simplified75.5%

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 420:\\ \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\\ \mathbf{elif}\;im \leq 1.18 \cdot 10^{+51}:\\ \;\;\;\;\left(1 + \left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right) \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + re \cdot \left(re \cdot 0.041666666666666664\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\right) \cdot \left(1 + re \cdot \left(re \cdot -0.5\right)\right)\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 15: 59.9% accurate, 8.3× speedup?

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

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified93.2%

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified59.7%

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

                      if 550 < im < 1.25e51

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

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

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

                          \[\leadsto \left(\cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \cos re\right) + {im}^{\color{blue}{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        5. distribute-rgt1-inN/A

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

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

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

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

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(\frac{1}{2} \cdot im\right)\right) \cdot \cos re \]
                        10. distribute-rgt-outN/A

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

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

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(im \cdot \left(\frac{1}{2} \cdot im\right) + \color{blue}{1}\right)\right) \]
                      5. Simplified4.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(im \cdot im\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)\right), \left(\frac{1}{24} \cdot {re}^{4}\right)\right) \]
                        7. *-lowering-*.f64N/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), \left(\frac{1}{24} \cdot {re}^{4}\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), \left(\frac{1}{24} \cdot {re}^{4}\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), \left(\frac{1}{24} \cdot {re}^{4}\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), \left(\frac{1}{24} \cdot {re}^{4}\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), \left(\frac{1}{24} \cdot {re}^{4}\right)\right) \]
                        12. *-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(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \left(\frac{1}{24} \cdot {re}^{4}\right)\right) \]
                        13. *-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(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\left({re}^{4}\right)}\right)\right) \]
                        14. metadata-evalN/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(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({re}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right)\right) \]
                        15. pow-sqrN/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(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({re}^{2} \cdot \color{blue}{{re}^{2}}\right)\right)\right) \]
                        16. *-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(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({re}^{2}\right), \color{blue}{\left({re}^{2}\right)}\right)\right)\right) \]
                        17. 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(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(re \cdot re\right), \left({\color{blue}{re}}^{2}\right)\right)\right)\right) \]
                        18. *-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(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left({\color{blue}{re}}^{2}\right)\right)\right)\right) \]
                        19. 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(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(re \cdot \color{blue}{re}\right)\right)\right)\right) \]
                        20. *-lowering-*.f6434.6%

                          \[\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(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \color{blue}{re}\right)\right)\right)\right) \]
                      11. Simplified34.6%

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

                      if 1.25e51 < im

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified100.0%

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

                        \[\leadsto \color{blue}{1 + \left(\frac{-1}{2} \cdot \left({re}^{2} \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right) + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)} \]
                      7. Simplified75.5%

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 550:\\ \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\\ \mathbf{elif}\;im \leq 1.25 \cdot 10^{+51}:\\ \;\;\;\;\left(1 + \left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right) \cdot \left(0.041666666666666664 \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot re\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\right) \cdot \left(1 + re \cdot \left(re \cdot -0.5\right)\right)\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 16: 59.6% accurate, 9.3× speedup?

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

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified93.2%

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified59.7%

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

                      if 550 < im < 4.6000000000000001e51

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

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

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

                          \[\leadsto \left(\cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \cos re\right) + {im}^{\color{blue}{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        5. distribute-rgt1-inN/A

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

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

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

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

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(\frac{1}{2} \cdot im\right)\right) \cdot \cos re \]
                        10. distribute-rgt-outN/A

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

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

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(im \cdot \left(\frac{1}{2} \cdot im\right) + \color{blue}{1}\right)\right) \]
                      5. Simplified4.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(im \cdot im\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)\right), \left(\frac{1}{24} \cdot {re}^{4}\right)\right) \]
                        7. *-lowering-*.f64N/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), \left(\frac{1}{24} \cdot {re}^{4}\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), \left(\frac{1}{24} \cdot {re}^{4}\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), \left(\frac{1}{24} \cdot {re}^{4}\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), \left(\frac{1}{24} \cdot {re}^{4}\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), \left(\frac{1}{24} \cdot {re}^{4}\right)\right) \]
                        12. *-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(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \left(\frac{1}{24} \cdot {re}^{4}\right)\right) \]
                        13. *-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(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\left({re}^{4}\right)}\right)\right) \]
                        14. metadata-evalN/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(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({re}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right)\right) \]
                        15. pow-sqrN/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(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{24}, \left({re}^{2} \cdot \color{blue}{{re}^{2}}\right)\right)\right) \]
                        16. *-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(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({re}^{2}\right), \color{blue}{\left({re}^{2}\right)}\right)\right)\right) \]
                        17. 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(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(re \cdot re\right), \left({\color{blue}{re}}^{2}\right)\right)\right)\right) \]
                        18. *-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(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left({\color{blue}{re}}^{2}\right)\right)\right)\right) \]
                        19. 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(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(re \cdot \color{blue}{re}\right)\right)\right)\right) \]
                        20. *-lowering-*.f6434.6%

                          \[\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(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, \color{blue}{re}\right)\right)\right)\right) \]
                      11. Simplified34.6%

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

                      if 4.6000000000000001e51 < im < 4.09999999999999989e123

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified100.0%

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified66.7%

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

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

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

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

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

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

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

                          \[\leadsto \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), \color{blue}{\left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)}\right)\right)\right)\right) \]
                        7. unpow2N/A

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

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

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

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

                          \[\leadsto \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), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right) \]
                        12. unpow2N/A

                          \[\leadsto \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), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right) \]
                        13. *-lowering-*.f6466.7%

                          \[\leadsto \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), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right) \]
                      11. Simplified66.7%

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({im}^{4} \cdot \left(\frac{1}{24} \cdot \frac{1}{{im}^{2}}\right) + \color{blue}{{im}^{4} \cdot \frac{1}{720}}\right)\right)\right) \]
                      14. Simplified66.7%

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

                      if 4.09999999999999989e123 < im

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

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

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

                          \[\leadsto \left(\cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \cos re\right) + {im}^{\color{blue}{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        5. distribute-rgt1-inN/A

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

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

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

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

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(\frac{1}{2} \cdot im\right)\right) \cdot \cos re \]
                        10. distribute-rgt-outN/A

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

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

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(im \cdot \left(\frac{1}{2} \cdot im\right) + \color{blue}{1}\right)\right) \]
                      5. Simplified100.0%

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

                        \[\leadsto \color{blue}{\frac{1}{24} \cdot \left({im}^{4} \cdot \cos re\right)} \]
                      7. Step-by-step derivation
                        1. associate-*r*N/A

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

                          \[\leadsto \cos re \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{4}\right)} \]
                        3. metadata-evalN/A

                          \[\leadsto \cos re \cdot \left(\frac{1}{24} \cdot {im}^{\left(2 \cdot \color{blue}{2}\right)}\right) \]
                        4. pow-sqrN/A

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right) \]
                        16. *-lowering-*.f64100.0%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right) \]
                      8. Simplified100.0%

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

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

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

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

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

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

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

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + {im}^{4} \cdot \color{blue}{\left({re}^{2} \cdot \frac{-1}{48}\right)} \]
                        7. distribute-lft-outN/A

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{-1}{48}\right)\right)\right) \]
                        19. *-lowering-*.f6483.9%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{-1}{48}\right)\right)\right) \]
                      11. Simplified83.9%

                        \[\leadsto \color{blue}{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)} \]
                    3. Recombined 4 regimes into one program.
                    4. Final simplification61.7%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 550:\\ \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\\ \mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\ \;\;\;\;\left(1 + \left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right) \cdot \left(0.041666666666666664 \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot re\right)\right)\right)\\ \mathbf{elif}\;im \leq 4.1 \cdot 10^{+123}:\\ \;\;\;\;1 + \left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 17: 59.6% accurate, 9.6× speedup?

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

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified93.2%

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified59.7%

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

                      if 320 < im < 2.19999999999999992e51

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.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. Simplified3.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 2.19999999999999992e51 < im < 3.20000000000000005e123

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

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

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

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified100.0%

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified66.7%

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(im \cdot im\right), \left(\color{blue}{\frac{1}{2}} + {im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\color{blue}{\frac{1}{2}} + {im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right) \]
                        5. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)}\right)\right)\right) \]
                        6. *-lowering-*.f64N/A

                          \[\leadsto \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), \color{blue}{\left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)}\right)\right)\right)\right) \]
                        7. unpow2N/A

                          \[\leadsto \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), \left(\color{blue}{\frac{1}{24}} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)\right) \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \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), \left(\color{blue}{\frac{1}{24}} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)\right) \]
                        9. +-lowering-+.f64N/A

                          \[\leadsto \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), \mathsf{+.f64}\left(\frac{1}{24}, \color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right) \]
                        10. *-commutativeN/A

                          \[\leadsto \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), \mathsf{+.f64}\left(\frac{1}{24}, \left({im}^{2} \cdot \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \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), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right) \]
                        12. unpow2N/A

                          \[\leadsto \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), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right) \]
                        13. *-lowering-*.f6466.7%

                          \[\leadsto \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), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right) \]
                      11. Simplified66.7%

                        \[\leadsto \color{blue}{1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)} \]
                      12. Taylor expanded in im around inf

                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \color{blue}{\left({im}^{4} \cdot \left(\frac{1}{720} + \frac{1}{24} \cdot \frac{1}{{im}^{2}}\right)\right)}\right)\right) \]
                      13. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({im}^{4} \cdot \left(\frac{1}{24} \cdot \frac{1}{{im}^{2}} + \color{blue}{\frac{1}{720}}\right)\right)\right)\right) \]
                        2. distribute-lft-inN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({im}^{4} \cdot \left(\frac{1}{24} \cdot \frac{1}{{im}^{2}}\right) + \color{blue}{{im}^{4} \cdot \frac{1}{720}}\right)\right)\right) \]
                      14. Simplified66.7%

                        \[\leadsto 1 + \left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)} \]

                      if 3.20000000000000005e123 < im

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right)} \]
                      4. Step-by-step derivation
                        1. distribute-lft-inN/A

                          \[\leadsto \cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)}\right) \]
                        2. associate-+r+N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)} \]
                        3. associate-*r*N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        4. associate-*r*N/A

                          \[\leadsto \left(\cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \cos re\right) + {im}^{\color{blue}{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        5. distribute-rgt1-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \color{blue}{{im}^{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left({im}^{2} \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos re} \]
                        7. unpow2N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(\left(im \cdot im\right) \cdot \frac{1}{2}\right) \cdot \cos re \]
                        8. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(im \cdot \frac{1}{2}\right)\right) \cdot \cos \color{blue}{re} \]
                        9. *-commutativeN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(\frac{1}{2} \cdot im\right)\right) \cdot \cos re \]
                        10. distribute-rgt-outN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) + im \cdot \left(\frac{1}{2} \cdot im\right)\right)} \]
                        11. associate-+r+N/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \color{blue}{\left(1 + im \cdot \left(\frac{1}{2} \cdot im\right)\right)}\right) \]
                        12. +-commutativeN/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(im \cdot \left(\frac{1}{2} \cdot im\right) + \color{blue}{1}\right)\right) \]
                      5. Simplified100.0%

                        \[\leadsto \color{blue}{\cos re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right) + 1\right)} \]
                      6. Taylor expanded in im around inf

                        \[\leadsto \color{blue}{\frac{1}{24} \cdot \left({im}^{4} \cdot \cos re\right)} \]
                      7. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \left(\frac{1}{24} \cdot {im}^{4}\right) \cdot \color{blue}{\cos re} \]
                        2. *-commutativeN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{4}\right)} \]
                        3. metadata-evalN/A

                          \[\leadsto \cos re \cdot \left(\frac{1}{24} \cdot {im}^{\left(2 \cdot \color{blue}{2}\right)}\right) \]
                        4. pow-sqrN/A

                          \[\leadsto \cos re \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right) \]
                        5. associate-*l*N/A

                          \[\leadsto \cos re \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \color{blue}{{im}^{2}}\right) \]
                        6. *-commutativeN/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right) \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\cos re, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right) \]
                        8. cos-lowering-cos.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\color{blue}{{im}^{2}} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)\right) \]
                        9. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24}} \cdot {im}^{2}\right)\right)\right) \]
                        10. associate-*l*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right)\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right)\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right) \]
                        13. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right) \]
                        15. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right) \]
                        16. *-lowering-*.f64100.0%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right) \]
                      8. Simplified100.0%

                        \[\leadsto \color{blue}{\cos re \cdot \left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)} \]
                      9. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{\frac{-1}{48} \cdot \left({im}^{4} \cdot {re}^{2}\right) + \frac{1}{24} \cdot {im}^{4}} \]
                      10. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \left(\frac{-1}{48} \cdot {im}^{4}\right) \cdot {re}^{2} + \color{blue}{\frac{1}{24}} \cdot {im}^{4} \]
                        2. +-commutativeN/A

                          \[\leadsto \frac{1}{24} \cdot {im}^{4} + \color{blue}{\left(\frac{-1}{48} \cdot {im}^{4}\right) \cdot {re}^{2}} \]
                        3. *-commutativeN/A

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + \color{blue}{\left(\frac{-1}{48} \cdot {im}^{4}\right)} \cdot {re}^{2} \]
                        4. associate-*r*N/A

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + \frac{-1}{48} \cdot \color{blue}{\left({im}^{4} \cdot {re}^{2}\right)} \]
                        5. *-commutativeN/A

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + \left({im}^{4} \cdot {re}^{2}\right) \cdot \color{blue}{\frac{-1}{48}} \]
                        6. associate-*l*N/A

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + {im}^{4} \cdot \color{blue}{\left({re}^{2} \cdot \frac{-1}{48}\right)} \]
                        7. distribute-lft-outN/A

                          \[\leadsto {im}^{4} \cdot \color{blue}{\left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)} \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\left({im}^{4}\right), \color{blue}{\left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)}\right) \]
                        9. metadata-evalN/A

                          \[\leadsto \mathsf{*.f64}\left(\left({im}^{\left(2 \cdot 2\right)}\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        10. pow-sqrN/A

                          \[\leadsto \mathsf{*.f64}\left(\left({im}^{2} \cdot {im}^{2}\right), \left(\color{blue}{\frac{1}{24}} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({im}^{2}\right), \left({im}^{2}\right)\right), \left(\color{blue}{\frac{1}{24}} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        12. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(im \cdot im\right), \left({im}^{2}\right)\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        13. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({im}^{2}\right)\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        14. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(im \cdot im\right)\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        15. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        16. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \color{blue}{\left({re}^{2} \cdot \frac{-1}{48}\right)}\right)\right) \]
                        17. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({re}^{2}\right), \color{blue}{\frac{-1}{48}}\right)\right)\right) \]
                        18. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{-1}{48}\right)\right)\right) \]
                        19. *-lowering-*.f6483.9%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{-1}{48}\right)\right)\right) \]
                      11. Simplified83.9%

                        \[\leadsto \color{blue}{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)} \]
                    3. Recombined 4 regimes into one program.
                    4. Final simplification61.4%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 320:\\ \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\\ \mathbf{elif}\;im \leq 2.2 \cdot 10^{+51}:\\ \;\;\;\;\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)\right)\\ \mathbf{elif}\;im \leq 3.2 \cdot 10^{+123}:\\ \;\;\;\;1 + \left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 18: 58.3% accurate, 9.6× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 360:\\ \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\ \mathbf{elif}\;im \leq 4.2 \cdot 10^{+51}:\\ \;\;\;\;\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)\right)\\ \mathbf{elif}\;im \leq 8.2 \cdot 10^{+122}:\\ \;\;\;\;1 + \left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\ \end{array} \end{array} \]
                    (FPCore (re im)
                     :precision binary64
                     (if (<= im 360.0)
                       (+ 1.0 (* im (* im (+ 0.5 (* im (* im 0.041666666666666664))))))
                       (if (<= im 4.2e+51)
                         (*
                          (* 0.5 (* im im))
                          (+ 1.0 (* re (* re (+ -0.5 (* 0.041666666666666664 (* re re)))))))
                         (if (<= im 8.2e+122)
                           (+
                            1.0
                            (*
                             (* im im)
                             (*
                              im
                              (* im (+ 0.041666666666666664 (* (* im im) 0.001388888888888889))))))
                           (*
                            (* (* im im) (* im im))
                            (+ 0.041666666666666664 (* (* re re) -0.020833333333333332)))))))
                    double code(double re, double im) {
                    	double tmp;
                    	if (im <= 360.0) {
                    		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
                    	} else if (im <= 4.2e+51) {
                    		tmp = (0.5 * (im * im)) * (1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re))))));
                    	} else if (im <= 8.2e+122) {
                    		tmp = 1.0 + ((im * im) * (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))));
                    	} else {
                    		tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(re, im)
                        real(8), intent (in) :: re
                        real(8), intent (in) :: im
                        real(8) :: tmp
                        if (im <= 360.0d0) then
                            tmp = 1.0d0 + (im * (im * (0.5d0 + (im * (im * 0.041666666666666664d0)))))
                        else if (im <= 4.2d+51) then
                            tmp = (0.5d0 * (im * im)) * (1.0d0 + (re * (re * ((-0.5d0) + (0.041666666666666664d0 * (re * re))))))
                        else if (im <= 8.2d+122) then
                            tmp = 1.0d0 + ((im * im) * (im * (im * (0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)))))
                        else
                            tmp = ((im * im) * (im * im)) * (0.041666666666666664d0 + ((re * re) * (-0.020833333333333332d0)))
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double re, double im) {
                    	double tmp;
                    	if (im <= 360.0) {
                    		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
                    	} else if (im <= 4.2e+51) {
                    		tmp = (0.5 * (im * im)) * (1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re))))));
                    	} else if (im <= 8.2e+122) {
                    		tmp = 1.0 + ((im * im) * (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))));
                    	} else {
                    		tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
                    	}
                    	return tmp;
                    }
                    
                    def code(re, im):
                    	tmp = 0
                    	if im <= 360.0:
                    		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))))
                    	elif im <= 4.2e+51:
                    		tmp = (0.5 * (im * im)) * (1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re))))))
                    	elif im <= 8.2e+122:
                    		tmp = 1.0 + ((im * im) * (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))
                    	else:
                    		tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332))
                    	return tmp
                    
                    function code(re, im)
                    	tmp = 0.0
                    	if (im <= 360.0)
                    		tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664))))));
                    	elseif (im <= 4.2e+51)
                    		tmp = Float64(Float64(0.5 * Float64(im * im)) * Float64(1.0 + Float64(re * Float64(re * Float64(-0.5 + Float64(0.041666666666666664 * Float64(re * re)))))));
                    	elseif (im <= 8.2e+122)
                    		tmp = Float64(1.0 + Float64(Float64(im * im) * Float64(im * Float64(im * Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889))))));
                    	else
                    		tmp = Float64(Float64(Float64(im * im) * Float64(im * im)) * Float64(0.041666666666666664 + Float64(Float64(re * re) * -0.020833333333333332)));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(re, im)
                    	tmp = 0.0;
                    	if (im <= 360.0)
                    		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
                    	elseif (im <= 4.2e+51)
                    		tmp = (0.5 * (im * im)) * (1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re))))));
                    	elseif (im <= 8.2e+122)
                    		tmp = 1.0 + ((im * im) * (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))));
                    	else
                    		tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[re_, im_] := If[LessEqual[im, 360.0], N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4.2e+51], N[(N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(re * N[(re * N[(-0.5 + N[(0.041666666666666664 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 8.2e+122], N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(re * re), $MachinePrecision] * -0.020833333333333332), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;im \leq 360:\\
                    \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\
                    
                    \mathbf{elif}\;im \leq 4.2 \cdot 10^{+51}:\\
                    \;\;\;\;\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)\right)\\
                    
                    \mathbf{elif}\;im \leq 8.2 \cdot 10^{+122}:\\
                    \;\;\;\;1 + \left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 4 regimes
                    2. if im < 360

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right)} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\cos re} \]
                        2. +-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified93.2%

                        \[\leadsto \color{blue}{\cos re \cdot \left(\left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)} \]
                      6. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)} \]
                      7. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)}\right) \]
                        2. +-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(\frac{1}{24} \cdot {im}^{4} + \left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}\right) + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right) \]
                        4. associate-+l+N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot {im}^{4} + \color{blue}{\left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4} + \frac{1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                        5. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot {im}^{\left(2 \cdot 2\right)} + \left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{\color{blue}{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        6. pow-sqrN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot \left({im}^{2} \cdot {im}^{2}\right) + \left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot \color{blue}{{im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        7. associate-*l*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot {im}^{2} + \left(\color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        8. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left({im}^{4} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        10. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \color{blue}{\left({im}^{4} \cdot \frac{1}{720} + \frac{1}{2}\right)}\right)\right) \]
                        12. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left(\left({im}^{2} \cdot {im}^{2}\right) \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        14. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \frac{1}{720}\right) + \frac{1}{2}\right)\right)\right) \]
                        15. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified59.7%

                        \[\leadsto \color{blue}{1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)} \]
                      9. Taylor expanded in im around 0

                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot im\right)}\right)\right)\right)\right)\right) \]
                      10. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                        2. *-lowering-*.f6453.8%

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                      11. Simplified53.8%

                        \[\leadsto 1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \color{blue}{\left(im \cdot 0.041666666666666664\right)}\right)\right) \]

                      if 360 < im < 4.2000000000000002e51

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + \frac{1}{2} \cdot \left({im}^{2} \cdot \cos re\right)} \]
                      4. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \cos re + \left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{\cos re} \]
                        2. distribute-rgt1-inN/A

                          \[\leadsto \left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \color{blue}{\cos re} \]
                        3. unpow2N/A

                          \[\leadsto \left(\frac{1}{2} \cdot \left(im \cdot im\right) + 1\right) \cdot \cos re \]
                        4. associate-*r*N/A

                          \[\leadsto \left(\left(\frac{1}{2} \cdot im\right) \cdot im + 1\right) \cdot \cos re \]
                        5. *-commutativeN/A

                          \[\leadsto \left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right) \cdot \cos re \]
                        6. *-commutativeN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right)} \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\cos re, \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right)}\right) \]
                        8. cos-lowering-cos.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right)\right) \]
                        9. +-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(1 + \color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)}\right)\right) \]
                        10. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right)\right)}\right)\right) \]
                        11. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\left(\frac{1}{2} \cdot im\right) \cdot \color{blue}{im}\right)\right)\right) \]
                        12. associate-*r*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)}\right)\right)\right) \]
                        13. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot {im}^{\color{blue}{2}}\right)\right)\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                        15. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                        16. *-lowering-*.f643.6%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.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. Simplified3.6%

                        \[\leadsto \color{blue}{\cos re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
                      6. Taylor expanded in im around inf

                        \[\leadsto \color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \cos re\right)} \]
                      7. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{\cos re} \]
                        2. *-commutativeN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right)} \]
                        3. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\cos re, \color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right)}\right) \]
                        4. cos-lowering-cos.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right) \]
                        5. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right) \]
                        6. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right) \]
                        7. *-lowering-*.f643.6%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right) \]
                      8. Simplified3.6%

                        \[\leadsto \color{blue}{\cos re \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)} \]
                      9. Taylor expanded in re around 0

                        \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + {re}^{2} \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right) \]
                      10. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({re}^{2} \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{*.f64}\left(\color{blue}{\frac{1}{2}}, \mathsf{*.f64}\left(im, im\right)\right)\right) \]
                        2. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\left(re \cdot re\right) \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right) \]
                        3. associate-*l*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(re \cdot \left(re \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(re \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right) \]
                        5. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right) \]
                        6. sub-negN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{1}{24} \cdot {re}^{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right) \]
                        7. metadata-evalN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{1}{24} \cdot {re}^{2} + \frac{-1}{2}\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right) \]
                        8. +-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{-1}{2} + \frac{1}{24} \cdot {re}^{2}\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right) \]
                        9. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{2}, \left(\frac{1}{24} \cdot {re}^{2}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right) \]
                        10. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \left({re}^{2}\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right) \]
                        11. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \left(re \cdot re\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right) \]
                        12. *-lowering-*.f6429.2%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, re\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, im\right)\right)\right) \]
                      11. Simplified29.2%

                        \[\leadsto \color{blue}{\left(1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)\right)} \cdot \left(0.5 \cdot \left(im \cdot im\right)\right) \]

                      if 4.2000000000000002e51 < im < 8.2000000000000004e122

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right)} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\cos re} \]
                        2. +-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified100.0%

                        \[\leadsto \color{blue}{\cos re \cdot \left(\left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)} \]
                      6. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)} \]
                      7. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)}\right) \]
                        2. +-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(\frac{1}{24} \cdot {im}^{4} + \left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}\right) + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right) \]
                        4. associate-+l+N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot {im}^{4} + \color{blue}{\left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4} + \frac{1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                        5. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot {im}^{\left(2 \cdot 2\right)} + \left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{\color{blue}{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        6. pow-sqrN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot \left({im}^{2} \cdot {im}^{2}\right) + \left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot \color{blue}{{im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        7. associate-*l*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot {im}^{2} + \left(\color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        8. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left({im}^{4} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        10. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \color{blue}{\left({im}^{4} \cdot \frac{1}{720} + \frac{1}{2}\right)}\right)\right) \]
                        12. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left(\left({im}^{2} \cdot {im}^{2}\right) \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        14. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \frac{1}{720}\right) + \frac{1}{2}\right)\right)\right) \]
                        15. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified66.7%

                        \[\leadsto \color{blue}{1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)} \]
                      9. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{1 + {im}^{2} \cdot \left(\frac{1}{2} + {im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)} \]
                      10. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} + {im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)}\right) \]
                        2. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\left(\frac{1}{2} + {im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)}\right)\right) \]
                        3. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(im \cdot im\right), \left(\color{blue}{\frac{1}{2}} + {im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\color{blue}{\frac{1}{2}} + {im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right) \]
                        5. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)}\right)\right)\right) \]
                        6. *-lowering-*.f64N/A

                          \[\leadsto \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), \color{blue}{\left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)}\right)\right)\right)\right) \]
                        7. unpow2N/A

                          \[\leadsto \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), \left(\color{blue}{\frac{1}{24}} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)\right) \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \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), \left(\color{blue}{\frac{1}{24}} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)\right) \]
                        9. +-lowering-+.f64N/A

                          \[\leadsto \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), \mathsf{+.f64}\left(\frac{1}{24}, \color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right) \]
                        10. *-commutativeN/A

                          \[\leadsto \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), \mathsf{+.f64}\left(\frac{1}{24}, \left({im}^{2} \cdot \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \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), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right) \]
                        12. unpow2N/A

                          \[\leadsto \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), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right) \]
                        13. *-lowering-*.f6466.7%

                          \[\leadsto \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), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right) \]
                      11. Simplified66.7%

                        \[\leadsto \color{blue}{1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)} \]
                      12. Taylor expanded in im around inf

                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \color{blue}{\left({im}^{4} \cdot \left(\frac{1}{720} + \frac{1}{24} \cdot \frac{1}{{im}^{2}}\right)\right)}\right)\right) \]
                      13. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({im}^{4} \cdot \left(\frac{1}{24} \cdot \frac{1}{{im}^{2}} + \color{blue}{\frac{1}{720}}\right)\right)\right)\right) \]
                        2. distribute-lft-inN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({im}^{4} \cdot \left(\frac{1}{24} \cdot \frac{1}{{im}^{2}}\right) + \color{blue}{{im}^{4} \cdot \frac{1}{720}}\right)\right)\right) \]
                      14. Simplified66.7%

                        \[\leadsto 1 + \left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)} \]

                      if 8.2000000000000004e122 < im

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right)} \]
                      4. Step-by-step derivation
                        1. distribute-lft-inN/A

                          \[\leadsto \cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)}\right) \]
                        2. associate-+r+N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)} \]
                        3. associate-*r*N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        4. associate-*r*N/A

                          \[\leadsto \left(\cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \cos re\right) + {im}^{\color{blue}{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        5. distribute-rgt1-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \color{blue}{{im}^{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left({im}^{2} \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos re} \]
                        7. unpow2N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(\left(im \cdot im\right) \cdot \frac{1}{2}\right) \cdot \cos re \]
                        8. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(im \cdot \frac{1}{2}\right)\right) \cdot \cos \color{blue}{re} \]
                        9. *-commutativeN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(\frac{1}{2} \cdot im\right)\right) \cdot \cos re \]
                        10. distribute-rgt-outN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) + im \cdot \left(\frac{1}{2} \cdot im\right)\right)} \]
                        11. associate-+r+N/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \color{blue}{\left(1 + im \cdot \left(\frac{1}{2} \cdot im\right)\right)}\right) \]
                        12. +-commutativeN/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(im \cdot \left(\frac{1}{2} \cdot im\right) + \color{blue}{1}\right)\right) \]
                      5. Simplified100.0%

                        \[\leadsto \color{blue}{\cos re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right) + 1\right)} \]
                      6. Taylor expanded in im around inf

                        \[\leadsto \color{blue}{\frac{1}{24} \cdot \left({im}^{4} \cdot \cos re\right)} \]
                      7. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \left(\frac{1}{24} \cdot {im}^{4}\right) \cdot \color{blue}{\cos re} \]
                        2. *-commutativeN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{4}\right)} \]
                        3. metadata-evalN/A

                          \[\leadsto \cos re \cdot \left(\frac{1}{24} \cdot {im}^{\left(2 \cdot \color{blue}{2}\right)}\right) \]
                        4. pow-sqrN/A

                          \[\leadsto \cos re \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right) \]
                        5. associate-*l*N/A

                          \[\leadsto \cos re \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \color{blue}{{im}^{2}}\right) \]
                        6. *-commutativeN/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right) \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\cos re, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right) \]
                        8. cos-lowering-cos.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\color{blue}{{im}^{2}} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)\right) \]
                        9. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24}} \cdot {im}^{2}\right)\right)\right) \]
                        10. associate-*l*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right)\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right)\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right) \]
                        13. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right) \]
                        15. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right) \]
                        16. *-lowering-*.f64100.0%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right) \]
                      8. Simplified100.0%

                        \[\leadsto \color{blue}{\cos re \cdot \left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)} \]
                      9. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{\frac{-1}{48} \cdot \left({im}^{4} \cdot {re}^{2}\right) + \frac{1}{24} \cdot {im}^{4}} \]
                      10. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \left(\frac{-1}{48} \cdot {im}^{4}\right) \cdot {re}^{2} + \color{blue}{\frac{1}{24}} \cdot {im}^{4} \]
                        2. +-commutativeN/A

                          \[\leadsto \frac{1}{24} \cdot {im}^{4} + \color{blue}{\left(\frac{-1}{48} \cdot {im}^{4}\right) \cdot {re}^{2}} \]
                        3. *-commutativeN/A

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + \color{blue}{\left(\frac{-1}{48} \cdot {im}^{4}\right)} \cdot {re}^{2} \]
                        4. associate-*r*N/A

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + \frac{-1}{48} \cdot \color{blue}{\left({im}^{4} \cdot {re}^{2}\right)} \]
                        5. *-commutativeN/A

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + \left({im}^{4} \cdot {re}^{2}\right) \cdot \color{blue}{\frac{-1}{48}} \]
                        6. associate-*l*N/A

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + {im}^{4} \cdot \color{blue}{\left({re}^{2} \cdot \frac{-1}{48}\right)} \]
                        7. distribute-lft-outN/A

                          \[\leadsto {im}^{4} \cdot \color{blue}{\left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)} \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\left({im}^{4}\right), \color{blue}{\left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)}\right) \]
                        9. metadata-evalN/A

                          \[\leadsto \mathsf{*.f64}\left(\left({im}^{\left(2 \cdot 2\right)}\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        10. pow-sqrN/A

                          \[\leadsto \mathsf{*.f64}\left(\left({im}^{2} \cdot {im}^{2}\right), \left(\color{blue}{\frac{1}{24}} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({im}^{2}\right), \left({im}^{2}\right)\right), \left(\color{blue}{\frac{1}{24}} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        12. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(im \cdot im\right), \left({im}^{2}\right)\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        13. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({im}^{2}\right)\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        14. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(im \cdot im\right)\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        15. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        16. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \color{blue}{\left({re}^{2} \cdot \frac{-1}{48}\right)}\right)\right) \]
                        17. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({re}^{2}\right), \color{blue}{\frac{-1}{48}}\right)\right)\right) \]
                        18. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{-1}{48}\right)\right)\right) \]
                        19. *-lowering-*.f6483.9%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{-1}{48}\right)\right)\right) \]
                      11. Simplified83.9%

                        \[\leadsto \color{blue}{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)} \]
                    3. Recombined 4 regimes into one program.
                    4. Final simplification56.9%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 360:\\ \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\ \mathbf{elif}\;im \leq 4.2 \cdot 10^{+51}:\\ \;\;\;\;\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)\right)\\ \mathbf{elif}\;im \leq 8.2 \cdot 10^{+122}:\\ \;\;\;\;1 + \left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 19: 58.2% accurate, 9.6× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 410:\\ \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\ \mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\ \;\;\;\;1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)\\ \mathbf{elif}\;im \leq 1.4 \cdot 10^{+123}:\\ \;\;\;\;1 + \left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\ \end{array} \end{array} \]
                    (FPCore (re im)
                     :precision binary64
                     (if (<= im 410.0)
                       (+ 1.0 (* im (* im (+ 0.5 (* im (* im 0.041666666666666664))))))
                       (if (<= im 4.6e+51)
                         (+ 1.0 (* re (* re (+ -0.5 (* 0.041666666666666664 (* re re))))))
                         (if (<= im 1.4e+123)
                           (+
                            1.0
                            (*
                             (* im im)
                             (*
                              im
                              (* im (+ 0.041666666666666664 (* (* im im) 0.001388888888888889))))))
                           (*
                            (* (* im im) (* im im))
                            (+ 0.041666666666666664 (* (* re re) -0.020833333333333332)))))))
                    double code(double re, double im) {
                    	double tmp;
                    	if (im <= 410.0) {
                    		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
                    	} else if (im <= 4.6e+51) {
                    		tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))));
                    	} else if (im <= 1.4e+123) {
                    		tmp = 1.0 + ((im * im) * (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))));
                    	} else {
                    		tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(re, im)
                        real(8), intent (in) :: re
                        real(8), intent (in) :: im
                        real(8) :: tmp
                        if (im <= 410.0d0) then
                            tmp = 1.0d0 + (im * (im * (0.5d0 + (im * (im * 0.041666666666666664d0)))))
                        else if (im <= 4.6d+51) then
                            tmp = 1.0d0 + (re * (re * ((-0.5d0) + (0.041666666666666664d0 * (re * re)))))
                        else if (im <= 1.4d+123) then
                            tmp = 1.0d0 + ((im * im) * (im * (im * (0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)))))
                        else
                            tmp = ((im * im) * (im * im)) * (0.041666666666666664d0 + ((re * re) * (-0.020833333333333332d0)))
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double re, double im) {
                    	double tmp;
                    	if (im <= 410.0) {
                    		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
                    	} else if (im <= 4.6e+51) {
                    		tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))));
                    	} else if (im <= 1.4e+123) {
                    		tmp = 1.0 + ((im * im) * (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))));
                    	} else {
                    		tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
                    	}
                    	return tmp;
                    }
                    
                    def code(re, im):
                    	tmp = 0
                    	if im <= 410.0:
                    		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))))
                    	elif im <= 4.6e+51:
                    		tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))))
                    	elif im <= 1.4e+123:
                    		tmp = 1.0 + ((im * im) * (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))
                    	else:
                    		tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332))
                    	return tmp
                    
                    function code(re, im)
                    	tmp = 0.0
                    	if (im <= 410.0)
                    		tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664))))));
                    	elseif (im <= 4.6e+51)
                    		tmp = Float64(1.0 + Float64(re * Float64(re * Float64(-0.5 + Float64(0.041666666666666664 * Float64(re * re))))));
                    	elseif (im <= 1.4e+123)
                    		tmp = Float64(1.0 + Float64(Float64(im * im) * Float64(im * Float64(im * Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889))))));
                    	else
                    		tmp = Float64(Float64(Float64(im * im) * Float64(im * im)) * Float64(0.041666666666666664 + Float64(Float64(re * re) * -0.020833333333333332)));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(re, im)
                    	tmp = 0.0;
                    	if (im <= 410.0)
                    		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
                    	elseif (im <= 4.6e+51)
                    		tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))));
                    	elseif (im <= 1.4e+123)
                    		tmp = 1.0 + ((im * im) * (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))));
                    	else
                    		tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[re_, im_] := If[LessEqual[im, 410.0], N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4.6e+51], N[(1.0 + N[(re * N[(re * N[(-0.5 + N[(0.041666666666666664 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.4e+123], N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(re * re), $MachinePrecision] * -0.020833333333333332), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;im \leq 410:\\
                    \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\
                    
                    \mathbf{elif}\;im \leq 4.6 \cdot 10^{+51}:\\
                    \;\;\;\;1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)\\
                    
                    \mathbf{elif}\;im \leq 1.4 \cdot 10^{+123}:\\
                    \;\;\;\;1 + \left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 4 regimes
                    2. if im < 410

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right)} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\cos re} \]
                        2. +-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified93.2%

                        \[\leadsto \color{blue}{\cos re \cdot \left(\left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)} \]
                      6. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)} \]
                      7. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)}\right) \]
                        2. +-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(\frac{1}{24} \cdot {im}^{4} + \left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}\right) + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right) \]
                        4. associate-+l+N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot {im}^{4} + \color{blue}{\left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4} + \frac{1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                        5. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot {im}^{\left(2 \cdot 2\right)} + \left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{\color{blue}{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        6. pow-sqrN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot \left({im}^{2} \cdot {im}^{2}\right) + \left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot \color{blue}{{im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        7. associate-*l*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot {im}^{2} + \left(\color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        8. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left({im}^{4} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        10. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \color{blue}{\left({im}^{4} \cdot \frac{1}{720} + \frac{1}{2}\right)}\right)\right) \]
                        12. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left(\left({im}^{2} \cdot {im}^{2}\right) \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        14. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \frac{1}{720}\right) + \frac{1}{2}\right)\right)\right) \]
                        15. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified59.7%

                        \[\leadsto \color{blue}{1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)} \]
                      9. Taylor expanded in im around 0

                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot im\right)}\right)\right)\right)\right)\right) \]
                      10. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                        2. *-lowering-*.f6453.8%

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                      11. Simplified53.8%

                        \[\leadsto 1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \color{blue}{\left(im \cdot 0.041666666666666664\right)}\right)\right) \]

                      if 410 < im < 4.6000000000000001e51

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right)} \]
                      4. Step-by-step derivation
                        1. distribute-lft-inN/A

                          \[\leadsto \cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)}\right) \]
                        2. associate-+r+N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)} \]
                        3. associate-*r*N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        4. associate-*r*N/A

                          \[\leadsto \left(\cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \cos re\right) + {im}^{\color{blue}{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        5. distribute-rgt1-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \color{blue}{{im}^{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left({im}^{2} \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos re} \]
                        7. unpow2N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(\left(im \cdot im\right) \cdot \frac{1}{2}\right) \cdot \cos re \]
                        8. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(im \cdot \frac{1}{2}\right)\right) \cdot \cos \color{blue}{re} \]
                        9. *-commutativeN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(\frac{1}{2} \cdot im\right)\right) \cdot \cos re \]
                        10. distribute-rgt-outN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) + im \cdot \left(\frac{1}{2} \cdot im\right)\right)} \]
                        11. associate-+r+N/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \color{blue}{\left(1 + im \cdot \left(\frac{1}{2} \cdot im\right)\right)}\right) \]
                        12. +-commutativeN/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(im \cdot \left(\frac{1}{2} \cdot im\right) + \color{blue}{1}\right)\right) \]
                      5. Simplified4.2%

                        \[\leadsto \color{blue}{\cos re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right) + 1\right)} \]
                      6. Taylor expanded in re around 0

                        \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + {re}^{2} \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)}, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right), 1\right)\right) \]
                      7. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({re}^{2} \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right)}, 1\right)\right) \]
                        2. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({re}^{2}\right), \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \color{blue}{\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)\right)}\right), 1\right)\right) \]
                        3. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(re \cdot re\right), \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\color{blue}{\frac{1}{2}}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right), 1\right)\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\color{blue}{\frac{1}{2}}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right), 1\right)\right) \]
                        5. sub-negN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{1}{24} \cdot {re}^{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)}\right)\right), 1\right)\right) \]
                        6. metadata-evalN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{1}{24} \cdot {re}^{2} + \frac{-1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\mathsf{*.f64}\left(im, im\right)}\right)\right)\right), 1\right)\right) \]
                        7. +-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{-1}{2} + \frac{1}{24} \cdot {re}^{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)}\right)\right), 1\right)\right) \]
                        8. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left(\frac{1}{24} \cdot {re}^{2}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)}\right)\right), 1\right)\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left({re}^{2} \cdot \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\mathsf{*.f64}\left(im, im\right)}\right)\right)\right), 1\right)\right) \]
                        10. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left(\left(re \cdot re\right) \cdot \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\color{blue}{im}, im\right)\right)\right)\right), 1\right)\right) \]
                        11. associate-*l*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left(re \cdot \left(re \cdot \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\mathsf{*.f64}\left(im, im\right)}\right)\right)\right), 1\right)\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(re, \left(re \cdot \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\mathsf{*.f64}\left(im, im\right)}\right)\right)\right), 1\right)\right) \]
                        13. *-lowering-*.f6435.7%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right), 1\right)\right) \]
                      8. Simplified35.7%

                        \[\leadsto \color{blue}{\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + re \cdot \left(re \cdot 0.041666666666666664\right)\right)\right)} \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right) + 1\right) \]
                      9. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{1 + {re}^{2} \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)} \]
                      10. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left({re}^{2} \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)}\right) \]
                        2. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(re \cdot re\right) \cdot \left(\color{blue}{\frac{1}{24} \cdot {re}^{2}} - \frac{1}{2}\right)\right)\right) \]
                        3. associate-*l*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(re \cdot \color{blue}{\left(re \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \color{blue}{\left(re \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                        5. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \color{blue}{\left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)}\right)\right)\right) \]
                        6. sub-negN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{1}{24} \cdot {re}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right) \]
                        7. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{1}{24} \cdot {re}^{2} + \frac{-1}{2}\right)\right)\right)\right) \]
                        8. +-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{-1}{2} + \color{blue}{\frac{1}{24} \cdot {re}^{2}}\right)\right)\right)\right) \]
                        9. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{2}, \color{blue}{\left(\frac{1}{24} \cdot {re}^{2}\right)}\right)\right)\right)\right) \]
                        10. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\left({re}^{2}\right)}\right)\right)\right)\right)\right) \]
                        11. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \left(re \cdot \color{blue}{re}\right)\right)\right)\right)\right)\right) \]
                        12. *-lowering-*.f6428.8%

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \color{blue}{re}\right)\right)\right)\right)\right)\right) \]
                      11. Simplified28.8%

                        \[\leadsto \color{blue}{1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)} \]

                      if 4.6000000000000001e51 < im < 1.40000000000000006e123

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right)} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\cos re} \]
                        2. +-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified100.0%

                        \[\leadsto \color{blue}{\cos re \cdot \left(\left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)} \]
                      6. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)} \]
                      7. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)}\right) \]
                        2. +-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(\frac{1}{24} \cdot {im}^{4} + \left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}\right) + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right) \]
                        4. associate-+l+N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot {im}^{4} + \color{blue}{\left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4} + \frac{1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                        5. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot {im}^{\left(2 \cdot 2\right)} + \left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{\color{blue}{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        6. pow-sqrN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot \left({im}^{2} \cdot {im}^{2}\right) + \left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot \color{blue}{{im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        7. associate-*l*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot {im}^{2} + \left(\color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        8. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left({im}^{4} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        10. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \color{blue}{\left({im}^{4} \cdot \frac{1}{720} + \frac{1}{2}\right)}\right)\right) \]
                        12. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left(\left({im}^{2} \cdot {im}^{2}\right) \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        14. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \frac{1}{720}\right) + \frac{1}{2}\right)\right)\right) \]
                        15. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified66.7%

                        \[\leadsto \color{blue}{1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)} \]
                      9. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{1 + {im}^{2} \cdot \left(\frac{1}{2} + {im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)} \]
                      10. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} + {im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)}\right) \]
                        2. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\left(\frac{1}{2} + {im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)}\right)\right) \]
                        3. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(im \cdot im\right), \left(\color{blue}{\frac{1}{2}} + {im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\color{blue}{\frac{1}{2}} + {im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right) \]
                        5. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)}\right)\right)\right) \]
                        6. *-lowering-*.f64N/A

                          \[\leadsto \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), \color{blue}{\left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)}\right)\right)\right)\right) \]
                        7. unpow2N/A

                          \[\leadsto \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), \left(\color{blue}{\frac{1}{24}} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)\right) \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \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), \left(\color{blue}{\frac{1}{24}} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)\right) \]
                        9. +-lowering-+.f64N/A

                          \[\leadsto \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), \mathsf{+.f64}\left(\frac{1}{24}, \color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right) \]
                        10. *-commutativeN/A

                          \[\leadsto \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), \mathsf{+.f64}\left(\frac{1}{24}, \left({im}^{2} \cdot \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \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), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right) \]
                        12. unpow2N/A

                          \[\leadsto \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), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right) \]
                        13. *-lowering-*.f6466.7%

                          \[\leadsto \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), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right) \]
                      11. Simplified66.7%

                        \[\leadsto \color{blue}{1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)} \]
                      12. Taylor expanded in im around inf

                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \color{blue}{\left({im}^{4} \cdot \left(\frac{1}{720} + \frac{1}{24} \cdot \frac{1}{{im}^{2}}\right)\right)}\right)\right) \]
                      13. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({im}^{4} \cdot \left(\frac{1}{24} \cdot \frac{1}{{im}^{2}} + \color{blue}{\frac{1}{720}}\right)\right)\right)\right) \]
                        2. distribute-lft-inN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({im}^{4} \cdot \left(\frac{1}{24} \cdot \frac{1}{{im}^{2}}\right) + \color{blue}{{im}^{4} \cdot \frac{1}{720}}\right)\right)\right) \]
                      14. Simplified66.7%

                        \[\leadsto 1 + \left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)} \]

                      if 1.40000000000000006e123 < im

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right)} \]
                      4. Step-by-step derivation
                        1. distribute-lft-inN/A

                          \[\leadsto \cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)}\right) \]
                        2. associate-+r+N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)} \]
                        3. associate-*r*N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        4. associate-*r*N/A

                          \[\leadsto \left(\cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \cos re\right) + {im}^{\color{blue}{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        5. distribute-rgt1-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \color{blue}{{im}^{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left({im}^{2} \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos re} \]
                        7. unpow2N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(\left(im \cdot im\right) \cdot \frac{1}{2}\right) \cdot \cos re \]
                        8. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(im \cdot \frac{1}{2}\right)\right) \cdot \cos \color{blue}{re} \]
                        9. *-commutativeN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(\frac{1}{2} \cdot im\right)\right) \cdot \cos re \]
                        10. distribute-rgt-outN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) + im \cdot \left(\frac{1}{2} \cdot im\right)\right)} \]
                        11. associate-+r+N/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \color{blue}{\left(1 + im \cdot \left(\frac{1}{2} \cdot im\right)\right)}\right) \]
                        12. +-commutativeN/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(im \cdot \left(\frac{1}{2} \cdot im\right) + \color{blue}{1}\right)\right) \]
                      5. Simplified100.0%

                        \[\leadsto \color{blue}{\cos re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right) + 1\right)} \]
                      6. Taylor expanded in im around inf

                        \[\leadsto \color{blue}{\frac{1}{24} \cdot \left({im}^{4} \cdot \cos re\right)} \]
                      7. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \left(\frac{1}{24} \cdot {im}^{4}\right) \cdot \color{blue}{\cos re} \]
                        2. *-commutativeN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{4}\right)} \]
                        3. metadata-evalN/A

                          \[\leadsto \cos re \cdot \left(\frac{1}{24} \cdot {im}^{\left(2 \cdot \color{blue}{2}\right)}\right) \]
                        4. pow-sqrN/A

                          \[\leadsto \cos re \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right) \]
                        5. associate-*l*N/A

                          \[\leadsto \cos re \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \color{blue}{{im}^{2}}\right) \]
                        6. *-commutativeN/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right) \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\cos re, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right) \]
                        8. cos-lowering-cos.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\color{blue}{{im}^{2}} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)\right) \]
                        9. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24}} \cdot {im}^{2}\right)\right)\right) \]
                        10. associate-*l*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right)\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right)\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right) \]
                        13. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right) \]
                        15. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right) \]
                        16. *-lowering-*.f64100.0%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right) \]
                      8. Simplified100.0%

                        \[\leadsto \color{blue}{\cos re \cdot \left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)} \]
                      9. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{\frac{-1}{48} \cdot \left({im}^{4} \cdot {re}^{2}\right) + \frac{1}{24} \cdot {im}^{4}} \]
                      10. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \left(\frac{-1}{48} \cdot {im}^{4}\right) \cdot {re}^{2} + \color{blue}{\frac{1}{24}} \cdot {im}^{4} \]
                        2. +-commutativeN/A

                          \[\leadsto \frac{1}{24} \cdot {im}^{4} + \color{blue}{\left(\frac{-1}{48} \cdot {im}^{4}\right) \cdot {re}^{2}} \]
                        3. *-commutativeN/A

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + \color{blue}{\left(\frac{-1}{48} \cdot {im}^{4}\right)} \cdot {re}^{2} \]
                        4. associate-*r*N/A

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + \frac{-1}{48} \cdot \color{blue}{\left({im}^{4} \cdot {re}^{2}\right)} \]
                        5. *-commutativeN/A

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + \left({im}^{4} \cdot {re}^{2}\right) \cdot \color{blue}{\frac{-1}{48}} \]
                        6. associate-*l*N/A

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + {im}^{4} \cdot \color{blue}{\left({re}^{2} \cdot \frac{-1}{48}\right)} \]
                        7. distribute-lft-outN/A

                          \[\leadsto {im}^{4} \cdot \color{blue}{\left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)} \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\left({im}^{4}\right), \color{blue}{\left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)}\right) \]
                        9. metadata-evalN/A

                          \[\leadsto \mathsf{*.f64}\left(\left({im}^{\left(2 \cdot 2\right)}\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        10. pow-sqrN/A

                          \[\leadsto \mathsf{*.f64}\left(\left({im}^{2} \cdot {im}^{2}\right), \left(\color{blue}{\frac{1}{24}} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({im}^{2}\right), \left({im}^{2}\right)\right), \left(\color{blue}{\frac{1}{24}} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        12. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(im \cdot im\right), \left({im}^{2}\right)\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        13. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({im}^{2}\right)\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        14. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(im \cdot im\right)\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        15. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        16. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \color{blue}{\left({re}^{2} \cdot \frac{-1}{48}\right)}\right)\right) \]
                        17. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({re}^{2}\right), \color{blue}{\frac{-1}{48}}\right)\right)\right) \]
                        18. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{-1}{48}\right)\right)\right) \]
                        19. *-lowering-*.f6483.9%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{-1}{48}\right)\right)\right) \]
                      11. Simplified83.9%

                        \[\leadsto \color{blue}{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)} \]
                    3. Recombined 4 regimes into one program.
                    4. Add Preprocessing

                    Alternative 20: 58.2% accurate, 10.3× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 950:\\ \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\ \mathbf{elif}\;im \leq 3 \cdot 10^{+51}:\\ \;\;\;\;1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)\\ \mathbf{elif}\;im \leq 5 \cdot 10^{+123}:\\ \;\;\;\;1 + im \cdot \left(im \cdot \left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\ \end{array} \end{array} \]
                    (FPCore (re im)
                     :precision binary64
                     (if (<= im 950.0)
                       (+ 1.0 (* im (* im (+ 0.5 (* im (* im 0.041666666666666664))))))
                       (if (<= im 3e+51)
                         (+ 1.0 (* re (* re (+ -0.5 (* 0.041666666666666664 (* re re))))))
                         (if (<= im 5e+123)
                           (+ 1.0 (* im (* im (* im (* im (* (* im im) 0.001388888888888889))))))
                           (*
                            (* (* im im) (* im im))
                            (+ 0.041666666666666664 (* (* re re) -0.020833333333333332)))))))
                    double code(double re, double im) {
                    	double tmp;
                    	if (im <= 950.0) {
                    		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
                    	} else if (im <= 3e+51) {
                    		tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))));
                    	} else if (im <= 5e+123) {
                    		tmp = 1.0 + (im * (im * (im * (im * ((im * im) * 0.001388888888888889)))));
                    	} else {
                    		tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(re, im)
                        real(8), intent (in) :: re
                        real(8), intent (in) :: im
                        real(8) :: tmp
                        if (im <= 950.0d0) then
                            tmp = 1.0d0 + (im * (im * (0.5d0 + (im * (im * 0.041666666666666664d0)))))
                        else if (im <= 3d+51) then
                            tmp = 1.0d0 + (re * (re * ((-0.5d0) + (0.041666666666666664d0 * (re * re)))))
                        else if (im <= 5d+123) then
                            tmp = 1.0d0 + (im * (im * (im * (im * ((im * im) * 0.001388888888888889d0)))))
                        else
                            tmp = ((im * im) * (im * im)) * (0.041666666666666664d0 + ((re * re) * (-0.020833333333333332d0)))
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double re, double im) {
                    	double tmp;
                    	if (im <= 950.0) {
                    		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
                    	} else if (im <= 3e+51) {
                    		tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))));
                    	} else if (im <= 5e+123) {
                    		tmp = 1.0 + (im * (im * (im * (im * ((im * im) * 0.001388888888888889)))));
                    	} else {
                    		tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
                    	}
                    	return tmp;
                    }
                    
                    def code(re, im):
                    	tmp = 0
                    	if im <= 950.0:
                    		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))))
                    	elif im <= 3e+51:
                    		tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))))
                    	elif im <= 5e+123:
                    		tmp = 1.0 + (im * (im * (im * (im * ((im * im) * 0.001388888888888889)))))
                    	else:
                    		tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332))
                    	return tmp
                    
                    function code(re, im)
                    	tmp = 0.0
                    	if (im <= 950.0)
                    		tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664))))));
                    	elseif (im <= 3e+51)
                    		tmp = Float64(1.0 + Float64(re * Float64(re * Float64(-0.5 + Float64(0.041666666666666664 * Float64(re * re))))));
                    	elseif (im <= 5e+123)
                    		tmp = Float64(1.0 + Float64(im * Float64(im * Float64(im * Float64(im * Float64(Float64(im * im) * 0.001388888888888889))))));
                    	else
                    		tmp = Float64(Float64(Float64(im * im) * Float64(im * im)) * Float64(0.041666666666666664 + Float64(Float64(re * re) * -0.020833333333333332)));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(re, im)
                    	tmp = 0.0;
                    	if (im <= 950.0)
                    		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
                    	elseif (im <= 3e+51)
                    		tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))));
                    	elseif (im <= 5e+123)
                    		tmp = 1.0 + (im * (im * (im * (im * ((im * im) * 0.001388888888888889)))));
                    	else
                    		tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[re_, im_] := If[LessEqual[im, 950.0], N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 3e+51], N[(1.0 + N[(re * N[(re * N[(-0.5 + N[(0.041666666666666664 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 5e+123], N[(1.0 + N[(im * N[(im * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(re * re), $MachinePrecision] * -0.020833333333333332), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;im \leq 950:\\
                    \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\
                    
                    \mathbf{elif}\;im \leq 3 \cdot 10^{+51}:\\
                    \;\;\;\;1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)\\
                    
                    \mathbf{elif}\;im \leq 5 \cdot 10^{+123}:\\
                    \;\;\;\;1 + im \cdot \left(im \cdot \left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 4 regimes
                    2. if im < 950

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right)} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\cos re} \]
                        2. +-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified93.2%

                        \[\leadsto \color{blue}{\cos re \cdot \left(\left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)} \]
                      6. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)} \]
                      7. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)}\right) \]
                        2. +-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(\frac{1}{24} \cdot {im}^{4} + \left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}\right) + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right) \]
                        4. associate-+l+N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot {im}^{4} + \color{blue}{\left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4} + \frac{1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                        5. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot {im}^{\left(2 \cdot 2\right)} + \left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{\color{blue}{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        6. pow-sqrN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot \left({im}^{2} \cdot {im}^{2}\right) + \left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot \color{blue}{{im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        7. associate-*l*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot {im}^{2} + \left(\color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        8. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left({im}^{4} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        10. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \color{blue}{\left({im}^{4} \cdot \frac{1}{720} + \frac{1}{2}\right)}\right)\right) \]
                        12. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left(\left({im}^{2} \cdot {im}^{2}\right) \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        14. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \frac{1}{720}\right) + \frac{1}{2}\right)\right)\right) \]
                        15. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified59.7%

                        \[\leadsto \color{blue}{1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)} \]
                      9. Taylor expanded in im around 0

                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot im\right)}\right)\right)\right)\right)\right) \]
                      10. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                        2. *-lowering-*.f6453.8%

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                      11. Simplified53.8%

                        \[\leadsto 1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \color{blue}{\left(im \cdot 0.041666666666666664\right)}\right)\right) \]

                      if 950 < im < 3e51

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right)} \]
                      4. Step-by-step derivation
                        1. distribute-lft-inN/A

                          \[\leadsto \cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)}\right) \]
                        2. associate-+r+N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)} \]
                        3. associate-*r*N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        4. associate-*r*N/A

                          \[\leadsto \left(\cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \cos re\right) + {im}^{\color{blue}{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        5. distribute-rgt1-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \color{blue}{{im}^{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left({im}^{2} \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos re} \]
                        7. unpow2N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(\left(im \cdot im\right) \cdot \frac{1}{2}\right) \cdot \cos re \]
                        8. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(im \cdot \frac{1}{2}\right)\right) \cdot \cos \color{blue}{re} \]
                        9. *-commutativeN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(\frac{1}{2} \cdot im\right)\right) \cdot \cos re \]
                        10. distribute-rgt-outN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) + im \cdot \left(\frac{1}{2} \cdot im\right)\right)} \]
                        11. associate-+r+N/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \color{blue}{\left(1 + im \cdot \left(\frac{1}{2} \cdot im\right)\right)}\right) \]
                        12. +-commutativeN/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(im \cdot \left(\frac{1}{2} \cdot im\right) + \color{blue}{1}\right)\right) \]
                      5. Simplified4.2%

                        \[\leadsto \color{blue}{\cos re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right) + 1\right)} \]
                      6. Taylor expanded in re around 0

                        \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + {re}^{2} \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)}, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right), 1\right)\right) \]
                      7. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({re}^{2} \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right)}, 1\right)\right) \]
                        2. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({re}^{2}\right), \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \color{blue}{\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)\right)}\right), 1\right)\right) \]
                        3. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(re \cdot re\right), \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\color{blue}{\frac{1}{2}}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right), 1\right)\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\color{blue}{\frac{1}{2}}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right), 1\right)\right) \]
                        5. sub-negN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{1}{24} \cdot {re}^{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)}\right)\right), 1\right)\right) \]
                        6. metadata-evalN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{1}{24} \cdot {re}^{2} + \frac{-1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\mathsf{*.f64}\left(im, im\right)}\right)\right)\right), 1\right)\right) \]
                        7. +-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{-1}{2} + \frac{1}{24} \cdot {re}^{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)}\right)\right), 1\right)\right) \]
                        8. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left(\frac{1}{24} \cdot {re}^{2}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)}\right)\right), 1\right)\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left({re}^{2} \cdot \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\mathsf{*.f64}\left(im, im\right)}\right)\right)\right), 1\right)\right) \]
                        10. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left(\left(re \cdot re\right) \cdot \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\color{blue}{im}, im\right)\right)\right)\right), 1\right)\right) \]
                        11. associate-*l*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left(re \cdot \left(re \cdot \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\mathsf{*.f64}\left(im, im\right)}\right)\right)\right), 1\right)\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(re, \left(re \cdot \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\mathsf{*.f64}\left(im, im\right)}\right)\right)\right), 1\right)\right) \]
                        13. *-lowering-*.f6435.7%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right), 1\right)\right) \]
                      8. Simplified35.7%

                        \[\leadsto \color{blue}{\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + re \cdot \left(re \cdot 0.041666666666666664\right)\right)\right)} \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right) + 1\right) \]
                      9. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{1 + {re}^{2} \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)} \]
                      10. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left({re}^{2} \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)}\right) \]
                        2. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(re \cdot re\right) \cdot \left(\color{blue}{\frac{1}{24} \cdot {re}^{2}} - \frac{1}{2}\right)\right)\right) \]
                        3. associate-*l*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(re \cdot \color{blue}{\left(re \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \color{blue}{\left(re \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                        5. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \color{blue}{\left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)}\right)\right)\right) \]
                        6. sub-negN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{1}{24} \cdot {re}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right) \]
                        7. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{1}{24} \cdot {re}^{2} + \frac{-1}{2}\right)\right)\right)\right) \]
                        8. +-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{-1}{2} + \color{blue}{\frac{1}{24} \cdot {re}^{2}}\right)\right)\right)\right) \]
                        9. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{2}, \color{blue}{\left(\frac{1}{24} \cdot {re}^{2}\right)}\right)\right)\right)\right) \]
                        10. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\left({re}^{2}\right)}\right)\right)\right)\right)\right) \]
                        11. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \left(re \cdot \color{blue}{re}\right)\right)\right)\right)\right)\right) \]
                        12. *-lowering-*.f6428.8%

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \color{blue}{re}\right)\right)\right)\right)\right)\right) \]
                      11. Simplified28.8%

                        \[\leadsto \color{blue}{1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)} \]

                      if 3e51 < im < 4.99999999999999974e123

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right)} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\cos re} \]
                        2. +-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified100.0%

                        \[\leadsto \color{blue}{\cos re \cdot \left(\left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)} \]
                      6. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)} \]
                      7. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)}\right) \]
                        2. +-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(\frac{1}{24} \cdot {im}^{4} + \left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}\right) + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right) \]
                        4. associate-+l+N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot {im}^{4} + \color{blue}{\left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4} + \frac{1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                        5. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot {im}^{\left(2 \cdot 2\right)} + \left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{\color{blue}{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        6. pow-sqrN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot \left({im}^{2} \cdot {im}^{2}\right) + \left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot \color{blue}{{im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        7. associate-*l*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot {im}^{2} + \left(\color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        8. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left({im}^{4} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        10. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \color{blue}{\left({im}^{4} \cdot \frac{1}{720} + \frac{1}{2}\right)}\right)\right) \]
                        12. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left(\left({im}^{2} \cdot {im}^{2}\right) \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        14. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \frac{1}{720}\right) + \frac{1}{2}\right)\right)\right) \]
                        15. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified66.7%

                        \[\leadsto \color{blue}{1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)} \]
                      9. Taylor expanded in im around inf

                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{720} \cdot {im}^{4}\right)}\right)\right)\right) \]
                      10. Step-by-step derivation
                        1. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{720} \cdot {im}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right)\right)\right) \]
                        2. pow-sqrN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right)\right)\right)\right) \]
                        3. associate-*l*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot \color{blue}{{im}^{2}}\right)\right)\right)\right) \]
                        4. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right)}\right)\right)\right)\right) \]
                        5. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{720}} \cdot {im}^{2}\right)\right)\right)\right)\right) \]
                        6. associate-*l*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{720} \cdot {im}^{2}\right)\right)}\right)\right)\right)\right) \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \left(\frac{1}{720} \cdot {im}^{2}\right)\right)}\right)\right)\right)\right) \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right) \]
                        10. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right) \]
                        11. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right) \]
                        12. *-lowering-*.f6466.7%

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right) \]
                      11. Simplified66.7%

                        \[\leadsto 1 + im \cdot \left(im \cdot \color{blue}{\left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)}\right) \]

                      if 4.99999999999999974e123 < im

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right)} \]
                      4. Step-by-step derivation
                        1. distribute-lft-inN/A

                          \[\leadsto \cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)}\right) \]
                        2. associate-+r+N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)} \]
                        3. associate-*r*N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        4. associate-*r*N/A

                          \[\leadsto \left(\cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \cos re\right) + {im}^{\color{blue}{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        5. distribute-rgt1-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \color{blue}{{im}^{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left({im}^{2} \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos re} \]
                        7. unpow2N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(\left(im \cdot im\right) \cdot \frac{1}{2}\right) \cdot \cos re \]
                        8. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(im \cdot \frac{1}{2}\right)\right) \cdot \cos \color{blue}{re} \]
                        9. *-commutativeN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(\frac{1}{2} \cdot im\right)\right) \cdot \cos re \]
                        10. distribute-rgt-outN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) + im \cdot \left(\frac{1}{2} \cdot im\right)\right)} \]
                        11. associate-+r+N/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \color{blue}{\left(1 + im \cdot \left(\frac{1}{2} \cdot im\right)\right)}\right) \]
                        12. +-commutativeN/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(im \cdot \left(\frac{1}{2} \cdot im\right) + \color{blue}{1}\right)\right) \]
                      5. Simplified100.0%

                        \[\leadsto \color{blue}{\cos re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right) + 1\right)} \]
                      6. Taylor expanded in im around inf

                        \[\leadsto \color{blue}{\frac{1}{24} \cdot \left({im}^{4} \cdot \cos re\right)} \]
                      7. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \left(\frac{1}{24} \cdot {im}^{4}\right) \cdot \color{blue}{\cos re} \]
                        2. *-commutativeN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{4}\right)} \]
                        3. metadata-evalN/A

                          \[\leadsto \cos re \cdot \left(\frac{1}{24} \cdot {im}^{\left(2 \cdot \color{blue}{2}\right)}\right) \]
                        4. pow-sqrN/A

                          \[\leadsto \cos re \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right) \]
                        5. associate-*l*N/A

                          \[\leadsto \cos re \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \color{blue}{{im}^{2}}\right) \]
                        6. *-commutativeN/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right) \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\cos re, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right) \]
                        8. cos-lowering-cos.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\color{blue}{{im}^{2}} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)\right) \]
                        9. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24}} \cdot {im}^{2}\right)\right)\right) \]
                        10. associate-*l*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right)\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right)\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right) \]
                        13. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right) \]
                        15. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right) \]
                        16. *-lowering-*.f64100.0%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right) \]
                      8. Simplified100.0%

                        \[\leadsto \color{blue}{\cos re \cdot \left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)} \]
                      9. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{\frac{-1}{48} \cdot \left({im}^{4} \cdot {re}^{2}\right) + \frac{1}{24} \cdot {im}^{4}} \]
                      10. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \left(\frac{-1}{48} \cdot {im}^{4}\right) \cdot {re}^{2} + \color{blue}{\frac{1}{24}} \cdot {im}^{4} \]
                        2. +-commutativeN/A

                          \[\leadsto \frac{1}{24} \cdot {im}^{4} + \color{blue}{\left(\frac{-1}{48} \cdot {im}^{4}\right) \cdot {re}^{2}} \]
                        3. *-commutativeN/A

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + \color{blue}{\left(\frac{-1}{48} \cdot {im}^{4}\right)} \cdot {re}^{2} \]
                        4. associate-*r*N/A

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + \frac{-1}{48} \cdot \color{blue}{\left({im}^{4} \cdot {re}^{2}\right)} \]
                        5. *-commutativeN/A

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + \left({im}^{4} \cdot {re}^{2}\right) \cdot \color{blue}{\frac{-1}{48}} \]
                        6. associate-*l*N/A

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + {im}^{4} \cdot \color{blue}{\left({re}^{2} \cdot \frac{-1}{48}\right)} \]
                        7. distribute-lft-outN/A

                          \[\leadsto {im}^{4} \cdot \color{blue}{\left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)} \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\left({im}^{4}\right), \color{blue}{\left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)}\right) \]
                        9. metadata-evalN/A

                          \[\leadsto \mathsf{*.f64}\left(\left({im}^{\left(2 \cdot 2\right)}\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        10. pow-sqrN/A

                          \[\leadsto \mathsf{*.f64}\left(\left({im}^{2} \cdot {im}^{2}\right), \left(\color{blue}{\frac{1}{24}} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({im}^{2}\right), \left({im}^{2}\right)\right), \left(\color{blue}{\frac{1}{24}} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        12. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(im \cdot im\right), \left({im}^{2}\right)\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        13. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({im}^{2}\right)\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        14. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(im \cdot im\right)\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        15. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        16. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \color{blue}{\left({re}^{2} \cdot \frac{-1}{48}\right)}\right)\right) \]
                        17. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({re}^{2}\right), \color{blue}{\frac{-1}{48}}\right)\right)\right) \]
                        18. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{-1}{48}\right)\right)\right) \]
                        19. *-lowering-*.f6483.9%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{-1}{48}\right)\right)\right) \]
                      11. Simplified83.9%

                        \[\leadsto \color{blue}{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)} \]
                    3. Recombined 4 regimes into one program.
                    4. Add Preprocessing

                    Alternative 21: 56.4% accurate, 11.0× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\ \mathbf{if}\;im \leq 400:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;im \leq 6 \cdot 10^{+75}:\\ \;\;\;\;1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)\\ \mathbf{elif}\;im \leq 1.02 \cdot 10^{+139}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(im \cdot im\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.25\right)\\ \end{array} \end{array} \]
                    (FPCore (re im)
                     :precision binary64
                     (let* ((t_0 (+ 1.0 (* im (* im (+ 0.5 (* im (* im 0.041666666666666664))))))))
                       (if (<= im 400.0)
                         t_0
                         (if (<= im 6e+75)
                           (+ 1.0 (* re (* re (+ -0.5 (* 0.041666666666666664 (* re re))))))
                           (if (<= im 1.02e+139) t_0 (* (* im im) (+ 0.5 (* (* re re) -0.25))))))))
                    double code(double re, double im) {
                    	double t_0 = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
                    	double tmp;
                    	if (im <= 400.0) {
                    		tmp = t_0;
                    	} else if (im <= 6e+75) {
                    		tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))));
                    	} else if (im <= 1.02e+139) {
                    		tmp = t_0;
                    	} else {
                    		tmp = (im * im) * (0.5 + ((re * re) * -0.25));
                    	}
                    	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 = 1.0d0 + (im * (im * (0.5d0 + (im * (im * 0.041666666666666664d0)))))
                        if (im <= 400.0d0) then
                            tmp = t_0
                        else if (im <= 6d+75) then
                            tmp = 1.0d0 + (re * (re * ((-0.5d0) + (0.041666666666666664d0 * (re * re)))))
                        else if (im <= 1.02d+139) then
                            tmp = t_0
                        else
                            tmp = (im * im) * (0.5d0 + ((re * re) * (-0.25d0)))
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double re, double im) {
                    	double t_0 = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
                    	double tmp;
                    	if (im <= 400.0) {
                    		tmp = t_0;
                    	} else if (im <= 6e+75) {
                    		tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))));
                    	} else if (im <= 1.02e+139) {
                    		tmp = t_0;
                    	} else {
                    		tmp = (im * im) * (0.5 + ((re * re) * -0.25));
                    	}
                    	return tmp;
                    }
                    
                    def code(re, im):
                    	t_0 = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))))
                    	tmp = 0
                    	if im <= 400.0:
                    		tmp = t_0
                    	elif im <= 6e+75:
                    		tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))))
                    	elif im <= 1.02e+139:
                    		tmp = t_0
                    	else:
                    		tmp = (im * im) * (0.5 + ((re * re) * -0.25))
                    	return tmp
                    
                    function code(re, im)
                    	t_0 = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664))))))
                    	tmp = 0.0
                    	if (im <= 400.0)
                    		tmp = t_0;
                    	elseif (im <= 6e+75)
                    		tmp = Float64(1.0 + Float64(re * Float64(re * Float64(-0.5 + Float64(0.041666666666666664 * Float64(re * re))))));
                    	elseif (im <= 1.02e+139)
                    		tmp = t_0;
                    	else
                    		tmp = Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(re * re) * -0.25)));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(re, im)
                    	t_0 = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
                    	tmp = 0.0;
                    	if (im <= 400.0)
                    		tmp = t_0;
                    	elseif (im <= 6e+75)
                    		tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))));
                    	elseif (im <= 1.02e+139)
                    		tmp = t_0;
                    	else
                    		tmp = (im * im) * (0.5 + ((re * re) * -0.25));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[re_, im_] := Block[{t$95$0 = N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 400.0], t$95$0, If[LessEqual[im, 6e+75], N[(1.0 + N[(re * N[(re * N[(-0.5 + N[(0.041666666666666664 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.02e+139], t$95$0, N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := 1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\
                    \mathbf{if}\;im \leq 400:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;im \leq 6 \cdot 10^{+75}:\\
                    \;\;\;\;1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)\\
                    
                    \mathbf{elif}\;im \leq 1.02 \cdot 10^{+139}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(im \cdot im\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.25\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if im < 400 or 6e75 < im < 1.02e139

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right)} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\cos re} \]
                        2. +-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified93.6%

                        \[\leadsto \color{blue}{\cos re \cdot \left(\left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)} \]
                      6. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)} \]
                      7. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)}\right) \]
                        2. +-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(\frac{1}{24} \cdot {im}^{4} + \left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}\right) + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right) \]
                        4. associate-+l+N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot {im}^{4} + \color{blue}{\left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4} + \frac{1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                        5. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot {im}^{\left(2 \cdot 2\right)} + \left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{\color{blue}{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        6. pow-sqrN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot \left({im}^{2} \cdot {im}^{2}\right) + \left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot \color{blue}{{im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        7. associate-*l*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot {im}^{2} + \left(\color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        8. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left({im}^{4} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        10. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \color{blue}{\left({im}^{4} \cdot \frac{1}{720} + \frac{1}{2}\right)}\right)\right) \]
                        12. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left(\left({im}^{2} \cdot {im}^{2}\right) \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        14. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \frac{1}{720}\right) + \frac{1}{2}\right)\right)\right) \]
                        15. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified60.6%

                        \[\leadsto \color{blue}{1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)} \]
                      9. Taylor expanded in im around 0

                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot im\right)}\right)\right)\right)\right)\right) \]
                      10. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                        2. *-lowering-*.f6454.6%

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                      11. Simplified54.6%

                        \[\leadsto 1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \color{blue}{\left(im \cdot 0.041666666666666664\right)}\right)\right) \]

                      if 400 < im < 6e75

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right)} \]
                      4. Step-by-step derivation
                        1. distribute-lft-inN/A

                          \[\leadsto \cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)}\right) \]
                        2. associate-+r+N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)} \]
                        3. associate-*r*N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        4. associate-*r*N/A

                          \[\leadsto \left(\cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \cos re\right) + {im}^{\color{blue}{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        5. distribute-rgt1-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \color{blue}{{im}^{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left({im}^{2} \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos re} \]
                        7. unpow2N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(\left(im \cdot im\right) \cdot \frac{1}{2}\right) \cdot \cos re \]
                        8. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(im \cdot \frac{1}{2}\right)\right) \cdot \cos \color{blue}{re} \]
                        9. *-commutativeN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(\frac{1}{2} \cdot im\right)\right) \cdot \cos re \]
                        10. distribute-rgt-outN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) + im \cdot \left(\frac{1}{2} \cdot im\right)\right)} \]
                        11. associate-+r+N/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \color{blue}{\left(1 + im \cdot \left(\frac{1}{2} \cdot im\right)\right)}\right) \]
                        12. +-commutativeN/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(im \cdot \left(\frac{1}{2} \cdot im\right) + \color{blue}{1}\right)\right) \]
                      5. Simplified5.6%

                        \[\leadsto \color{blue}{\cos re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right) + 1\right)} \]
                      6. Taylor expanded in re around 0

                        \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + {re}^{2} \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)}, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right), 1\right)\right) \]
                      7. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({re}^{2} \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right)}, 1\right)\right) \]
                        2. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({re}^{2}\right), \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \color{blue}{\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)\right)}\right), 1\right)\right) \]
                        3. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(re \cdot re\right), \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\color{blue}{\frac{1}{2}}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right), 1\right)\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\color{blue}{\frac{1}{2}}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right), 1\right)\right) \]
                        5. sub-negN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{1}{24} \cdot {re}^{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)}\right)\right), 1\right)\right) \]
                        6. metadata-evalN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{1}{24} \cdot {re}^{2} + \frac{-1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\mathsf{*.f64}\left(im, im\right)}\right)\right)\right), 1\right)\right) \]
                        7. +-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{-1}{2} + \frac{1}{24} \cdot {re}^{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)}\right)\right), 1\right)\right) \]
                        8. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left(\frac{1}{24} \cdot {re}^{2}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)}\right)\right), 1\right)\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left({re}^{2} \cdot \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\mathsf{*.f64}\left(im, im\right)}\right)\right)\right), 1\right)\right) \]
                        10. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left(\left(re \cdot re\right) \cdot \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\color{blue}{im}, im\right)\right)\right)\right), 1\right)\right) \]
                        11. associate-*l*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left(re \cdot \left(re \cdot \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\mathsf{*.f64}\left(im, im\right)}\right)\right)\right), 1\right)\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(re, \left(re \cdot \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\mathsf{*.f64}\left(im, im\right)}\right)\right)\right), 1\right)\right) \]
                        13. *-lowering-*.f6436.6%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right), 1\right)\right) \]
                      8. Simplified36.6%

                        \[\leadsto \color{blue}{\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + re \cdot \left(re \cdot 0.041666666666666664\right)\right)\right)} \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right) + 1\right) \]
                      9. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{1 + {re}^{2} \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)} \]
                      10. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left({re}^{2} \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)}\right) \]
                        2. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(re \cdot re\right) \cdot \left(\color{blue}{\frac{1}{24} \cdot {re}^{2}} - \frac{1}{2}\right)\right)\right) \]
                        3. associate-*l*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(re \cdot \color{blue}{\left(re \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \color{blue}{\left(re \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                        5. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \color{blue}{\left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)}\right)\right)\right) \]
                        6. sub-negN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{1}{24} \cdot {re}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right) \]
                        7. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{1}{24} \cdot {re}^{2} + \frac{-1}{2}\right)\right)\right)\right) \]
                        8. +-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{-1}{2} + \color{blue}{\frac{1}{24} \cdot {re}^{2}}\right)\right)\right)\right) \]
                        9. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{2}, \color{blue}{\left(\frac{1}{24} \cdot {re}^{2}\right)}\right)\right)\right)\right) \]
                        10. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\left({re}^{2}\right)}\right)\right)\right)\right)\right) \]
                        11. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \left(re \cdot \color{blue}{re}\right)\right)\right)\right)\right)\right) \]
                        12. *-lowering-*.f6427.9%

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \color{blue}{re}\right)\right)\right)\right)\right)\right) \]
                      11. Simplified27.9%

                        \[\leadsto \color{blue}{1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)} \]

                      if 1.02e139 < im

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + \frac{1}{2} \cdot \left({im}^{2} \cdot \cos re\right)} \]
                      4. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \cos re + \left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{\cos re} \]
                        2. distribute-rgt1-inN/A

                          \[\leadsto \left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \color{blue}{\cos re} \]
                        3. unpow2N/A

                          \[\leadsto \left(\frac{1}{2} \cdot \left(im \cdot im\right) + 1\right) \cdot \cos re \]
                        4. associate-*r*N/A

                          \[\leadsto \left(\left(\frac{1}{2} \cdot im\right) \cdot im + 1\right) \cdot \cos re \]
                        5. *-commutativeN/A

                          \[\leadsto \left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right) \cdot \cos re \]
                        6. *-commutativeN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right)} \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\cos re, \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right)}\right) \]
                        8. cos-lowering-cos.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right)\right) \]
                        9. +-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(1 + \color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)}\right)\right) \]
                        10. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right)\right)}\right)\right) \]
                        11. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\left(\frac{1}{2} \cdot im\right) \cdot \color{blue}{im}\right)\right)\right) \]
                        12. associate-*r*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)}\right)\right)\right) \]
                        13. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot {im}^{\color{blue}{2}}\right)\right)\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                        15. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                        16. *-lowering-*.f6496.8%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.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. Simplified96.8%

                        \[\leadsto \color{blue}{\cos re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
                      6. Taylor expanded in im around inf

                        \[\leadsto \color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \cos re\right)} \]
                      7. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{\cos re} \]
                        2. *-commutativeN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right)} \]
                        3. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\cos re, \color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right)}\right) \]
                        4. cos-lowering-cos.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right) \]
                        5. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right) \]
                        6. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right) \]
                        7. *-lowering-*.f6496.8%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right) \]
                      8. Simplified96.8%

                        \[\leadsto \color{blue}{\cos re \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)} \]
                      9. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{\frac{-1}{4} \cdot \left({im}^{2} \cdot {re}^{2}\right) + \frac{1}{2} \cdot {im}^{2}} \]
                      10. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \left(\frac{-1}{4} \cdot {im}^{2}\right) \cdot {re}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2} \]
                        2. +-commutativeN/A

                          \[\leadsto \frac{1}{2} \cdot {im}^{2} + \color{blue}{\left(\frac{-1}{4} \cdot {im}^{2}\right) \cdot {re}^{2}} \]
                        3. *-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \frac{1}{2} + \color{blue}{\left(\frac{-1}{4} \cdot {im}^{2}\right)} \cdot {re}^{2} \]
                        4. associate-*r*N/A

                          \[\leadsto {im}^{2} \cdot \frac{1}{2} + \frac{-1}{4} \cdot \color{blue}{\left({im}^{2} \cdot {re}^{2}\right)} \]
                        5. *-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \frac{1}{2} + \left({im}^{2} \cdot {re}^{2}\right) \cdot \color{blue}{\frac{-1}{4}} \]
                        6. associate-*l*N/A

                          \[\leadsto {im}^{2} \cdot \frac{1}{2} + {im}^{2} \cdot \color{blue}{\left({re}^{2} \cdot \frac{-1}{4}\right)} \]
                        7. distribute-lft-outN/A

                          \[\leadsto {im}^{2} \cdot \color{blue}{\left(\frac{1}{2} + {re}^{2} \cdot \frac{-1}{4}\right)} \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\left(\frac{1}{2} + {re}^{2} \cdot \frac{-1}{4}\right)}\right) \]
                        9. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\left(im \cdot im\right), \left(\color{blue}{\frac{1}{2}} + {re}^{2} \cdot \frac{-1}{4}\right)\right) \]
                        10. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\color{blue}{\frac{1}{2}} + {re}^{2} \cdot \frac{-1}{4}\right)\right) \]
                        11. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left({re}^{2} \cdot \frac{-1}{4}\right)}\right)\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left({re}^{2}\right), \color{blue}{\frac{-1}{4}}\right)\right)\right) \]
                        13. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{-1}{4}\right)\right)\right) \]
                        14. *-lowering-*.f6482.8%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{-1}{4}\right)\right)\right) \]
                      11. Simplified82.8%

                        \[\leadsto \color{blue}{\left(im \cdot im\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.25\right)} \]
                    3. Recombined 3 regimes into one program.
                    4. Add Preprocessing

                    Alternative 22: 51.5% accurate, 11.8× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(im \cdot im\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.25\right)\\ \mathbf{if}\;im \leq 760000:\\ \;\;\;\;1 + 0.5 \cdot \left(im \cdot im\right)\\ \mathbf{elif}\;im \leq 2.15 \cdot 10^{+77}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;im \leq 1.02 \cdot 10^{+139}:\\ \;\;\;\;im \cdot \left(im \cdot \left(0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                    (FPCore (re im)
                     :precision binary64
                     (let* ((t_0 (* (* im im) (+ 0.5 (* (* re re) -0.25)))))
                       (if (<= im 760000.0)
                         (+ 1.0 (* 0.5 (* im im)))
                         (if (<= im 2.15e+77)
                           t_0
                           (if (<= im 1.02e+139)
                             (* im (* im (* 0.041666666666666664 (* im im))))
                             t_0)))))
                    double code(double re, double im) {
                    	double t_0 = (im * im) * (0.5 + ((re * re) * -0.25));
                    	double tmp;
                    	if (im <= 760000.0) {
                    		tmp = 1.0 + (0.5 * (im * im));
                    	} else if (im <= 2.15e+77) {
                    		tmp = t_0;
                    	} else if (im <= 1.02e+139) {
                    		tmp = im * (im * (0.041666666666666664 * (im * im)));
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(re, im)
                        real(8), intent (in) :: re
                        real(8), intent (in) :: im
                        real(8) :: t_0
                        real(8) :: tmp
                        t_0 = (im * im) * (0.5d0 + ((re * re) * (-0.25d0)))
                        if (im <= 760000.0d0) then
                            tmp = 1.0d0 + (0.5d0 * (im * im))
                        else if (im <= 2.15d+77) then
                            tmp = t_0
                        else if (im <= 1.02d+139) then
                            tmp = im * (im * (0.041666666666666664d0 * (im * im)))
                        else
                            tmp = t_0
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double re, double im) {
                    	double t_0 = (im * im) * (0.5 + ((re * re) * -0.25));
                    	double tmp;
                    	if (im <= 760000.0) {
                    		tmp = 1.0 + (0.5 * (im * im));
                    	} else if (im <= 2.15e+77) {
                    		tmp = t_0;
                    	} else if (im <= 1.02e+139) {
                    		tmp = im * (im * (0.041666666666666664 * (im * im)));
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    def code(re, im):
                    	t_0 = (im * im) * (0.5 + ((re * re) * -0.25))
                    	tmp = 0
                    	if im <= 760000.0:
                    		tmp = 1.0 + (0.5 * (im * im))
                    	elif im <= 2.15e+77:
                    		tmp = t_0
                    	elif im <= 1.02e+139:
                    		tmp = im * (im * (0.041666666666666664 * (im * im)))
                    	else:
                    		tmp = t_0
                    	return tmp
                    
                    function code(re, im)
                    	t_0 = Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(re * re) * -0.25)))
                    	tmp = 0.0
                    	if (im <= 760000.0)
                    		tmp = Float64(1.0 + Float64(0.5 * Float64(im * im)));
                    	elseif (im <= 2.15e+77)
                    		tmp = t_0;
                    	elseif (im <= 1.02e+139)
                    		tmp = Float64(im * Float64(im * Float64(0.041666666666666664 * Float64(im * im))));
                    	else
                    		tmp = t_0;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(re, im)
                    	t_0 = (im * im) * (0.5 + ((re * re) * -0.25));
                    	tmp = 0.0;
                    	if (im <= 760000.0)
                    		tmp = 1.0 + (0.5 * (im * im));
                    	elseif (im <= 2.15e+77)
                    		tmp = t_0;
                    	elseif (im <= 1.02e+139)
                    		tmp = im * (im * (0.041666666666666664 * (im * im)));
                    	else
                    		tmp = t_0;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[re_, im_] := Block[{t$95$0 = N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 760000.0], N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 2.15e+77], t$95$0, If[LessEqual[im, 1.02e+139], N[(im * N[(im * N[(0.041666666666666664 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := \left(im \cdot im\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.25\right)\\
                    \mathbf{if}\;im \leq 760000:\\
                    \;\;\;\;1 + 0.5 \cdot \left(im \cdot im\right)\\
                    
                    \mathbf{elif}\;im \leq 2.15 \cdot 10^{+77}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;im \leq 1.02 \cdot 10^{+139}:\\
                    \;\;\;\;im \cdot \left(im \cdot \left(0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if im < 7.6e5

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + \frac{1}{2} \cdot \left({im}^{2} \cdot \cos re\right)} \]
                      4. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \cos re + \left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{\cos re} \]
                        2. distribute-rgt1-inN/A

                          \[\leadsto \left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \color{blue}{\cos re} \]
                        3. unpow2N/A

                          \[\leadsto \left(\frac{1}{2} \cdot \left(im \cdot im\right) + 1\right) \cdot \cos re \]
                        4. associate-*r*N/A

                          \[\leadsto \left(\left(\frac{1}{2} \cdot im\right) \cdot im + 1\right) \cdot \cos re \]
                        5. *-commutativeN/A

                          \[\leadsto \left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right) \cdot \cos re \]
                        6. *-commutativeN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right)} \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\cos re, \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right)}\right) \]
                        8. cos-lowering-cos.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right)\right) \]
                        9. +-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(1 + \color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)}\right)\right) \]
                        10. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right)\right)}\right)\right) \]
                        11. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\left(\frac{1}{2} \cdot im\right) \cdot \color{blue}{im}\right)\right)\right) \]
                        12. associate-*r*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)}\right)\right)\right) \]
                        13. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot {im}^{\color{blue}{2}}\right)\right)\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                        15. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                        16. *-lowering-*.f6479.3%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.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.3%

                        \[\leadsto \color{blue}{\cos re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
                      6. Taylor expanded in re 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-*.f6447.9%

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right) \]
                      8. Simplified47.9%

                        \[\leadsto \color{blue}{1 + 0.5 \cdot \left(im \cdot im\right)} \]

                      if 7.6e5 < im < 2.14999999999999996e77 or 1.02e139 < im

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + \frac{1}{2} \cdot \left({im}^{2} \cdot \cos re\right)} \]
                      4. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \cos re + \left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{\cos re} \]
                        2. distribute-rgt1-inN/A

                          \[\leadsto \left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \color{blue}{\cos re} \]
                        3. unpow2N/A

                          \[\leadsto \left(\frac{1}{2} \cdot \left(im \cdot im\right) + 1\right) \cdot \cos re \]
                        4. associate-*r*N/A

                          \[\leadsto \left(\left(\frac{1}{2} \cdot im\right) \cdot im + 1\right) \cdot \cos re \]
                        5. *-commutativeN/A

                          \[\leadsto \left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right) \cdot \cos re \]
                        6. *-commutativeN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right)} \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\cos re, \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right)}\right) \]
                        8. cos-lowering-cos.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right)\right) \]
                        9. +-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(1 + \color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)}\right)\right) \]
                        10. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right)\right)}\right)\right) \]
                        11. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\left(\frac{1}{2} \cdot im\right) \cdot \color{blue}{im}\right)\right)\right) \]
                        12. associate-*r*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)}\right)\right)\right) \]
                        13. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot {im}^{\color{blue}{2}}\right)\right)\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                        15. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                        16. *-lowering-*.f6454.8%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.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. Simplified54.8%

                        \[\leadsto \color{blue}{\cos re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
                      6. Taylor expanded in im around inf

                        \[\leadsto \color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \cos re\right)} \]
                      7. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{\cos re} \]
                        2. *-commutativeN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right)} \]
                        3. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\cos re, \color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right)}\right) \]
                        4. cos-lowering-cos.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right) \]
                        5. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right) \]
                        6. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right) \]
                        7. *-lowering-*.f6454.8%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right) \]
                      8. Simplified54.8%

                        \[\leadsto \color{blue}{\cos re \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)} \]
                      9. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{\frac{-1}{4} \cdot \left({im}^{2} \cdot {re}^{2}\right) + \frac{1}{2} \cdot {im}^{2}} \]
                      10. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \left(\frac{-1}{4} \cdot {im}^{2}\right) \cdot {re}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2} \]
                        2. +-commutativeN/A

                          \[\leadsto \frac{1}{2} \cdot {im}^{2} + \color{blue}{\left(\frac{-1}{4} \cdot {im}^{2}\right) \cdot {re}^{2}} \]
                        3. *-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \frac{1}{2} + \color{blue}{\left(\frac{-1}{4} \cdot {im}^{2}\right)} \cdot {re}^{2} \]
                        4. associate-*r*N/A

                          \[\leadsto {im}^{2} \cdot \frac{1}{2} + \frac{-1}{4} \cdot \color{blue}{\left({im}^{2} \cdot {re}^{2}\right)} \]
                        5. *-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \frac{1}{2} + \left({im}^{2} \cdot {re}^{2}\right) \cdot \color{blue}{\frac{-1}{4}} \]
                        6. associate-*l*N/A

                          \[\leadsto {im}^{2} \cdot \frac{1}{2} + {im}^{2} \cdot \color{blue}{\left({re}^{2} \cdot \frac{-1}{4}\right)} \]
                        7. distribute-lft-outN/A

                          \[\leadsto {im}^{2} \cdot \color{blue}{\left(\frac{1}{2} + {re}^{2} \cdot \frac{-1}{4}\right)} \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\left(\frac{1}{2} + {re}^{2} \cdot \frac{-1}{4}\right)}\right) \]
                        9. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\left(im \cdot im\right), \left(\color{blue}{\frac{1}{2}} + {re}^{2} \cdot \frac{-1}{4}\right)\right) \]
                        10. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\color{blue}{\frac{1}{2}} + {re}^{2} \cdot \frac{-1}{4}\right)\right) \]
                        11. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left({re}^{2} \cdot \frac{-1}{4}\right)}\right)\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left({re}^{2}\right), \color{blue}{\frac{-1}{4}}\right)\right)\right) \]
                        13. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{-1}{4}\right)\right)\right) \]
                        14. *-lowering-*.f6451.9%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{-1}{4}\right)\right)\right) \]
                      11. Simplified51.9%

                        \[\leadsto \color{blue}{\left(im \cdot im\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.25\right)} \]

                      if 2.14999999999999996e77 < im < 1.02e139

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right)} \]
                      4. Step-by-step derivation
                        1. distribute-lft-inN/A

                          \[\leadsto \cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)}\right) \]
                        2. associate-+r+N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)} \]
                        3. associate-*r*N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        4. associate-*r*N/A

                          \[\leadsto \left(\cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \cos re\right) + {im}^{\color{blue}{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        5. distribute-rgt1-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \color{blue}{{im}^{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left({im}^{2} \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos re} \]
                        7. unpow2N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(\left(im \cdot im\right) \cdot \frac{1}{2}\right) \cdot \cos re \]
                        8. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(im \cdot \frac{1}{2}\right)\right) \cdot \cos \color{blue}{re} \]
                        9. *-commutativeN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(\frac{1}{2} \cdot im\right)\right) \cdot \cos re \]
                        10. distribute-rgt-outN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) + im \cdot \left(\frac{1}{2} \cdot im\right)\right)} \]
                        11. associate-+r+N/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \color{blue}{\left(1 + im \cdot \left(\frac{1}{2} \cdot im\right)\right)}\right) \]
                        12. +-commutativeN/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(im \cdot \left(\frac{1}{2} \cdot im\right) + \color{blue}{1}\right)\right) \]
                      5. Simplified100.0%

                        \[\leadsto \color{blue}{\cos re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right) + 1\right)} \]
                      6. Taylor expanded in im around inf

                        \[\leadsto \color{blue}{\frac{1}{24} \cdot \left({im}^{4} \cdot \cos re\right)} \]
                      7. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \left(\frac{1}{24} \cdot {im}^{4}\right) \cdot \color{blue}{\cos re} \]
                        2. *-commutativeN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{4}\right)} \]
                        3. metadata-evalN/A

                          \[\leadsto \cos re \cdot \left(\frac{1}{24} \cdot {im}^{\left(2 \cdot \color{blue}{2}\right)}\right) \]
                        4. pow-sqrN/A

                          \[\leadsto \cos re \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right) \]
                        5. associate-*l*N/A

                          \[\leadsto \cos re \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \color{blue}{{im}^{2}}\right) \]
                        6. *-commutativeN/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right) \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\cos re, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right) \]
                        8. cos-lowering-cos.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\color{blue}{{im}^{2}} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)\right) \]
                        9. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24}} \cdot {im}^{2}\right)\right)\right) \]
                        10. associate-*l*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right)\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right)\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right) \]
                        13. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right) \]
                        15. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right) \]
                        16. *-lowering-*.f64100.0%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right) \]
                      8. Simplified100.0%

                        \[\leadsto \color{blue}{\cos re \cdot \left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)} \]
                      9. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{\frac{1}{24} \cdot {im}^{4}} \]
                      10. Step-by-step derivation
                        1. metadata-evalN/A

                          \[\leadsto \frac{1}{24} \cdot {im}^{\left(2 \cdot \color{blue}{2}\right)} \]
                        2. pow-sqrN/A

                          \[\leadsto \frac{1}{24} \cdot \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right) \]
                        3. associate-*l*N/A

                          \[\leadsto \left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \color{blue}{{im}^{2}} \]
                        4. *-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)} \]
                        5. unpow2N/A

                          \[\leadsto \left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24}} \cdot {im}^{2}\right) \]
                        6. associate-*l*N/A

                          \[\leadsto im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)} \]
                        7. *-commutativeN/A

                          \[\leadsto im \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \color{blue}{im}\right) \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(im, \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot im\right)}\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right) \]
                        10. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right) \]
                        11. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right) \]
                        13. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right) \]
                        14. *-lowering-*.f6472.7%

                          \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right) \]
                      11. Simplified72.7%

                        \[\leadsto \color{blue}{im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)} \]
                    3. Recombined 3 regimes into one program.
                    4. Final simplification49.8%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 760000:\\ \;\;\;\;1 + 0.5 \cdot \left(im \cdot im\right)\\ \mathbf{elif}\;im \leq 2.15 \cdot 10^{+77}:\\ \;\;\;\;\left(im \cdot im\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.25\right)\\ \mathbf{elif}\;im \leq 1.02 \cdot 10^{+139}:\\ \;\;\;\;im \cdot \left(im \cdot \left(0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(im \cdot im\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.25\right)\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 23: 57.5% accurate, 12.3× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 380:\\ \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\ \mathbf{elif}\;im \leq 1.05 \cdot 10^{+51}:\\ \;\;\;\;1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\ \end{array} \end{array} \]
                    (FPCore (re im)
                     :precision binary64
                     (if (<= im 380.0)
                       (+ 1.0 (* im (* im (+ 0.5 (* im (* im 0.041666666666666664))))))
                       (if (<= im 1.05e+51)
                         (+ 1.0 (* re (* re (+ -0.5 (* 0.041666666666666664 (* re re))))))
                         (*
                          (* (* im im) (* im im))
                          (+ 0.041666666666666664 (* (* re re) -0.020833333333333332))))))
                    double code(double re, double im) {
                    	double tmp;
                    	if (im <= 380.0) {
                    		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
                    	} else if (im <= 1.05e+51) {
                    		tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))));
                    	} else {
                    		tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(re, im)
                        real(8), intent (in) :: re
                        real(8), intent (in) :: im
                        real(8) :: tmp
                        if (im <= 380.0d0) then
                            tmp = 1.0d0 + (im * (im * (0.5d0 + (im * (im * 0.041666666666666664d0)))))
                        else if (im <= 1.05d+51) then
                            tmp = 1.0d0 + (re * (re * ((-0.5d0) + (0.041666666666666664d0 * (re * re)))))
                        else
                            tmp = ((im * im) * (im * im)) * (0.041666666666666664d0 + ((re * re) * (-0.020833333333333332d0)))
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double re, double im) {
                    	double tmp;
                    	if (im <= 380.0) {
                    		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
                    	} else if (im <= 1.05e+51) {
                    		tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))));
                    	} else {
                    		tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
                    	}
                    	return tmp;
                    }
                    
                    def code(re, im):
                    	tmp = 0
                    	if im <= 380.0:
                    		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))))
                    	elif im <= 1.05e+51:
                    		tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))))
                    	else:
                    		tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332))
                    	return tmp
                    
                    function code(re, im)
                    	tmp = 0.0
                    	if (im <= 380.0)
                    		tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664))))));
                    	elseif (im <= 1.05e+51)
                    		tmp = Float64(1.0 + Float64(re * Float64(re * Float64(-0.5 + Float64(0.041666666666666664 * Float64(re * re))))));
                    	else
                    		tmp = Float64(Float64(Float64(im * im) * Float64(im * im)) * Float64(0.041666666666666664 + Float64(Float64(re * re) * -0.020833333333333332)));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(re, im)
                    	tmp = 0.0;
                    	if (im <= 380.0)
                    		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
                    	elseif (im <= 1.05e+51)
                    		tmp = 1.0 + (re * (re * (-0.5 + (0.041666666666666664 * (re * re)))));
                    	else
                    		tmp = ((im * im) * (im * im)) * (0.041666666666666664 + ((re * re) * -0.020833333333333332));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[re_, im_] := If[LessEqual[im, 380.0], N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.05e+51], N[(1.0 + N[(re * N[(re * N[(-0.5 + N[(0.041666666666666664 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(re * re), $MachinePrecision] * -0.020833333333333332), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;im \leq 380:\\
                    \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\
                    
                    \mathbf{elif}\;im \leq 1.05 \cdot 10^{+51}:\\
                    \;\;\;\;1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if im < 380

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right)} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\cos re} \]
                        2. +-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified93.2%

                        \[\leadsto \color{blue}{\cos re \cdot \left(\left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)} \]
                      6. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)} \]
                      7. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)}\right) \]
                        2. +-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(\frac{1}{24} \cdot {im}^{4} + \left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}\right) + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right) \]
                        4. associate-+l+N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot {im}^{4} + \color{blue}{\left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4} + \frac{1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                        5. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot {im}^{\left(2 \cdot 2\right)} + \left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{\color{blue}{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        6. pow-sqrN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot \left({im}^{2} \cdot {im}^{2}\right) + \left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot \color{blue}{{im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        7. associate-*l*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot {im}^{2} + \left(\color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        8. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left({im}^{4} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        10. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \color{blue}{\left({im}^{4} \cdot \frac{1}{720} + \frac{1}{2}\right)}\right)\right) \]
                        12. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left(\left({im}^{2} \cdot {im}^{2}\right) \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        14. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \frac{1}{720}\right) + \frac{1}{2}\right)\right)\right) \]
                        15. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified59.7%

                        \[\leadsto \color{blue}{1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)} \]
                      9. Taylor expanded in im around 0

                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot im\right)}\right)\right)\right)\right)\right) \]
                      10. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                        2. *-lowering-*.f6453.8%

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                      11. Simplified53.8%

                        \[\leadsto 1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \color{blue}{\left(im \cdot 0.041666666666666664\right)}\right)\right) \]

                      if 380 < im < 1.0500000000000001e51

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right)} \]
                      4. Step-by-step derivation
                        1. distribute-lft-inN/A

                          \[\leadsto \cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)}\right) \]
                        2. associate-+r+N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)} \]
                        3. associate-*r*N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        4. associate-*r*N/A

                          \[\leadsto \left(\cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \cos re\right) + {im}^{\color{blue}{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        5. distribute-rgt1-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \color{blue}{{im}^{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left({im}^{2} \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos re} \]
                        7. unpow2N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(\left(im \cdot im\right) \cdot \frac{1}{2}\right) \cdot \cos re \]
                        8. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(im \cdot \frac{1}{2}\right)\right) \cdot \cos \color{blue}{re} \]
                        9. *-commutativeN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(\frac{1}{2} \cdot im\right)\right) \cdot \cos re \]
                        10. distribute-rgt-outN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) + im \cdot \left(\frac{1}{2} \cdot im\right)\right)} \]
                        11. associate-+r+N/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \color{blue}{\left(1 + im \cdot \left(\frac{1}{2} \cdot im\right)\right)}\right) \]
                        12. +-commutativeN/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(im \cdot \left(\frac{1}{2} \cdot im\right) + \color{blue}{1}\right)\right) \]
                      5. Simplified4.2%

                        \[\leadsto \color{blue}{\cos re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right) + 1\right)} \]
                      6. Taylor expanded in re around 0

                        \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + {re}^{2} \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)}, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right), 1\right)\right) \]
                      7. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({re}^{2} \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right)}, 1\right)\right) \]
                        2. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({re}^{2}\right), \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \color{blue}{\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)\right)}\right), 1\right)\right) \]
                        3. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(re \cdot re\right), \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\color{blue}{\frac{1}{2}}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right), 1\right)\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\color{blue}{\frac{1}{2}}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right), 1\right)\right) \]
                        5. sub-negN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{1}{24} \cdot {re}^{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)}\right)\right), 1\right)\right) \]
                        6. metadata-evalN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{1}{24} \cdot {re}^{2} + \frac{-1}{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\mathsf{*.f64}\left(im, im\right)}\right)\right)\right), 1\right)\right) \]
                        7. +-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{-1}{2} + \frac{1}{24} \cdot {re}^{2}\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)}\right)\right), 1\right)\right) \]
                        8. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left(\frac{1}{24} \cdot {re}^{2}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, im\right)\right)}\right)\right), 1\right)\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left({re}^{2} \cdot \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\mathsf{*.f64}\left(im, im\right)}\right)\right)\right), 1\right)\right) \]
                        10. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left(\left(re \cdot re\right) \cdot \frac{1}{24}\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\color{blue}{im}, im\right)\right)\right)\right), 1\right)\right) \]
                        11. associate-*l*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \left(re \cdot \left(re \cdot \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\mathsf{*.f64}\left(im, im\right)}\right)\right)\right), 1\right)\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(re, \left(re \cdot \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\mathsf{*.f64}\left(im, im\right)}\right)\right)\right), 1\right)\right) \]
                        13. *-lowering-*.f6435.7%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right)\right), 1\right)\right) \]
                      8. Simplified35.7%

                        \[\leadsto \color{blue}{\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + re \cdot \left(re \cdot 0.041666666666666664\right)\right)\right)} \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right) + 1\right) \]
                      9. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{1 + {re}^{2} \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)} \]
                      10. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left({re}^{2} \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)}\right) \]
                        2. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(re \cdot re\right) \cdot \left(\color{blue}{\frac{1}{24} \cdot {re}^{2}} - \frac{1}{2}\right)\right)\right) \]
                        3. associate-*l*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(re \cdot \color{blue}{\left(re \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \color{blue}{\left(re \cdot \left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)\right)}\right)\right) \]
                        5. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \color{blue}{\left(\frac{1}{24} \cdot {re}^{2} - \frac{1}{2}\right)}\right)\right)\right) \]
                        6. sub-negN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{1}{24} \cdot {re}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right) \]
                        7. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{1}{24} \cdot {re}^{2} + \frac{-1}{2}\right)\right)\right)\right) \]
                        8. +-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{-1}{2} + \color{blue}{\frac{1}{24} \cdot {re}^{2}}\right)\right)\right)\right) \]
                        9. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{2}, \color{blue}{\left(\frac{1}{24} \cdot {re}^{2}\right)}\right)\right)\right)\right) \]
                        10. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \color{blue}{\left({re}^{2}\right)}\right)\right)\right)\right)\right) \]
                        11. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \left(re \cdot \color{blue}{re}\right)\right)\right)\right)\right)\right) \]
                        12. *-lowering-*.f6428.8%

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \color{blue}{re}\right)\right)\right)\right)\right)\right) \]
                      11. Simplified28.8%

                        \[\leadsto \color{blue}{1 + re \cdot \left(re \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)} \]

                      if 1.0500000000000001e51 < im

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right)} \]
                      4. Step-by-step derivation
                        1. distribute-lft-inN/A

                          \[\leadsto \cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)}\right) \]
                        2. associate-+r+N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)} \]
                        3. associate-*r*N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        4. associate-*r*N/A

                          \[\leadsto \left(\cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \cos re\right) + {im}^{\color{blue}{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        5. distribute-rgt1-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \color{blue}{{im}^{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left({im}^{2} \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos re} \]
                        7. unpow2N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(\left(im \cdot im\right) \cdot \frac{1}{2}\right) \cdot \cos re \]
                        8. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(im \cdot \frac{1}{2}\right)\right) \cdot \cos \color{blue}{re} \]
                        9. *-commutativeN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(\frac{1}{2} \cdot im\right)\right) \cdot \cos re \]
                        10. distribute-rgt-outN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) + im \cdot \left(\frac{1}{2} \cdot im\right)\right)} \]
                        11. associate-+r+N/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \color{blue}{\left(1 + im \cdot \left(\frac{1}{2} \cdot im\right)\right)}\right) \]
                        12. +-commutativeN/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(im \cdot \left(\frac{1}{2} \cdot im\right) + \color{blue}{1}\right)\right) \]
                      5. Simplified83.2%

                        \[\leadsto \color{blue}{\cos re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right) + 1\right)} \]
                      6. Taylor expanded in im around inf

                        \[\leadsto \color{blue}{\frac{1}{24} \cdot \left({im}^{4} \cdot \cos re\right)} \]
                      7. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \left(\frac{1}{24} \cdot {im}^{4}\right) \cdot \color{blue}{\cos re} \]
                        2. *-commutativeN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{4}\right)} \]
                        3. metadata-evalN/A

                          \[\leadsto \cos re \cdot \left(\frac{1}{24} \cdot {im}^{\left(2 \cdot \color{blue}{2}\right)}\right) \]
                        4. pow-sqrN/A

                          \[\leadsto \cos re \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right) \]
                        5. associate-*l*N/A

                          \[\leadsto \cos re \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \color{blue}{{im}^{2}}\right) \]
                        6. *-commutativeN/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right) \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\cos re, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right) \]
                        8. cos-lowering-cos.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\color{blue}{{im}^{2}} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)\right) \]
                        9. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24}} \cdot {im}^{2}\right)\right)\right) \]
                        10. associate-*l*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right)\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right)\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right) \]
                        13. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right) \]
                        15. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right) \]
                        16. *-lowering-*.f6483.2%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right) \]
                      8. Simplified83.2%

                        \[\leadsto \color{blue}{\cos re \cdot \left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)} \]
                      9. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{\frac{-1}{48} \cdot \left({im}^{4} \cdot {re}^{2}\right) + \frac{1}{24} \cdot {im}^{4}} \]
                      10. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \left(\frac{-1}{48} \cdot {im}^{4}\right) \cdot {re}^{2} + \color{blue}{\frac{1}{24}} \cdot {im}^{4} \]
                        2. +-commutativeN/A

                          \[\leadsto \frac{1}{24} \cdot {im}^{4} + \color{blue}{\left(\frac{-1}{48} \cdot {im}^{4}\right) \cdot {re}^{2}} \]
                        3. *-commutativeN/A

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + \color{blue}{\left(\frac{-1}{48} \cdot {im}^{4}\right)} \cdot {re}^{2} \]
                        4. associate-*r*N/A

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + \frac{-1}{48} \cdot \color{blue}{\left({im}^{4} \cdot {re}^{2}\right)} \]
                        5. *-commutativeN/A

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + \left({im}^{4} \cdot {re}^{2}\right) \cdot \color{blue}{\frac{-1}{48}} \]
                        6. associate-*l*N/A

                          \[\leadsto {im}^{4} \cdot \frac{1}{24} + {im}^{4} \cdot \color{blue}{\left({re}^{2} \cdot \frac{-1}{48}\right)} \]
                        7. distribute-lft-outN/A

                          \[\leadsto {im}^{4} \cdot \color{blue}{\left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)} \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\left({im}^{4}\right), \color{blue}{\left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)}\right) \]
                        9. metadata-evalN/A

                          \[\leadsto \mathsf{*.f64}\left(\left({im}^{\left(2 \cdot 2\right)}\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        10. pow-sqrN/A

                          \[\leadsto \mathsf{*.f64}\left(\left({im}^{2} \cdot {im}^{2}\right), \left(\color{blue}{\frac{1}{24}} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({im}^{2}\right), \left({im}^{2}\right)\right), \left(\color{blue}{\frac{1}{24}} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        12. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(im \cdot im\right), \left({im}^{2}\right)\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        13. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left({im}^{2}\right)\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        14. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(im \cdot im\right)\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        15. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \left(\frac{1}{24} + {re}^{2} \cdot \frac{-1}{48}\right)\right) \]
                        16. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \color{blue}{\left({re}^{2} \cdot \frac{-1}{48}\right)}\right)\right) \]
                        17. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({re}^{2}\right), \color{blue}{\frac{-1}{48}}\right)\right)\right) \]
                        18. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{-1}{48}\right)\right)\right) \]
                        19. *-lowering-*.f6471.8%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{*.f64}\left(im, im\right)\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{-1}{48}\right)\right)\right) \]
                      11. Simplified71.8%

                        \[\leadsto \color{blue}{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.020833333333333332\right)} \]
                    3. Recombined 3 regimes into one program.
                    4. Add Preprocessing

                    Alternative 24: 55.8% accurate, 17.1× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 3.1 \cdot 10^{+86}:\\ \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(im \cdot im\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.25\right)\\ \end{array} \end{array} \]
                    (FPCore (re im)
                     :precision binary64
                     (if (<= re 3.1e+86)
                       (+ 1.0 (* im (* im (+ 0.5 (* im (* im 0.041666666666666664))))))
                       (* (* im im) (+ 0.5 (* (* re re) -0.25)))))
                    double code(double re, double im) {
                    	double tmp;
                    	if (re <= 3.1e+86) {
                    		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
                    	} else {
                    		tmp = (im * im) * (0.5 + ((re * re) * -0.25));
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(re, im)
                        real(8), intent (in) :: re
                        real(8), intent (in) :: im
                        real(8) :: tmp
                        if (re <= 3.1d+86) then
                            tmp = 1.0d0 + (im * (im * (0.5d0 + (im * (im * 0.041666666666666664d0)))))
                        else
                            tmp = (im * im) * (0.5d0 + ((re * re) * (-0.25d0)))
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double re, double im) {
                    	double tmp;
                    	if (re <= 3.1e+86) {
                    		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
                    	} else {
                    		tmp = (im * im) * (0.5 + ((re * re) * -0.25));
                    	}
                    	return tmp;
                    }
                    
                    def code(re, im):
                    	tmp = 0
                    	if re <= 3.1e+86:
                    		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))))
                    	else:
                    		tmp = (im * im) * (0.5 + ((re * re) * -0.25))
                    	return tmp
                    
                    function code(re, im)
                    	tmp = 0.0
                    	if (re <= 3.1e+86)
                    		tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664))))));
                    	else
                    		tmp = Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(re * re) * -0.25)));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(re, im)
                    	tmp = 0.0;
                    	if (re <= 3.1e+86)
                    		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 0.041666666666666664)))));
                    	else
                    		tmp = (im * im) * (0.5 + ((re * re) * -0.25));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[re_, im_] := If[LessEqual[re, 3.1e+86], N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;re \leq 3.1 \cdot 10^{+86}:\\
                    \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(im \cdot im\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.25\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if re < 3.1000000000000002e86

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right)} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\cos re} \]
                        2. +-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                        3. distribute-lft-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                        4. associate-+l+N/A

                          \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                      5. Simplified89.4%

                        \[\leadsto \color{blue}{\cos re \cdot \left(\left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)} \]
                      6. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)} \]
                      7. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)}\right) \]
                        2. +-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                        3. distribute-rgt-inN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(\frac{1}{24} \cdot {im}^{4} + \left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}\right) + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right) \]
                        4. associate-+l+N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot {im}^{4} + \color{blue}{\left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4} + \frac{1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                        5. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot {im}^{\left(2 \cdot 2\right)} + \left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{\color{blue}{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        6. pow-sqrN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot \left({im}^{2} \cdot {im}^{2}\right) + \left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot \color{blue}{{im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        7. associate-*l*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot {im}^{2} + \left(\color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        8. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left({im}^{4} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        10. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                        11. distribute-rgt-outN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \color{blue}{\left({im}^{4} \cdot \frac{1}{720} + \frac{1}{2}\right)}\right)\right) \]
                        12. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        13. pow-sqrN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left(\left({im}^{2} \cdot {im}^{2}\right) \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                        14. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \frac{1}{720}\right) + \frac{1}{2}\right)\right)\right) \]
                        15. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                      8. Simplified64.6%

                        \[\leadsto \color{blue}{1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)} \]
                      9. Taylor expanded in im around 0

                        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot im\right)}\right)\right)\right)\right)\right) \]
                      10. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                        2. *-lowering-*.f6458.4%

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{1}{24}}\right)\right)\right)\right)\right)\right) \]
                      11. Simplified58.4%

                        \[\leadsto 1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \color{blue}{\left(im \cdot 0.041666666666666664\right)}\right)\right) \]

                      if 3.1000000000000002e86 < re

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + \frac{1}{2} \cdot \left({im}^{2} \cdot \cos re\right)} \]
                      4. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \cos re + \left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{\cos re} \]
                        2. distribute-rgt1-inN/A

                          \[\leadsto \left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \color{blue}{\cos re} \]
                        3. unpow2N/A

                          \[\leadsto \left(\frac{1}{2} \cdot \left(im \cdot im\right) + 1\right) \cdot \cos re \]
                        4. associate-*r*N/A

                          \[\leadsto \left(\left(\frac{1}{2} \cdot im\right) \cdot im + 1\right) \cdot \cos re \]
                        5. *-commutativeN/A

                          \[\leadsto \left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right) \cdot \cos re \]
                        6. *-commutativeN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right)} \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\cos re, \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right)}\right) \]
                        8. cos-lowering-cos.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right)\right) \]
                        9. +-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(1 + \color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)}\right)\right) \]
                        10. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right)\right)}\right)\right) \]
                        11. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\left(\frac{1}{2} \cdot im\right) \cdot \color{blue}{im}\right)\right)\right) \]
                        12. associate-*r*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)}\right)\right)\right) \]
                        13. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot {im}^{\color{blue}{2}}\right)\right)\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                        15. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                        16. *-lowering-*.f6471.3%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.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. Simplified71.3%

                        \[\leadsto \color{blue}{\cos re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
                      6. Taylor expanded in im around inf

                        \[\leadsto \color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \cos re\right)} \]
                      7. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{\cos re} \]
                        2. *-commutativeN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right)} \]
                        3. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\cos re, \color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right)}\right) \]
                        4. cos-lowering-cos.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right) \]
                        5. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right) \]
                        6. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right) \]
                        7. *-lowering-*.f6417.8%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right) \]
                      8. Simplified17.8%

                        \[\leadsto \color{blue}{\cos re \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)} \]
                      9. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{\frac{-1}{4} \cdot \left({im}^{2} \cdot {re}^{2}\right) + \frac{1}{2} \cdot {im}^{2}} \]
                      10. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \left(\frac{-1}{4} \cdot {im}^{2}\right) \cdot {re}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2} \]
                        2. +-commutativeN/A

                          \[\leadsto \frac{1}{2} \cdot {im}^{2} + \color{blue}{\left(\frac{-1}{4} \cdot {im}^{2}\right) \cdot {re}^{2}} \]
                        3. *-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \frac{1}{2} + \color{blue}{\left(\frac{-1}{4} \cdot {im}^{2}\right)} \cdot {re}^{2} \]
                        4. associate-*r*N/A

                          \[\leadsto {im}^{2} \cdot \frac{1}{2} + \frac{-1}{4} \cdot \color{blue}{\left({im}^{2} \cdot {re}^{2}\right)} \]
                        5. *-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \frac{1}{2} + \left({im}^{2} \cdot {re}^{2}\right) \cdot \color{blue}{\frac{-1}{4}} \]
                        6. associate-*l*N/A

                          \[\leadsto {im}^{2} \cdot \frac{1}{2} + {im}^{2} \cdot \color{blue}{\left({re}^{2} \cdot \frac{-1}{4}\right)} \]
                        7. distribute-lft-outN/A

                          \[\leadsto {im}^{2} \cdot \color{blue}{\left(\frac{1}{2} + {re}^{2} \cdot \frac{-1}{4}\right)} \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\left(\frac{1}{2} + {re}^{2} \cdot \frac{-1}{4}\right)}\right) \]
                        9. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\left(im \cdot im\right), \left(\color{blue}{\frac{1}{2}} + {re}^{2} \cdot \frac{-1}{4}\right)\right) \]
                        10. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\color{blue}{\frac{1}{2}} + {re}^{2} \cdot \frac{-1}{4}\right)\right) \]
                        11. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left({re}^{2} \cdot \frac{-1}{4}\right)}\right)\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left({re}^{2}\right), \color{blue}{\frac{-1}{4}}\right)\right)\right) \]
                        13. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{-1}{4}\right)\right)\right) \]
                        14. *-lowering-*.f6417.6%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{-1}{4}\right)\right)\right) \]
                      11. Simplified17.6%

                        \[\leadsto \color{blue}{\left(im \cdot im\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.25\right)} \]
                    3. Recombined 2 regimes into one program.
                    4. Add Preprocessing

                    Alternative 25: 51.2% accurate, 22.0× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 235:\\ \;\;\;\;1 + 0.5 \cdot \left(im \cdot im\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(im \cdot \left(0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right)\\ \end{array} \end{array} \]
                    (FPCore (re im)
                     :precision binary64
                     (if (<= im 235.0)
                       (+ 1.0 (* 0.5 (* im im)))
                       (* im (* im (* 0.041666666666666664 (* im im))))))
                    double code(double re, double im) {
                    	double tmp;
                    	if (im <= 235.0) {
                    		tmp = 1.0 + (0.5 * (im * im));
                    	} else {
                    		tmp = im * (im * (0.041666666666666664 * (im * im)));
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(re, im)
                        real(8), intent (in) :: re
                        real(8), intent (in) :: im
                        real(8) :: tmp
                        if (im <= 235.0d0) then
                            tmp = 1.0d0 + (0.5d0 * (im * im))
                        else
                            tmp = im * (im * (0.041666666666666664d0 * (im * im)))
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double re, double im) {
                    	double tmp;
                    	if (im <= 235.0) {
                    		tmp = 1.0 + (0.5 * (im * im));
                    	} else {
                    		tmp = im * (im * (0.041666666666666664 * (im * im)));
                    	}
                    	return tmp;
                    }
                    
                    def code(re, im):
                    	tmp = 0
                    	if im <= 235.0:
                    		tmp = 1.0 + (0.5 * (im * im))
                    	else:
                    		tmp = im * (im * (0.041666666666666664 * (im * im)))
                    	return tmp
                    
                    function code(re, im)
                    	tmp = 0.0
                    	if (im <= 235.0)
                    		tmp = Float64(1.0 + Float64(0.5 * Float64(im * im)));
                    	else
                    		tmp = Float64(im * Float64(im * Float64(0.041666666666666664 * Float64(im * im))));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(re, im)
                    	tmp = 0.0;
                    	if (im <= 235.0)
                    		tmp = 1.0 + (0.5 * (im * im));
                    	else
                    		tmp = im * (im * (0.041666666666666664 * (im * im)));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[re_, im_] := If[LessEqual[im, 235.0], N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im * N[(im * N[(0.041666666666666664 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;im \leq 235:\\
                    \;\;\;\;1 + 0.5 \cdot \left(im \cdot im\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;im \cdot \left(im \cdot \left(0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if im < 235

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + \frac{1}{2} \cdot \left({im}^{2} \cdot \cos re\right)} \]
                      4. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \cos re + \left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{\cos re} \]
                        2. distribute-rgt1-inN/A

                          \[\leadsto \left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \color{blue}{\cos re} \]
                        3. unpow2N/A

                          \[\leadsto \left(\frac{1}{2} \cdot \left(im \cdot im\right) + 1\right) \cdot \cos re \]
                        4. associate-*r*N/A

                          \[\leadsto \left(\left(\frac{1}{2} \cdot im\right) \cdot im + 1\right) \cdot \cos re \]
                        5. *-commutativeN/A

                          \[\leadsto \left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right) \cdot \cos re \]
                        6. *-commutativeN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right)} \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\cos re, \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right)}\right) \]
                        8. cos-lowering-cos.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right)\right) \]
                        9. +-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(1 + \color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)}\right)\right) \]
                        10. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right)\right)}\right)\right) \]
                        11. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\left(\frac{1}{2} \cdot im\right) \cdot \color{blue}{im}\right)\right)\right) \]
                        12. associate-*r*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)}\right)\right)\right) \]
                        13. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot {im}^{\color{blue}{2}}\right)\right)\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                        15. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                        16. *-lowering-*.f6479.3%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.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.3%

                        \[\leadsto \color{blue}{\cos re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
                      6. Taylor expanded in re 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-*.f6447.9%

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right) \]
                      8. Simplified47.9%

                        \[\leadsto \color{blue}{1 + 0.5 \cdot \left(im \cdot im\right)} \]

                      if 235 < im

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right)} \]
                      4. Step-by-step derivation
                        1. distribute-lft-inN/A

                          \[\leadsto \cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)}\right) \]
                        2. associate-+r+N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \cos re\right)\right)\right) + \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)} \]
                        3. associate-*r*N/A

                          \[\leadsto \left(\cos re + {im}^{2} \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        4. associate-*r*N/A

                          \[\leadsto \left(\cos re + \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \cos re\right) + {im}^{\color{blue}{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        5. distribute-rgt1-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \color{blue}{{im}^{2}} \cdot \left(\frac{1}{2} \cdot \cos re\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left({im}^{2} \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos re} \]
                        7. unpow2N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(\left(im \cdot im\right) \cdot \frac{1}{2}\right) \cdot \cos re \]
                        8. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(im \cdot \frac{1}{2}\right)\right) \cdot \cos \color{blue}{re} \]
                        9. *-commutativeN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) \cdot \cos re + \left(im \cdot \left(\frac{1}{2} \cdot im\right)\right) \cdot \cos re \]
                        10. distribute-rgt-outN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + 1\right) + im \cdot \left(\frac{1}{2} \cdot im\right)\right)} \]
                        11. associate-+r+N/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \color{blue}{\left(1 + im \cdot \left(\frac{1}{2} \cdot im\right)\right)}\right) \]
                        12. +-commutativeN/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(im \cdot \left(\frac{1}{2} \cdot im\right) + \color{blue}{1}\right)\right) \]
                      5. Simplified64.7%

                        \[\leadsto \color{blue}{\cos re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right) + 1\right)} \]
                      6. Taylor expanded in im around inf

                        \[\leadsto \color{blue}{\frac{1}{24} \cdot \left({im}^{4} \cdot \cos re\right)} \]
                      7. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \left(\frac{1}{24} \cdot {im}^{4}\right) \cdot \color{blue}{\cos re} \]
                        2. *-commutativeN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{4}\right)} \]
                        3. metadata-evalN/A

                          \[\leadsto \cos re \cdot \left(\frac{1}{24} \cdot {im}^{\left(2 \cdot \color{blue}{2}\right)}\right) \]
                        4. pow-sqrN/A

                          \[\leadsto \cos re \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right) \]
                        5. associate-*l*N/A

                          \[\leadsto \cos re \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \color{blue}{{im}^{2}}\right) \]
                        6. *-commutativeN/A

                          \[\leadsto \cos re \cdot \left({im}^{2} \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right) \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\cos re, \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right) \]
                        8. cos-lowering-cos.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\color{blue}{{im}^{2}} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)\right) \]
                        9. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24}} \cdot {im}^{2}\right)\right)\right) \]
                        10. associate-*l*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right)\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right)\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right)\right) \]
                        13. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right)\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right)\right) \]
                        15. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right) \]
                        16. *-lowering-*.f6464.7%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right) \]
                      8. Simplified64.7%

                        \[\leadsto \color{blue}{\cos re \cdot \left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)} \]
                      9. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{\frac{1}{24} \cdot {im}^{4}} \]
                      10. Step-by-step derivation
                        1. metadata-evalN/A

                          \[\leadsto \frac{1}{24} \cdot {im}^{\left(2 \cdot \color{blue}{2}\right)} \]
                        2. pow-sqrN/A

                          \[\leadsto \frac{1}{24} \cdot \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right) \]
                        3. associate-*l*N/A

                          \[\leadsto \left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \color{blue}{{im}^{2}} \]
                        4. *-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)} \]
                        5. unpow2N/A

                          \[\leadsto \left(im \cdot im\right) \cdot \left(\color{blue}{\frac{1}{24}} \cdot {im}^{2}\right) \]
                        6. associate-*l*N/A

                          \[\leadsto im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)} \]
                        7. *-commutativeN/A

                          \[\leadsto im \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \color{blue}{im}\right) \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(im, \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot im\right)}\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right) \]
                        10. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} \cdot {im}^{2}\right)}\right)\right) \]
                        11. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{24}}\right)\right)\right) \]
                        13. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right) \]
                        14. *-lowering-*.f6445.4%

                          \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right) \]
                      11. Simplified45.4%

                        \[\leadsto \color{blue}{im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)} \]
                    3. Recombined 2 regimes into one program.
                    4. Final simplification47.3%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 235:\\ \;\;\;\;1 + 0.5 \cdot \left(im \cdot im\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(im \cdot \left(0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right)\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 26: 47.7% accurate, 25.6× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 2.15 \cdot 10^{+139}:\\ \;\;\;\;1 + 0.5 \cdot \left(im \cdot im\right)\\ \mathbf{else}:\\ \;\;\;\;1 + re \cdot \left(re \cdot -0.5\right)\\ \end{array} \end{array} \]
                    (FPCore (re im)
                     :precision binary64
                     (if (<= re 2.15e+139) (+ 1.0 (* 0.5 (* im im))) (+ 1.0 (* re (* re -0.5)))))
                    double code(double re, double im) {
                    	double tmp;
                    	if (re <= 2.15e+139) {
                    		tmp = 1.0 + (0.5 * (im * im));
                    	} else {
                    		tmp = 1.0 + (re * (re * -0.5));
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(re, im)
                        real(8), intent (in) :: re
                        real(8), intent (in) :: im
                        real(8) :: tmp
                        if (re <= 2.15d+139) then
                            tmp = 1.0d0 + (0.5d0 * (im * im))
                        else
                            tmp = 1.0d0 + (re * (re * (-0.5d0)))
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double re, double im) {
                    	double tmp;
                    	if (re <= 2.15e+139) {
                    		tmp = 1.0 + (0.5 * (im * im));
                    	} else {
                    		tmp = 1.0 + (re * (re * -0.5));
                    	}
                    	return tmp;
                    }
                    
                    def code(re, im):
                    	tmp = 0
                    	if re <= 2.15e+139:
                    		tmp = 1.0 + (0.5 * (im * im))
                    	else:
                    		tmp = 1.0 + (re * (re * -0.5))
                    	return tmp
                    
                    function code(re, im)
                    	tmp = 0.0
                    	if (re <= 2.15e+139)
                    		tmp = Float64(1.0 + Float64(0.5 * Float64(im * im)));
                    	else
                    		tmp = Float64(1.0 + Float64(re * Float64(re * -0.5)));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(re, im)
                    	tmp = 0.0;
                    	if (re <= 2.15e+139)
                    		tmp = 1.0 + (0.5 * (im * im));
                    	else
                    		tmp = 1.0 + (re * (re * -0.5));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[re_, im_] := If[LessEqual[re, 2.15e+139], N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(re * N[(re * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;re \leq 2.15 \cdot 10^{+139}:\\
                    \;\;\;\;1 + 0.5 \cdot \left(im \cdot im\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;1 + re \cdot \left(re \cdot -0.5\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if re < 2.1499999999999999e139

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re + \frac{1}{2} \cdot \left({im}^{2} \cdot \cos re\right)} \]
                      4. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \cos re + \left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{\cos re} \]
                        2. distribute-rgt1-inN/A

                          \[\leadsto \left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \color{blue}{\cos re} \]
                        3. unpow2N/A

                          \[\leadsto \left(\frac{1}{2} \cdot \left(im \cdot im\right) + 1\right) \cdot \cos re \]
                        4. associate-*r*N/A

                          \[\leadsto \left(\left(\frac{1}{2} \cdot im\right) \cdot im + 1\right) \cdot \cos re \]
                        5. *-commutativeN/A

                          \[\leadsto \left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right) \cdot \cos re \]
                        6. *-commutativeN/A

                          \[\leadsto \cos re \cdot \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right)} \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\cos re, \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right)}\right) \]
                        8. cos-lowering-cos.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right)\right) \]
                        9. +-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(1 + \color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)}\right)\right) \]
                        10. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right)\right)}\right)\right) \]
                        11. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\left(\frac{1}{2} \cdot im\right) \cdot \color{blue}{im}\right)\right)\right) \]
                        12. associate-*r*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)}\right)\right)\right) \]
                        13. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot {im}^{\color{blue}{2}}\right)\right)\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                        15. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                        16. *-lowering-*.f6470.6%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.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. Simplified70.6%

                        \[\leadsto \color{blue}{\cos re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
                      6. Taylor expanded in re 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-*.f6448.2%

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right) \]
                      8. Simplified48.2%

                        \[\leadsto \color{blue}{1 + 0.5 \cdot \left(im \cdot im\right)} \]

                      if 2.1499999999999999e139 < re

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re} \]
                      4. Step-by-step derivation
                        1. cos-lowering-cos.f6461.2%

                          \[\leadsto \mathsf{cos.f64}\left(re\right) \]
                      5. Simplified61.2%

                        \[\leadsto \color{blue}{\cos re} \]
                      6. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{1 + \frac{-1}{2} \cdot {re}^{2}} \]
                      7. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{2} \cdot {re}^{2}\right)}\right) \]
                        2. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left({re}^{2} \cdot \color{blue}{\frac{-1}{2}}\right)\right) \]
                        3. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(\left(re \cdot re\right) \cdot \frac{-1}{2}\right)\right) \]
                        4. associate-*l*N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \left(re \cdot \color{blue}{\left(re \cdot \frac{-1}{2}\right)}\right)\right) \]
                        5. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \color{blue}{\left(re \cdot \frac{-1}{2}\right)}\right)\right) \]
                        6. *-lowering-*.f6418.0%

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \color{blue}{\frac{-1}{2}}\right)\right)\right) \]
                      8. Simplified18.0%

                        \[\leadsto \color{blue}{1 + re \cdot \left(re \cdot -0.5\right)} \]
                    3. Recombined 2 regimes into one program.
                    4. Add Preprocessing

                    Alternative 27: 37.9% accurate, 30.8× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 235:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(im \cdot im\right)\\ \end{array} \end{array} \]
                    (FPCore (re im) :precision binary64 (if (<= im 235.0) 1.0 (* 0.5 (* im im))))
                    double code(double re, double im) {
                    	double tmp;
                    	if (im <= 235.0) {
                    		tmp = 1.0;
                    	} else {
                    		tmp = 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 (im <= 235.0d0) then
                            tmp = 1.0d0
                        else
                            tmp = 0.5d0 * (im * im)
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double re, double im) {
                    	double tmp;
                    	if (im <= 235.0) {
                    		tmp = 1.0;
                    	} else {
                    		tmp = 0.5 * (im * im);
                    	}
                    	return tmp;
                    }
                    
                    def code(re, im):
                    	tmp = 0
                    	if im <= 235.0:
                    		tmp = 1.0
                    	else:
                    		tmp = 0.5 * (im * im)
                    	return tmp
                    
                    function code(re, im)
                    	tmp = 0.0
                    	if (im <= 235.0)
                    		tmp = 1.0;
                    	else
                    		tmp = Float64(0.5 * Float64(im * im));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(re, im)
                    	tmp = 0.0;
                    	if (im <= 235.0)
                    		tmp = 1.0;
                    	else
                    		tmp = 0.5 * (im * im);
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[re_, im_] := If[LessEqual[im, 235.0], 1.0, N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;im \leq 235:\\
                    \;\;\;\;1\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;0.5 \cdot \left(im \cdot im\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if im < 235

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\cos re} \]
                      4. Step-by-step derivation
                        1. cos-lowering-cos.f6462.9%

                          \[\leadsto \mathsf{cos.f64}\left(re\right) \]
                      5. Simplified62.9%

                        \[\leadsto \color{blue}{\cos re} \]
                      6. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{1} \]
                      7. Step-by-step derivation
                        1. Simplified35.1%

                          \[\leadsto \color{blue}{1} \]

                        if 235 < im

                        1. Initial program 100.0%

                          \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                        2. Add Preprocessing
                        3. Taylor expanded in im around 0

                          \[\leadsto \color{blue}{\cos re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right)} \]
                        4. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\cos re} \]
                          2. +-commutativeN/A

                            \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right) + \frac{1}{2} \cdot \cos re\right) + \cos re \]
                          3. distribute-lft-inN/A

                            \[\leadsto \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right)\right) + \cos \color{blue}{re} \]
                          4. associate-+l+N/A

                            \[\leadsto {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \cos re\right) + \frac{1}{24} \cdot \cos re\right)\right) + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} \cdot \cos re\right) + \cos re\right)} \]
                        5. Simplified77.8%

                          \[\leadsto \color{blue}{\cos re \cdot \left(\left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)} \]
                        6. Taylor expanded in re around 0

                          \[\leadsto \color{blue}{1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)} \]
                        7. Step-by-step derivation
                          1. +-lowering-+.f64N/A

                            \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)}\right) \]
                          2. +-commutativeN/A

                            \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2} \cdot {im}^{2}}\right)\right) \]
                          3. distribute-rgt-inN/A

                            \[\leadsto \mathsf{+.f64}\left(1, \left(\left(\frac{1}{24} \cdot {im}^{4} + \left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}\right) + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right) \]
                          4. associate-+l+N/A

                            \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot {im}^{4} + \color{blue}{\left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4} + \frac{1}{2} \cdot {im}^{2}\right)}\right)\right) \]
                          5. metadata-evalN/A

                            \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot {im}^{\left(2 \cdot 2\right)} + \left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{\color{blue}{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                          6. pow-sqrN/A

                            \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{1}{24} \cdot \left({im}^{2} \cdot {im}^{2}\right) + \left(\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot \color{blue}{{im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                          7. associate-*l*N/A

                            \[\leadsto \mathsf{+.f64}\left(1, \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot {im}^{2} + \left(\color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                          8. *-commutativeN/A

                            \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right) \cdot {im}^{4}} + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                          9. *-commutativeN/A

                            \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left({im}^{4} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                          10. associate-*r*N/A

                            \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\left({im}^{4} \cdot \frac{1}{720}\right) \cdot {im}^{2} + \color{blue}{\frac{1}{2}} \cdot {im}^{2}\right)\right)\right) \]
                          11. distribute-rgt-outN/A

                            \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \color{blue}{\left({im}^{4} \cdot \frac{1}{720} + \frac{1}{2}\right)}\right)\right) \]
                          12. metadata-evalN/A

                            \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{\left(2 \cdot 2\right)} \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                          13. pow-sqrN/A

                            \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left(\left({im}^{2} \cdot {im}^{2}\right) \cdot \frac{1}{720} + \frac{1}{2}\right)\right)\right) \]
                          14. associate-*r*N/A

                            \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \frac{1}{720}\right) + \frac{1}{2}\right)\right)\right) \]
                          15. *-commutativeN/A

                            \[\leadsto \mathsf{+.f64}\left(1, \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + {im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot {im}^{2}\right) + \frac{1}{2}\right)\right)\right) \]
                        8. Simplified52.7%

                          \[\leadsto \color{blue}{1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)} \]
                        9. Taylor expanded in im around 0

                          \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{1}{2}}\right)\right)\right) \]
                        10. Step-by-step derivation
                          1. Simplified33.1%

                            \[\leadsto 1 + im \cdot \left(im \cdot \color{blue}{0.5}\right) \]
                          2. Taylor expanded in im around inf

                            \[\leadsto \color{blue}{\frac{1}{2} \cdot {im}^{2}} \]
                          3. Step-by-step derivation
                            1. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left({im}^{2}\right)}\right) \]
                            2. unpow2N/A

                              \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \left(im \cdot \color{blue}{im}\right)\right) \]
                            3. *-lowering-*.f6433.1%

                              \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right) \]
                          4. Simplified33.1%

                            \[\leadsto \color{blue}{0.5 \cdot \left(im \cdot im\right)} \]
                        11. Recombined 2 regimes into one program.
                        12. Add Preprocessing

                        Alternative 28: 47.1% accurate, 44.0× speedup?

                        \[\begin{array}{l} \\ 1 + 0.5 \cdot \left(im \cdot im\right) \end{array} \]
                        (FPCore (re im) :precision binary64 (+ 1.0 (* 0.5 (* im im))))
                        double code(double re, double im) {
                        	return 1.0 + (0.5 * (im * im));
                        }
                        
                        real(8) function code(re, im)
                            real(8), intent (in) :: re
                            real(8), intent (in) :: im
                            code = 1.0d0 + (0.5d0 * (im * im))
                        end function
                        
                        public static double code(double re, double im) {
                        	return 1.0 + (0.5 * (im * im));
                        }
                        
                        def code(re, im):
                        	return 1.0 + (0.5 * (im * im))
                        
                        function code(re, im)
                        	return Float64(1.0 + Float64(0.5 * Float64(im * im)))
                        end
                        
                        function tmp = code(re, im)
                        	tmp = 1.0 + (0.5 * (im * im));
                        end
                        
                        code[re_, im_] := N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                        
                        \begin{array}{l}
                        
                        \\
                        1 + 0.5 \cdot \left(im \cdot im\right)
                        \end{array}
                        
                        Derivation
                        1. Initial program 100.0%

                          \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                        2. Add Preprocessing
                        3. Taylor expanded in im around 0

                          \[\leadsto \color{blue}{\cos re + \frac{1}{2} \cdot \left({im}^{2} \cdot \cos re\right)} \]
                        4. Step-by-step derivation
                          1. associate-*r*N/A

                            \[\leadsto \cos re + \left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \color{blue}{\cos re} \]
                          2. distribute-rgt1-inN/A

                            \[\leadsto \left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \color{blue}{\cos re} \]
                          3. unpow2N/A

                            \[\leadsto \left(\frac{1}{2} \cdot \left(im \cdot im\right) + 1\right) \cdot \cos re \]
                          4. associate-*r*N/A

                            \[\leadsto \left(\left(\frac{1}{2} \cdot im\right) \cdot im + 1\right) \cdot \cos re \]
                          5. *-commutativeN/A

                            \[\leadsto \left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right) \cdot \cos re \]
                          6. *-commutativeN/A

                            \[\leadsto \cos re \cdot \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right)} \]
                          7. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\cos re, \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right)}\right) \]
                          8. cos-lowering-cos.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right)\right) \]
                          9. +-commutativeN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \left(1 + \color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)}\right)\right) \]
                          10. +-lowering-+.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \color{blue}{\left(im \cdot \left(\frac{1}{2} \cdot im\right)\right)}\right)\right) \]
                          11. *-commutativeN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\left(\frac{1}{2} \cdot im\right) \cdot \color{blue}{im}\right)\right)\right) \]
                          12. associate-*r*N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)}\right)\right)\right) \]
                          13. unpow2N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot {im}^{\color{blue}{2}}\right)\right)\right) \]
                          14. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left({im}^{2}\right)}\right)\right)\right) \]
                          15. unpow2N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(im \cdot \color{blue}{im}\right)\right)\right)\right) \]
                          16. *-lowering-*.f6471.1%

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.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. Simplified71.1%

                          \[\leadsto \color{blue}{\cos re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
                        6. Taylor expanded in re 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-*.f6444.2%

                            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right) \]
                        8. Simplified44.2%

                          \[\leadsto \color{blue}{1 + 0.5 \cdot \left(im \cdot im\right)} \]
                        9. Add Preprocessing

                        Alternative 29: 28.6% accurate, 308.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%

                          \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right) \]
                        2. Add Preprocessing
                        3. Taylor expanded in im around 0

                          \[\leadsto \color{blue}{\cos re} \]
                        4. Step-by-step derivation
                          1. cos-lowering-cos.f6447.9%

                            \[\leadsto \mathsf{cos.f64}\left(re\right) \]
                        5. Simplified47.9%

                          \[\leadsto \color{blue}{\cos re} \]
                        6. Taylor expanded in re around 0

                          \[\leadsto \color{blue}{1} \]
                        7. Step-by-step derivation
                          1. Simplified26.9%

                            \[\leadsto \color{blue}{1} \]
                          2. Add Preprocessing

                          Reproduce

                          ?
                          herbie shell --seed 2024139 
                          (FPCore (re im)
                            :name "math.cos on complex, real part"
                            :precision binary64
                            (* (* 0.5 (cos re)) (+ (exp (- im)) (exp im))))