math.cos on complex, real part

Percentage Accurate: 100.0% → 100.0%
Time: 13.4s
Alternatives: 15
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 15 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} \\ \frac{\cos re}{\frac{1}{\cosh im}} \end{array} \]
(FPCore (re im) :precision binary64 (/ (cos re) (/ 1.0 (cosh im))))
double code(double re, double im) {
	return cos(re) / (1.0 / cosh(im));
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = cos(re) / (1.0d0 / cosh(im))
end function
public static double code(double re, double im) {
	return Math.cos(re) / (1.0 / Math.cosh(im));
}
def code(re, im):
	return math.cos(re) / (1.0 / math.cosh(im))
function code(re, im)
	return Float64(cos(re) / Float64(1.0 / cosh(im)))
end
function tmp = code(re, im)
	tmp = cos(re) / (1.0 / cosh(im));
end
code[re_, im_] := N[(N[Cos[re], $MachinePrecision] / N[(1.0 / N[Cosh[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\cos re}{\frac{1}{\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. flip-+N/A

      \[\leadsto \left(\frac{1}{2} \cdot \cos re\right) \cdot \frac{e^{\mathsf{neg}\left(im\right)} \cdot e^{\mathsf{neg}\left(im\right)} - e^{im} \cdot e^{im}}{\color{blue}{e^{\mathsf{neg}\left(im\right)} - e^{im}}} \]
    2. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{0.5 \cdot \cos re}{\frac{1}{2 \cdot \cosh im}}} \]
  5. Step-by-step derivation
    1. associate-/r/N/A

      \[\leadsto \frac{\frac{1}{2} \cdot \cos re}{1} \cdot \color{blue}{\left(2 \cdot \cosh im\right)} \]
    2. /-rgt-identityN/A

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

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

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

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

      \[\leadsto \left(\cos re \cdot 1\right) \cdot \cosh im \]
    7. *-rgt-identityN/A

      \[\leadsto \cos re \cdot \cosh \color{blue}{im} \]
    8. cosh-defN/A

      \[\leadsto \cos re \cdot \frac{e^{im} + e^{\mathsf{neg}\left(im\right)}}{\color{blue}{2}} \]
    9. cosh-undefN/A

      \[\leadsto \cos re \cdot \frac{2 \cdot \cosh im}{2} \]
    10. associate-*r/N/A

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

      \[\leadsto \mathsf{/.f64}\left(\left(\cos re \cdot \left(2 \cdot \cosh im\right)\right), \color{blue}{2}\right) \]
    12. remove-double-divN/A

      \[\leadsto \mathsf{/.f64}\left(\left(\cos re \cdot \frac{1}{\frac{1}{2 \cdot \cosh im}}\right), 2\right) \]
    13. div-invN/A

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{\cos re}{\frac{0.5}{\cosh im}}}{2}} \]
  7. Step-by-step derivation
    1. associate-/l/N/A

      \[\leadsto \frac{\cos re}{\color{blue}{2 \cdot \frac{\frac{1}{2}}{\cosh im}}} \]
    2. /-lowering-/.f64N/A

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\cos re}{\frac{1}{\cosh im}}} \]
  9. Add Preprocessing

Alternative 2: 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. flip-+N/A

      \[\leadsto \left(\frac{1}{2} \cdot \cos re\right) \cdot \frac{e^{\mathsf{neg}\left(im\right)} \cdot e^{\mathsf{neg}\left(im\right)} - e^{im} \cdot e^{im}}{\color{blue}{e^{\mathsf{neg}\left(im\right)} - e^{im}}} \]
    2. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{0.5 \cdot \cos re}{\frac{1}{2 \cdot \cosh im}}} \]
  5. Step-by-step derivation
    1. associate-/r/N/A

      \[\leadsto \frac{\frac{1}{2} \cdot \cos re}{1} \cdot \color{blue}{\left(2 \cdot \cosh im\right)} \]
    2. /-rgt-identityN/A

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

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

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

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

      \[\leadsto \left(\cos re \cdot 1\right) \cdot \cosh im \]
    7. *-rgt-identityN/A

      \[\leadsto \cos re \cdot \cosh \color{blue}{im} \]
    8. *-commutativeN/A

      \[\leadsto \cosh im \cdot \color{blue}{\cos re} \]
    9. *-lowering-*.f64N/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cosh.f64}\left(im\right), \cos \color{blue}{re}\right) \]
    11. 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 3: 94.5% 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 135:\\ \;\;\;\;\frac{\cos re}{\frac{1}{1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot t\_0\right)\right)\right)}}\\ \mathbf{elif}\;im \leq 7 \cdot 10^{+51}:\\ \;\;\;\;\cosh im \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + \left(re \cdot re\right) \cdot \left(0.041666666666666664 + re \cdot \left(re \cdot -0.001388888888888889\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot t\_0\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (+ 0.041666666666666664 (* (* im im) 0.001388888888888889))))
   (if (<= im 135.0)
     (/ (cos re) (/ 1.0 (+ 1.0 (* im (* im (+ 0.5 (* im (* im t_0))))))))
     (if (<= im 7e+51)
       (*
        (cosh im)
        (+
         1.0
         (*
          (* re re)
          (+
           -0.5
           (*
            (* re re)
            (+ 0.041666666666666664 (* re (* re -0.001388888888888889))))))))
       (* (cos re) (+ 1.0 (* im (* im (+ 0.5 (* (* im im) t_0))))))))))
double code(double re, double im) {
	double t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
	double tmp;
	if (im <= 135.0) {
		tmp = cos(re) / (1.0 / (1.0 + (im * (im * (0.5 + (im * (im * t_0)))))));
	} else if (im <= 7e+51) {
		tmp = cosh(im) * (1.0 + ((re * re) * (-0.5 + ((re * re) * (0.041666666666666664 + (re * (re * -0.001388888888888889)))))));
	} else {
		tmp = cos(re) * (1.0 + (im * (im * (0.5 + ((im * im) * t_0)))));
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)
    if (im <= 135.0d0) then
        tmp = cos(re) / (1.0d0 / (1.0d0 + (im * (im * (0.5d0 + (im * (im * t_0)))))))
    else if (im <= 7d+51) then
        tmp = cosh(im) * (1.0d0 + ((re * re) * ((-0.5d0) + ((re * re) * (0.041666666666666664d0 + (re * (re * (-0.001388888888888889d0))))))))
    else
        tmp = cos(re) * (1.0d0 + (im * (im * (0.5d0 + ((im * im) * t_0)))))
    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 <= 135.0) {
		tmp = Math.cos(re) / (1.0 / (1.0 + (im * (im * (0.5 + (im * (im * t_0)))))));
	} else if (im <= 7e+51) {
		tmp = Math.cosh(im) * (1.0 + ((re * re) * (-0.5 + ((re * re) * (0.041666666666666664 + (re * (re * -0.001388888888888889)))))));
	} else {
		tmp = Math.cos(re) * (1.0 + (im * (im * (0.5 + ((im * im) * t_0)))));
	}
	return tmp;
}
def code(re, im):
	t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889)
	tmp = 0
	if im <= 135.0:
		tmp = math.cos(re) / (1.0 / (1.0 + (im * (im * (0.5 + (im * (im * t_0)))))))
	elif im <= 7e+51:
		tmp = math.cosh(im) * (1.0 + ((re * re) * (-0.5 + ((re * re) * (0.041666666666666664 + (re * (re * -0.001388888888888889)))))))
	else:
		tmp = math.cos(re) * (1.0 + (im * (im * (0.5 + ((im * im) * t_0)))))
	return tmp
function code(re, im)
	t_0 = Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889))
	tmp = 0.0
	if (im <= 135.0)
		tmp = Float64(cos(re) / Float64(1.0 / Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * t_0))))))));
	elseif (im <= 7e+51)
		tmp = Float64(cosh(im) * Float64(1.0 + Float64(Float64(re * re) * Float64(-0.5 + Float64(Float64(re * re) * Float64(0.041666666666666664 + Float64(re * Float64(re * -0.001388888888888889))))))));
	else
		tmp = Float64(cos(re) * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * t_0))))));
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
	tmp = 0.0;
	if (im <= 135.0)
		tmp = cos(re) / (1.0 / (1.0 + (im * (im * (0.5 + (im * (im * t_0)))))));
	elseif (im <= 7e+51)
		tmp = cosh(im) * (1.0 + ((re * re) * (-0.5 + ((re * re) * (0.041666666666666664 + (re * (re * -0.001388888888888889)))))));
	else
		tmp = cos(re) * (1.0 + (im * (im * (0.5 + ((im * im) * t_0)))));
	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, 135.0], N[(N[Cos[re], $MachinePrecision] / N[(1.0 / N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 7e+51], N[(N[Cosh[im], $MachinePrecision] * N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.5 + N[(N[(re * re), $MachinePrecision] * N[(0.041666666666666664 + N[(re * N[(re * -0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[re], $MachinePrecision] * N[(1.0 + N[(im * N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * t$95$0), $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 135:\\
\;\;\;\;\frac{\cos re}{\frac{1}{1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot t\_0\right)\right)\right)}}\\

\mathbf{elif}\;im \leq 7 \cdot 10^{+51}:\\
\;\;\;\;\cosh im \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + \left(re \cdot re\right) \cdot \left(0.041666666666666664 + re \cdot \left(re \cdot -0.001388888888888889\right)\right)\right)\right)\\

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


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

    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. flip-+N/A

        \[\leadsto \left(\frac{1}{2} \cdot \cos re\right) \cdot \frac{e^{\mathsf{neg}\left(im\right)} \cdot e^{\mathsf{neg}\left(im\right)} - e^{im} \cdot e^{im}}{\color{blue}{e^{\mathsf{neg}\left(im\right)} - e^{im}}} \]
      2. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{0.5 \cdot \cos re}{\frac{1}{2 \cdot \cosh im}}} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

        \[\leadsto \frac{\frac{1}{2} \cdot \cos re}{1} \cdot \color{blue}{\left(2 \cdot \cosh im\right)} \]
      2. /-rgt-identityN/A

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

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

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

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

        \[\leadsto \left(\cos re \cdot 1\right) \cdot \cosh im \]
      7. *-rgt-identityN/A

        \[\leadsto \cos re \cdot \cosh \color{blue}{im} \]
      8. cosh-defN/A

        \[\leadsto \cos re \cdot \frac{e^{im} + e^{\mathsf{neg}\left(im\right)}}{\color{blue}{2}} \]
      9. cosh-undefN/A

        \[\leadsto \cos re \cdot \frac{2 \cdot \cosh im}{2} \]
      10. associate-*r/N/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\cos re \cdot \left(2 \cdot \cosh im\right)\right), \color{blue}{2}\right) \]
      12. remove-double-divN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\cos re \cdot \frac{1}{\frac{1}{2 \cdot \cosh im}}\right), 2\right) \]
      13. div-invN/A

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\cos re}{\frac{0.5}{\cosh im}}}{2}} \]
    7. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto \frac{\cos re}{\color{blue}{2 \cdot \frac{\frac{1}{2}}{\cosh im}}} \]
      2. /-lowering-/.f64N/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\cos re}{\frac{1}{\cosh im}}} \]
    9. Taylor expanded in im around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{/.f64}\left(1, \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)}\right)\right) \]
    10. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{/.f64}\left(1, \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)\right)\right) \]
      2. unpow2N/A

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \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)\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{/.f64}\left(1, \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 \left(\color{blue}{\frac{1}{24}} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)\right)\right)\right)\right) \]
      8. associate-*l*N/A

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{/.f64}\left(1, \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, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      14. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{/.f64}\left(1, \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, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      15. *-lowering-*.f6495.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cos.f64}\left(re\right), \mathsf{/.f64}\left(1, \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, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
    11. Simplified95.1%

      \[\leadsto \frac{\cos re}{\frac{1}{\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 135 < im < 7e51

    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 re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{-1}{2} + \left(re \cdot re\right) \cdot \left(\frac{1}{24} + re \cdot \left(re \cdot \frac{-1}{720}\right)\right)\right)\right)\right), \cosh im\right) \]
      7. +-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(\left(re \cdot re\right) \cdot \left(\frac{1}{24} + re \cdot \left(re \cdot \frac{-1}{720}\right)\right)\right)\right)\right)\right), \cosh im\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}, \mathsf{*.f64}\left(\left(re \cdot re\right), \left(\frac{1}{24} + re \cdot \left(re \cdot \frac{-1}{720}\right)\right)\right)\right)\right)\right), \cosh im\right) \]
      9. *-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(\mathsf{*.f64}\left(re, re\right), \left(\frac{1}{24} + re \cdot \left(re \cdot \frac{-1}{720}\right)\right)\right)\right)\right)\right), \cosh im\right) \]
      10. +-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(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \left(re \cdot \left(re \cdot \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right), \cosh im\right) \]
      11. *-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(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \left(re \cdot \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right), \cosh im\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(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right), \cosh im\right) \]
      13. cosh-lowering-cosh.f64100.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(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right), \mathsf{cosh.f64}\left(im\right)\right) \]
    9. Applied egg-rr100.0%

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

    if 7e51 < im

    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. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 135:\\ \;\;\;\;\frac{\cos re}{\frac{1}{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 7 \cdot 10^{+51}:\\ \;\;\;\;\cosh im \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + \left(re \cdot re\right) \cdot \left(0.041666666666666664 + re \cdot \left(re \cdot -0.001388888888888889\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 94.5% accurate, 2.4× speedup?

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

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

\mathbf{elif}\;im \leq 7 \cdot 10^{+51}:\\
\;\;\;\;\cosh im \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + \left(re \cdot re\right) \cdot \left(0.041666666666666664 + re \cdot \left(re \cdot -0.001388888888888889\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if im < 135 or 7e51 < im

    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. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(re\right)\right) \]
      14. *-lowering-*.f6495.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(re\right)\right) \]
    7. Simplified95.9%

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

    if 135 < im < 7e51

    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 re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{-1}{2} + \left(re \cdot re\right) \cdot \left(\frac{1}{24} + re \cdot \left(re \cdot \frac{-1}{720}\right)\right)\right)\right)\right), \cosh im\right) \]
      7. +-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(\left(re \cdot re\right) \cdot \left(\frac{1}{24} + re \cdot \left(re \cdot \frac{-1}{720}\right)\right)\right)\right)\right)\right), \cosh im\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}, \mathsf{*.f64}\left(\left(re \cdot re\right), \left(\frac{1}{24} + re \cdot \left(re \cdot \frac{-1}{720}\right)\right)\right)\right)\right)\right), \cosh im\right) \]
      9. *-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(\mathsf{*.f64}\left(re, re\right), \left(\frac{1}{24} + re \cdot \left(re \cdot \frac{-1}{720}\right)\right)\right)\right)\right)\right), \cosh im\right) \]
      10. +-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(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \left(re \cdot \left(re \cdot \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right), \cosh im\right) \]
      11. *-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(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \left(re \cdot \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right), \cosh im\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(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right), \cosh im\right) \]
      13. cosh-lowering-cosh.f64100.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(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right), \mathsf{cosh.f64}\left(im\right)\right) \]
    9. Applied egg-rr100.0%

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

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

Alternative 5: 79.3% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 0.43:\\ \;\;\;\;\cosh im \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= re 0.43)
   (*
    (cosh im)
    (+ 1.0 (* (* re re) (+ -0.5 (* 0.041666666666666664 (* re re))))))
   (*
    (cos re)
    (+
     1.0
     (*
      im
      (*
       im
       (+
        0.5
        (*
         (* im im)
         (+ 0.041666666666666664 (* (* im im) 0.001388888888888889))))))))))
double code(double re, double im) {
	double tmp;
	if (re <= 0.43) {
		tmp = cosh(im) * (1.0 + ((re * re) * (-0.5 + (0.041666666666666664 * (re * re)))));
	} else {
		tmp = cos(re) * (1.0 + (im * (im * (0.5 + ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))));
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: tmp
    if (re <= 0.43d0) then
        tmp = cosh(im) * (1.0d0 + ((re * re) * ((-0.5d0) + (0.041666666666666664d0 * (re * re)))))
    else
        tmp = cos(re) * (1.0d0 + (im * (im * (0.5d0 + ((im * im) * (0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)))))))
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double tmp;
	if (re <= 0.43) {
		tmp = Math.cosh(im) * (1.0 + ((re * re) * (-0.5 + (0.041666666666666664 * (re * re)))));
	} else {
		tmp = Math.cos(re) * (1.0 + (im * (im * (0.5 + ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))));
	}
	return tmp;
}
def code(re, im):
	tmp = 0
	if re <= 0.43:
		tmp = math.cosh(im) * (1.0 + ((re * re) * (-0.5 + (0.041666666666666664 * (re * re)))))
	else:
		tmp = math.cos(re) * (1.0 + (im * (im * (0.5 + ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))))
	return tmp
function code(re, im)
	tmp = 0.0
	if (re <= 0.43)
		tmp = Float64(cosh(im) * Float64(1.0 + Float64(Float64(re * re) * Float64(-0.5 + Float64(0.041666666666666664 * Float64(re * re))))));
	else
		tmp = Float64(cos(re) * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889))))))));
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if (re <= 0.43)
		tmp = cosh(im) * (1.0 + ((re * re) * (-0.5 + (0.041666666666666664 * (re * re)))));
	else
		tmp = cos(re) * (1.0 + (im * (im * (0.5 + ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))));
	end
	tmp_2 = tmp;
end
code[re_, im_] := If[LessEqual[re, 0.43], N[(N[Cosh[im], $MachinePrecision] * N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.5 + N[(0.041666666666666664 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[re], $MachinePrecision] * N[(1.0 + N[(im * N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;re \leq 0.43:\\
\;\;\;\;\cosh im \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + 0.041666666666666664 \cdot \left(re \cdot re\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\cos re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if re < 0.429999999999999993

    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 re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{-1}{2} + \left(re \cdot re\right) \cdot \frac{1}{24}\right)\right)\right), \cosh im\right) \]
      7. +-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(\left(re \cdot re\right) \cdot \frac{1}{24}\right)\right)\right)\right), \cosh im\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}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{1}{24}\right)\right)\right)\right), \cosh im\right) \]
      9. *-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(\mathsf{*.f64}\left(re, re\right), \frac{1}{24}\right)\right)\right)\right), \cosh im\right) \]
      10. cosh-lowering-cosh.f6472.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(\mathsf{*.f64}\left(re, re\right), \frac{1}{24}\right)\right)\right)\right), \mathsf{cosh.f64}\left(im\right)\right) \]
    12. Applied egg-rr72.6%

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

    if 0.429999999999999993 < re

    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. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(re\right)\right) \]
      14. *-lowering-*.f6496.1%

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

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

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

Alternative 6: 92.1% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;im \leq 2.5 \cdot 10^{+77}:\\
\;\;\;\;\cosh im\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if im < 1.55000000000000004 or 2.50000000000000002e77 < 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. *-rgt-identityN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.55000000000000004 < im < 2.50000000000000002e77

    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 re around 0

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

        \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{1} \]
    7. Recombined 2 regimes into one program.
    8. Final simplification94.5%

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

    Alternative 7: 84.5% accurate, 2.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\cos re \cdot 0.5\right) \cdot \left(im \cdot im + 2\right)\\ \mathbf{if}\;im \leq 1.55:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\cosh im\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (re im)
     :precision binary64
     (let* ((t_0 (* (* (cos re) 0.5) (+ (* im im) 2.0))))
       (if (<= im 1.55) t_0 (if (<= im 1.35e+154) (cosh im) t_0))))
    double code(double re, double im) {
    	double t_0 = (cos(re) * 0.5) * ((im * im) + 2.0);
    	double tmp;
    	if (im <= 1.55) {
    		tmp = t_0;
    	} else if (im <= 1.35e+154) {
    		tmp = cosh(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 = (cos(re) * 0.5d0) * ((im * im) + 2.0d0)
        if (im <= 1.55d0) then
            tmp = t_0
        else if (im <= 1.35d+154) then
            tmp = cosh(im)
        else
            tmp = t_0
        end if
        code = tmp
    end function
    
    public static double code(double re, double im) {
    	double t_0 = (Math.cos(re) * 0.5) * ((im * im) + 2.0);
    	double tmp;
    	if (im <= 1.55) {
    		tmp = t_0;
    	} else if (im <= 1.35e+154) {
    		tmp = Math.cosh(im);
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    def code(re, im):
    	t_0 = (math.cos(re) * 0.5) * ((im * im) + 2.0)
    	tmp = 0
    	if im <= 1.55:
    		tmp = t_0
    	elif im <= 1.35e+154:
    		tmp = math.cosh(im)
    	else:
    		tmp = t_0
    	return tmp
    
    function code(re, im)
    	t_0 = Float64(Float64(cos(re) * 0.5) * Float64(Float64(im * im) + 2.0))
    	tmp = 0.0
    	if (im <= 1.55)
    		tmp = t_0;
    	elseif (im <= 1.35e+154)
    		tmp = cosh(im);
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(re, im)
    	t_0 = (cos(re) * 0.5) * ((im * im) + 2.0);
    	tmp = 0.0;
    	if (im <= 1.55)
    		tmp = t_0;
    	elseif (im <= 1.35e+154)
    		tmp = cosh(im);
    	else
    		tmp = t_0;
    	end
    	tmp_2 = tmp;
    end
    
    code[re_, im_] := Block[{t$95$0 = N[(N[(N[Cos[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 1.55], t$95$0, If[LessEqual[im, 1.35e+154], N[Cosh[im], $MachinePrecision], t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \left(\cos re \cdot 0.5\right) \cdot \left(im \cdot im + 2\right)\\
    \mathbf{if}\;im \leq 1.55:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
    \;\;\;\;\cosh im\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if im < 1.55000000000000004 or 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 \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(re\right)\right), \color{blue}{\left(2 + {im}^{2}\right)}\right) \]
      4. Step-by-step derivation
        1. +-lowering-+.f64N/A

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

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

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

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

      if 1.55000000000000004 < 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. Taylor expanded in re around 0

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

          \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{1} \]
      7. Recombined 2 regimes into one program.
      8. Final simplification86.2%

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

      Alternative 8: 68.9% accurate, 2.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 2.7:\\ \;\;\;\;\cos re\\ \mathbf{else}:\\ \;\;\;\;\cosh im\\ \end{array} \end{array} \]
      (FPCore (re im) :precision binary64 (if (<= im 2.7) (cos re) (cosh im)))
      double code(double re, double im) {
      	double tmp;
      	if (im <= 2.7) {
      		tmp = cos(re);
      	} else {
      		tmp = cosh(im);
      	}
      	return tmp;
      }
      
      real(8) function code(re, im)
          real(8), intent (in) :: re
          real(8), intent (in) :: im
          real(8) :: tmp
          if (im <= 2.7d0) then
              tmp = cos(re)
          else
              tmp = cosh(im)
          end if
          code = tmp
      end function
      
      public static double code(double re, double im) {
      	double tmp;
      	if (im <= 2.7) {
      		tmp = Math.cos(re);
      	} else {
      		tmp = Math.cosh(im);
      	}
      	return tmp;
      }
      
      def code(re, im):
      	tmp = 0
      	if im <= 2.7:
      		tmp = math.cos(re)
      	else:
      		tmp = math.cosh(im)
      	return tmp
      
      function code(re, im)
      	tmp = 0.0
      	if (im <= 2.7)
      		tmp = cos(re);
      	else
      		tmp = cosh(im);
      	end
      	return tmp
      end
      
      function tmp_2 = code(re, im)
      	tmp = 0.0;
      	if (im <= 2.7)
      		tmp = cos(re);
      	else
      		tmp = cosh(im);
      	end
      	tmp_2 = tmp;
      end
      
      code[re_, im_] := If[LessEqual[im, 2.7], N[Cos[re], $MachinePrecision], N[Cosh[im], $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;im \leq 2.7:\\
      \;\;\;\;\cos re\\
      
      \mathbf{else}:\\
      \;\;\;\;\cosh im\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if im < 2.7000000000000002

        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.f6468.9%

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

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

        if 2.7000000000000002 < im

        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 re around 0

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

            \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{1} \]
        7. Recombined 2 regimes into one program.
        8. Final simplification72.0%

          \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 2.7:\\ \;\;\;\;\cos re\\ \mathbf{else}:\\ \;\;\;\;\cosh im\\ \end{array} \]
        9. Add Preprocessing

        Alternative 9: 67.6% accurate, 2.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\\ t_1 := \left(im \cdot im\right) \cdot t\_0\\ \mathbf{if}\;im \leq 510:\\ \;\;\;\;\cos re\\ \mathbf{elif}\;im \leq 9.2 \cdot 10^{+51}:\\ \;\;\;\;\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + \left(re \cdot re\right) \cdot \left(0.041666666666666664 + re \cdot \left(re \cdot -0.001388888888888889\right)\right)\right)\right) \cdot \left(1 + \frac{\left(im \cdot im\right) \cdot \left(0.25 - \left(im \cdot im\right) \cdot \left(t\_0 \cdot t\_1\right)\right)}{0.5 - t\_1}\right)\\ \mathbf{else}:\\ \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot t\_0\right)\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)))
           (if (<= im 510.0)
             (cos re)
             (if (<= im 9.2e+51)
               (*
                (+
                 1.0
                 (*
                  (* re re)
                  (+
                   -0.5
                   (*
                    (* re re)
                    (+ 0.041666666666666664 (* re (* re -0.001388888888888889)))))))
                (+
                 1.0
                 (/ (* (* im im) (- 0.25 (* (* im im) (* t_0 t_1)))) (- 0.5 t_1))))
               (+ 1.0 (* im (* im (+ 0.5 (* im (* im t_0))))))))))
        double code(double re, double im) {
        	double t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
        	double t_1 = (im * im) * t_0;
        	double tmp;
        	if (im <= 510.0) {
        		tmp = cos(re);
        	} else if (im <= 9.2e+51) {
        		tmp = (1.0 + ((re * re) * (-0.5 + ((re * re) * (0.041666666666666664 + (re * (re * -0.001388888888888889))))))) * (1.0 + (((im * im) * (0.25 - ((im * im) * (t_0 * t_1)))) / (0.5 - t_1)));
        	} else {
        		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 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) :: t_1
            real(8) :: tmp
            t_0 = 0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)
            t_1 = (im * im) * t_0
            if (im <= 510.0d0) then
                tmp = cos(re)
            else if (im <= 9.2d+51) then
                tmp = (1.0d0 + ((re * re) * ((-0.5d0) + ((re * re) * (0.041666666666666664d0 + (re * (re * (-0.001388888888888889d0)))))))) * (1.0d0 + (((im * im) * (0.25d0 - ((im * im) * (t_0 * t_1)))) / (0.5d0 - t_1)))
            else
                tmp = 1.0d0 + (im * (im * (0.5d0 + (im * (im * t_0)))))
            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 tmp;
        	if (im <= 510.0) {
        		tmp = Math.cos(re);
        	} else if (im <= 9.2e+51) {
        		tmp = (1.0 + ((re * re) * (-0.5 + ((re * re) * (0.041666666666666664 + (re * (re * -0.001388888888888889))))))) * (1.0 + (((im * im) * (0.25 - ((im * im) * (t_0 * t_1)))) / (0.5 - t_1)));
        	} else {
        		tmp = 1.0 + (im * (im * (0.5 + (im * (im * t_0)))));
        	}
        	return tmp;
        }
        
        def code(re, im):
        	t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889)
        	t_1 = (im * im) * t_0
        	tmp = 0
        	if im <= 510.0:
        		tmp = math.cos(re)
        	elif im <= 9.2e+51:
        		tmp = (1.0 + ((re * re) * (-0.5 + ((re * re) * (0.041666666666666664 + (re * (re * -0.001388888888888889))))))) * (1.0 + (((im * im) * (0.25 - ((im * im) * (t_0 * t_1)))) / (0.5 - t_1)))
        	else:
        		tmp = 1.0 + (im * (im * (0.5 + (im * (im * t_0)))))
        	return tmp
        
        function code(re, im)
        	t_0 = Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889))
        	t_1 = Float64(Float64(im * im) * t_0)
        	tmp = 0.0
        	if (im <= 510.0)
        		tmp = cos(re);
        	elseif (im <= 9.2e+51)
        		tmp = Float64(Float64(1.0 + Float64(Float64(re * re) * Float64(-0.5 + Float64(Float64(re * re) * Float64(0.041666666666666664 + Float64(re * Float64(re * -0.001388888888888889))))))) * Float64(1.0 + Float64(Float64(Float64(im * im) * Float64(0.25 - Float64(Float64(im * im) * Float64(t_0 * t_1)))) / Float64(0.5 - t_1))));
        	else
        		tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * t_0))))));
        	end
        	return tmp
        end
        
        function tmp_2 = code(re, im)
        	t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
        	t_1 = (im * im) * t_0;
        	tmp = 0.0;
        	if (im <= 510.0)
        		tmp = cos(re);
        	elseif (im <= 9.2e+51)
        		tmp = (1.0 + ((re * re) * (-0.5 + ((re * re) * (0.041666666666666664 + (re * (re * -0.001388888888888889))))))) * (1.0 + (((im * im) * (0.25 - ((im * im) * (t_0 * t_1)))) / (0.5 - t_1)));
        	else
        		tmp = 1.0 + (im * (im * (0.5 + (im * (im * t_0)))));
        	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[(N[(im * im), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[im, 510.0], N[Cos[re], $MachinePrecision], If[LessEqual[im, 9.2e+51], N[(N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.5 + N[(N[(re * re), $MachinePrecision] * N[(0.041666666666666664 + N[(re * N[(re * -0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(im * im), $MachinePrecision] * 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[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := 0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\\
        t_1 := \left(im \cdot im\right) \cdot t\_0\\
        \mathbf{if}\;im \leq 510:\\
        \;\;\;\;\cos re\\
        
        \mathbf{elif}\;im \leq 9.2 \cdot 10^{+51}:\\
        \;\;\;\;\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + \left(re \cdot re\right) \cdot \left(0.041666666666666664 + re \cdot \left(re \cdot -0.001388888888888889\right)\right)\right)\right) \cdot \left(1 + \frac{\left(im \cdot im\right) \cdot \left(0.25 - \left(im \cdot im\right) \cdot \left(t\_0 \cdot t\_1\right)\right)}{0.5 - t\_1}\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot t\_0\right)\right)\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if im < 510

          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.f6468.6%

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

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

          if 510 < im < 9.2000000000000002e51

          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 re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + \left(re \cdot re\right) \cdot \left(0.041666666666666664 + re \cdot \left(re \cdot -0.001388888888888889\right)\right)\right)\right)} \]
          8. 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{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
          9. Step-by-step derivation
            1. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \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), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
            2. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\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, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
          10. Simplified20.8%

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

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

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

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

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

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

          if 9.2000000000000002e51 < im

          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 re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \mathsf{cosh.f64}\left(im\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \color{blue}{\frac{-1}{720}}\right)\right)\right)\right)\right)\right)\right)\right) \]
          7. Simplified63.6%

            \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + \left(re \cdot re\right) \cdot \left(0.041666666666666664 + re \cdot \left(re \cdot -0.001388888888888889\right)\right)\right)\right)} \]
          8. 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{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
          9. Step-by-step derivation
            1. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \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), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
            2. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\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, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
          10. Simplified63.6%

            \[\leadsto \color{blue}{\left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\right)\right)\right)\right)} \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + \left(re \cdot re\right) \cdot \left(0.041666666666666664 + re \cdot \left(re \cdot -0.001388888888888889\right)\right)\right)\right) \]
          11. Taylor expanded in re 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)} \]
          12. 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. unpow2N/A

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

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

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

              \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{2} + {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(im, \mathsf{*.f64}\left(im, \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)\right) \]
            7. unpow2N/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 \left(\color{blue}{\frac{1}{24}} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)\right)\right) \]
            8. associate-*l*N/A

              \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)}\right)\right)\right)\right)\right) \]
            9. *-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(im, \color{blue}{\left(im \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\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(\frac{1}{2}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right)\right) \]
            11. +-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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{24}, \color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right)\right)\right) \]
            12. *-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, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{24}, \left({im}^{2} \cdot \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right)\right)\right) \]
            13. *-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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right)\right)\right) \]
            14. unpow2N/A

              \[\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, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
            15. *-lowering-*.f6486.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, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
          13. Simplified86.4%

            \[\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)} \]
        3. Recombined 3 regimes into one program.
        4. Final simplification71.2%

          \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 510:\\ \;\;\;\;\cos re\\ \mathbf{elif}\;im \leq 9.2 \cdot 10^{+51}:\\ \;\;\;\;\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + \left(re \cdot re\right) \cdot \left(0.041666666666666664 + re \cdot \left(re \cdot -0.001388888888888889\right)\right)\right)\right) \cdot \left(1 + \frac{\left(im \cdot im\right) \cdot \left(0.25 - \left(im \cdot im\right) \cdot \left(\left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right) \cdot \left(\left(im \cdot im\right) \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)}{0.5 - \left(im \cdot im\right) \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;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)\\ \end{array} \]
        5. Add Preprocessing

        Alternative 10: 45.5% accurate, 4.1× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\\ t_1 := \left(im \cdot im\right) \cdot t\_0\\ \mathbf{if}\;im \leq 2.5 \cdot 10^{-9}:\\ \;\;\;\;1\\ \mathbf{elif}\;im \leq 5 \cdot 10^{+51}:\\ \;\;\;\;\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + \left(re \cdot re\right) \cdot \left(0.041666666666666664 + re \cdot \left(re \cdot -0.001388888888888889\right)\right)\right)\right) \cdot \left(1 + \frac{\left(im \cdot im\right) \cdot \left(0.25 - \left(im \cdot im\right) \cdot \left(t\_0 \cdot t\_1\right)\right)}{0.5 - t\_1}\right)\\ \mathbf{else}:\\ \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot t\_0\right)\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)))
           (if (<= im 2.5e-9)
             1.0
             (if (<= im 5e+51)
               (*
                (+
                 1.0
                 (*
                  (* re re)
                  (+
                   -0.5
                   (*
                    (* re re)
                    (+ 0.041666666666666664 (* re (* re -0.001388888888888889)))))))
                (+
                 1.0
                 (/ (* (* im im) (- 0.25 (* (* im im) (* t_0 t_1)))) (- 0.5 t_1))))
               (+ 1.0 (* im (* im (+ 0.5 (* im (* im t_0))))))))))
        double code(double re, double im) {
        	double t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
        	double t_1 = (im * im) * t_0;
        	double tmp;
        	if (im <= 2.5e-9) {
        		tmp = 1.0;
        	} else if (im <= 5e+51) {
        		tmp = (1.0 + ((re * re) * (-0.5 + ((re * re) * (0.041666666666666664 + (re * (re * -0.001388888888888889))))))) * (1.0 + (((im * im) * (0.25 - ((im * im) * (t_0 * t_1)))) / (0.5 - t_1)));
        	} else {
        		tmp = 1.0 + (im * (im * (0.5 + (im * (im * 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) :: t_1
            real(8) :: tmp
            t_0 = 0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)
            t_1 = (im * im) * t_0
            if (im <= 2.5d-9) then
                tmp = 1.0d0
            else if (im <= 5d+51) then
                tmp = (1.0d0 + ((re * re) * ((-0.5d0) + ((re * re) * (0.041666666666666664d0 + (re * (re * (-0.001388888888888889d0)))))))) * (1.0d0 + (((im * im) * (0.25d0 - ((im * im) * (t_0 * t_1)))) / (0.5d0 - t_1)))
            else
                tmp = 1.0d0 + (im * (im * (0.5d0 + (im * (im * t_0)))))
            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 tmp;
        	if (im <= 2.5e-9) {
        		tmp = 1.0;
        	} else if (im <= 5e+51) {
        		tmp = (1.0 + ((re * re) * (-0.5 + ((re * re) * (0.041666666666666664 + (re * (re * -0.001388888888888889))))))) * (1.0 + (((im * im) * (0.25 - ((im * im) * (t_0 * t_1)))) / (0.5 - t_1)));
        	} else {
        		tmp = 1.0 + (im * (im * (0.5 + (im * (im * t_0)))));
        	}
        	return tmp;
        }
        
        def code(re, im):
        	t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889)
        	t_1 = (im * im) * t_0
        	tmp = 0
        	if im <= 2.5e-9:
        		tmp = 1.0
        	elif im <= 5e+51:
        		tmp = (1.0 + ((re * re) * (-0.5 + ((re * re) * (0.041666666666666664 + (re * (re * -0.001388888888888889))))))) * (1.0 + (((im * im) * (0.25 - ((im * im) * (t_0 * t_1)))) / (0.5 - t_1)))
        	else:
        		tmp = 1.0 + (im * (im * (0.5 + (im * (im * t_0)))))
        	return tmp
        
        function code(re, im)
        	t_0 = Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889))
        	t_1 = Float64(Float64(im * im) * t_0)
        	tmp = 0.0
        	if (im <= 2.5e-9)
        		tmp = 1.0;
        	elseif (im <= 5e+51)
        		tmp = Float64(Float64(1.0 + Float64(Float64(re * re) * Float64(-0.5 + Float64(Float64(re * re) * Float64(0.041666666666666664 + Float64(re * Float64(re * -0.001388888888888889))))))) * Float64(1.0 + Float64(Float64(Float64(im * im) * Float64(0.25 - Float64(Float64(im * im) * Float64(t_0 * t_1)))) / Float64(0.5 - t_1))));
        	else
        		tmp = Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * t_0))))));
        	end
        	return tmp
        end
        
        function tmp_2 = code(re, im)
        	t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
        	t_1 = (im * im) * t_0;
        	tmp = 0.0;
        	if (im <= 2.5e-9)
        		tmp = 1.0;
        	elseif (im <= 5e+51)
        		tmp = (1.0 + ((re * re) * (-0.5 + ((re * re) * (0.041666666666666664 + (re * (re * -0.001388888888888889))))))) * (1.0 + (((im * im) * (0.25 - ((im * im) * (t_0 * t_1)))) / (0.5 - t_1)));
        	else
        		tmp = 1.0 + (im * (im * (0.5 + (im * (im * t_0)))));
        	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[(N[(im * im), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[im, 2.5e-9], 1.0, If[LessEqual[im, 5e+51], N[(N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.5 + N[(N[(re * re), $MachinePrecision] * N[(0.041666666666666664 + N[(re * N[(re * -0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(im * im), $MachinePrecision] * 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[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := 0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\\
        t_1 := \left(im \cdot im\right) \cdot t\_0\\
        \mathbf{if}\;im \leq 2.5 \cdot 10^{-9}:\\
        \;\;\;\;1\\
        
        \mathbf{elif}\;im \leq 5 \cdot 10^{+51}:\\
        \;\;\;\;\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + \left(re \cdot re\right) \cdot \left(0.041666666666666664 + re \cdot \left(re \cdot -0.001388888888888889\right)\right)\right)\right) \cdot \left(1 + \frac{\left(im \cdot im\right) \cdot \left(0.25 - \left(im \cdot im\right) \cdot \left(t\_0 \cdot t\_1\right)\right)}{0.5 - t\_1}\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot t\_0\right)\right)\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if im < 2.5000000000000001e-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.f6469.1%

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

            \[\leadsto \color{blue}{\cos re} \]
          6. Taylor expanded in re around 0

            \[\leadsto \color{blue}{1} \]
          7. Step-by-step derivation
            1. Simplified36.2%

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

            if 2.5000000000000001e-9 < im < 5e51

            1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + \left(re \cdot re\right) \cdot \left(0.041666666666666664 + re \cdot \left(re \cdot -0.001388888888888889\right)\right)\right)\right)} \]
            8. 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{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
            9. Step-by-step derivation
              1. +-lowering-+.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \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), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
              2. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\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, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, \left(im \cdot \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
              16. *-lowering-*.f6416.0%

                \[\leadsto \mathsf{*.f64}\left(\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, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
            10. Simplified16.0%

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\left(im \cdot im\right) \cdot \left(\frac{1}{2} \cdot \frac{1}{2} - \left(im \cdot \left(im \cdot \left(\frac{1}{24} + im \cdot \left(im \cdot \frac{1}{720}\right)\right)\right)\right) \cdot \left(im \cdot \left(im \cdot \left(\frac{1}{24} + im \cdot \left(im \cdot \frac{1}{720}\right)\right)\right)\right)\right)\right), \left(\frac{1}{2} - im \cdot \left(im \cdot \left(\frac{1}{24} + im \cdot \left(im \cdot \frac{1}{720}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
            12. Applied egg-rr39.5%

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

            if 5e51 < im

            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 re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(1, \mathsf{cosh.f64}\left(im\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \color{blue}{\frac{-1}{720}}\right)\right)\right)\right)\right)\right)\right)\right) \]
            7. Simplified63.6%

              \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + \left(re \cdot re\right) \cdot \left(0.041666666666666664 + re \cdot \left(re \cdot -0.001388888888888889\right)\right)\right)\right)} \]
            8. 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{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
            9. Step-by-step derivation
              1. +-lowering-+.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \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), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
              2. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\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, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
            10. Simplified63.6%

              \[\leadsto \color{blue}{\left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\right)\right)\right)\right)} \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + \left(re \cdot re\right) \cdot \left(0.041666666666666664 + re \cdot \left(re \cdot -0.001388888888888889\right)\right)\right)\right) \]
            11. Taylor expanded in re 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)} \]
            12. 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. unpow2N/A

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

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

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

                \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{2} + {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(im, \mathsf{*.f64}\left(im, \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)\right) \]
              7. unpow2N/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 \left(\color{blue}{\frac{1}{24}} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)\right)\right) \]
              8. associate-*l*N/A

                \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)}\right)\right)\right)\right)\right) \]
              9. *-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(im, \color{blue}{\left(im \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\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(\frac{1}{2}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right)\right) \]
              11. +-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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{24}, \color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right)\right)\right) \]
              12. *-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, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{24}, \left({im}^{2} \cdot \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right)\right)\right) \]
              13. *-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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right)\right)\right) \]
              14. unpow2N/A

                \[\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, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
              15. *-lowering-*.f6486.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, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
            13. Simplified86.4%

              \[\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)} \]
          8. Recombined 3 regimes into one program.
          9. Final simplification44.9%

            \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 2.5 \cdot 10^{-9}:\\ \;\;\;\;1\\ \mathbf{elif}\;im \leq 5 \cdot 10^{+51}:\\ \;\;\;\;\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + \left(re \cdot re\right) \cdot \left(0.041666666666666664 + re \cdot \left(re \cdot -0.001388888888888889\right)\right)\right)\right) \cdot \left(1 + \frac{\left(im \cdot im\right) \cdot \left(0.25 - \left(im \cdot im\right) \cdot \left(\left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right) \cdot \left(\left(im \cdot im\right) \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)}{0.5 - \left(im \cdot im\right) \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;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)\\ \end{array} \]
          10. Add Preprocessing

          Alternative 11: 58.8% accurate, 16.2× speedup?

          \[\begin{array}{l} \\ 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) \end{array} \]
          (FPCore (re im)
           :precision binary64
           (+
            1.0
            (*
             im
             (*
              im
              (+
               0.5
               (*
                im
                (* im (+ 0.041666666666666664 (* (* im im) 0.001388888888888889)))))))))
          double code(double re, double im) {
          	return 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))));
          }
          
          real(8) function code(re, im)
              real(8), intent (in) :: re
              real(8), intent (in) :: im
              code = 1.0d0 + (im * (im * (0.5d0 + (im * (im * (0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)))))))
          end function
          
          public static double code(double re, double im) {
          	return 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))));
          }
          
          def code(re, im):
          	return 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))))
          
          function code(re, im)
          	return Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889))))))))
          end
          
          function tmp = code(re, im)
          	tmp = 1.0 + (im * (im * (0.5 + (im * (im * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))));
          end
          
          code[re_, im_] := 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]
          
          \begin{array}{l}
          
          \\
          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)
          \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. Taylor expanded in re around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + \left(re \cdot re\right) \cdot \left(0.041666666666666664 + re \cdot \left(re \cdot -0.001388888888888889\right)\right)\right)\right)} \]
          8. 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{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
          9. Step-by-step derivation
            1. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \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), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
            2. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\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, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
          10. Simplified54.1%

            \[\leadsto \color{blue}{\left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\right)\right)\right)\right)} \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + \left(re \cdot re\right) \cdot \left(0.041666666666666664 + re \cdot \left(re \cdot -0.001388888888888889\right)\right)\right)\right) \]
          11. Taylor expanded in re 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)} \]
          12. 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. unpow2N/A

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

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

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

              \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{2} + {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(im, \mathsf{*.f64}\left(im, \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)\right) \]
            7. unpow2N/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 \left(\color{blue}{\frac{1}{24}} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)\right)\right) \]
            8. associate-*l*N/A

              \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)}\right)\right)\right)\right)\right) \]
            9. *-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(im, \color{blue}{\left(im \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\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(\frac{1}{2}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right)\right) \]
            11. +-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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{24}, \color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right)\right)\right) \]
            12. *-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, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{24}, \left({im}^{2} \cdot \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right)\right)\right) \]
            13. *-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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right)\right)\right) \]
            14. unpow2N/A

              \[\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, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
            15. *-lowering-*.f6460.1%

              \[\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, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
          13. Simplified60.1%

            \[\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)} \]
          14. Add Preprocessing

          Alternative 12: 55.9% accurate, 23.7× speedup?

          \[\begin{array}{l} \\ 1 + im \cdot \left(im \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right) \end{array} \]
          (FPCore (re im)
           :precision binary64
           (+ 1.0 (* im (* im (+ 0.5 (* 0.041666666666666664 (* im im)))))))
          double code(double re, double im) {
          	return 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im)))));
          }
          
          real(8) function code(re, im)
              real(8), intent (in) :: re
              real(8), intent (in) :: im
              code = 1.0d0 + (im * (im * (0.5d0 + (0.041666666666666664d0 * (im * im)))))
          end function
          
          public static double code(double re, double im) {
          	return 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im)))));
          }
          
          def code(re, im):
          	return 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im)))))
          
          function code(re, im)
          	return Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(0.041666666666666664 * Float64(im * im))))))
          end
          
          function tmp = code(re, im)
          	tmp = 1.0 + (im * (im * (0.5 + (0.041666666666666664 * (im * im)))));
          end
          
          code[re_, im_] := N[(1.0 + N[(im * N[(im * N[(0.5 + N[(0.041666666666666664 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          1 + im \cdot \left(im \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right)\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 + {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. *-rgt-identityN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)} \]
          9. Final simplification57.2%

            \[\leadsto 1 + im \cdot \left(im \cdot \left(0.5 + 0.041666666666666664 \cdot \left(im \cdot im\right)\right)\right) \]
          10. Add Preprocessing

          Alternative 13: 47.7% accurate, 25.6× speedup?

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

            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 \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(re\right)\right), \color{blue}{\left(2 + {im}^{2} \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{12} + \frac{1}{360} \cdot {im}^{2}\right)\right)\right)}\right) \]
            4. Step-by-step derivation
              1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(re\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{12}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{360}\right)\right)\right)\right)\right)\right)\right) \]
              13. *-lowering-*.f6494.2%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(re\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{12}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{360}\right)\right)\right)\right)\right)\right)\right) \]
            5. Simplified94.2%

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left({re}^{2} \cdot \left(\frac{1}{48} + \frac{-1}{1440} \cdot {re}^{2}\right) - \frac{1}{4}\right)\right)\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{12}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{360}\right)\right)\right)\right)\right)\right)\right) \]
              6. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left({re}^{2} \cdot \left(\frac{1}{48} + \frac{-1}{1440} \cdot {re}^{2}\right) + \left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{12}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{360}\right)\right)\right)\right)\right)\right)\right) \]
              7. metadata-evalN/A

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(\left({re}^{2}\right), \frac{-1}{1440}\right)\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{12}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{360}\right)\right)\right)\right)\right)\right)\right) \]
              16. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{-1}{1440}\right)\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{12}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{360}\right)\right)\right)\right)\right)\right)\right) \]
              17. *-lowering-*.f6454.7%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{-1}{1440}\right)\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{12}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{360}\right)\right)\right)\right)\right)\right)\right) \]
            8. Simplified54.7%

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

              \[\leadsto \color{blue}{2 \cdot \left(\frac{1}{2} + {re}^{2} \cdot \left({re}^{2} \cdot \left(\frac{1}{48} + \frac{-1}{1440} \cdot {re}^{2}\right) - \frac{1}{4}\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} + {re}^{2} \cdot \left({re}^{2} \cdot \left(\frac{1}{48} + \frac{-1}{1440} \cdot {re}^{2}\right) - \frac{1}{4}\right)\right)} \]
            10. Step-by-step derivation
              1. distribute-rgt-outN/A

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

                \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{2} + {re}^{2} \cdot \left({re}^{2} \cdot \left(\frac{1}{48} + \frac{-1}{1440} \cdot {re}^{2}\right) - \frac{1}{4}\right)\right), \color{blue}{\left(2 + {im}^{2}\right)}\right) \]
            11. Simplified46.1%

              \[\leadsto \color{blue}{\left(0.5 + re \cdot \left(re \cdot \left(-0.25 + \left(re \cdot re\right) \cdot \left(0.020833333333333332 + \left(re \cdot re\right) \cdot -0.0006944444444444445\right)\right)\right)\right) \cdot \left(2 + im \cdot im\right)} \]
            12. Taylor expanded in re around 0

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

                \[\leadsto \frac{1}{2} \cdot 2 + \color{blue}{\frac{1}{2} \cdot {im}^{2}} \]
              2. metadata-evalN/A

                \[\leadsto 1 + \color{blue}{\frac{1}{2}} \cdot {im}^{2} \]
              3. +-lowering-+.f64N/A

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

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

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

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

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

            if 2.7e229 < 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.f6451.6%

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

              \[\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-*.f6444.1%

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

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

              \[\leadsto \color{blue}{\frac{-1}{2} \cdot {re}^{2}} \]
            10. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto {re}^{2} \cdot \color{blue}{\frac{-1}{2}} \]
              2. *-lowering-*.f64N/A

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{-1}{2}\right) \]
            11. Simplified44.1%

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

          Alternative 14: 32.1% accurate, 30.8× speedup?

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

            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.f6467.9%

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

              \[\leadsto \color{blue}{\cos re} \]
            6. Taylor expanded in re around 0

              \[\leadsto \color{blue}{1} \]
            7. Step-by-step derivation
              1. Simplified35.6%

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

              if 7.5e15 < 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} \]
              4. Step-by-step derivation
                1. cos-lowering-cos.f643.1%

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

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

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

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

                \[\leadsto \color{blue}{\frac{-1}{2} \cdot {re}^{2}} \]
              10. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto {re}^{2} \cdot \color{blue}{\frac{-1}{2}} \]
                2. *-lowering-*.f64N/A

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

                  \[\leadsto \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{-1}{2}\right) \]
                4. *-lowering-*.f6411.3%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{-1}{2}\right) \]
              11. Simplified11.3%

                \[\leadsto \color{blue}{\left(re \cdot re\right) \cdot -0.5} \]
            8. Recombined 2 regimes into one program.
            9. Add Preprocessing

            Alternative 15: 29.2% 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.f6455.8%

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

              \[\leadsto \color{blue}{\cos re} \]
            6. Taylor expanded in re around 0

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

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

              Reproduce

              ?
              herbie shell --seed 2024161 
              (FPCore (re im)
                :name "math.cos on complex, real part"
                :precision binary64
                (* (* 0.5 (cos re)) (+ (exp (- im)) (exp im))))