math.sin on complex, imaginary part

Percentage Accurate: 54.9% → 99.9%
Time: 12.9s
Alternatives: 16
Speedup: 18.2×

Specification

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

\\
\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - 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 16 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: 54.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.5× speedup?

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

\\
\cos re \cdot \left(0 - \sinh im\right)
\end{array}
Derivation
  1. Initial program 52.7%

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\left(\cos re \cdot \left(e^{0 - im} - e^{im}\right)\right), \color{blue}{\frac{1}{2}}\right) \]
  4. Applied egg-rr99.9%

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

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

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

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

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

      \[\leadsto -1 \cdot \left(\color{blue}{\sinh im} \cdot \cos re\right) \]
    6. mul-1-negN/A

      \[\leadsto \mathsf{neg}\left(\sinh im \cdot \cos re\right) \]
    7. neg-lowering-neg.f64N/A

      \[\leadsto \mathsf{neg.f64}\left(\left(\sinh im \cdot \cos re\right)\right) \]
    8. *-commutativeN/A

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

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

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

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

    \[\leadsto \color{blue}{-\cos re \cdot \sinh im} \]
  7. Final simplification99.9%

    \[\leadsto \cos re \cdot \left(0 - \sinh im\right) \]
  8. Add Preprocessing

Alternative 2: 90.2% accurate, 2.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.0007:\\
\;\;\;\;\cos re \cdot \left(im \cdot \left(-1 + -0.16666666666666666 \cdot \left(im \cdot im\right)\right)\right)\\

\mathbf{elif}\;im \leq 1.2 \cdot 10^{+62}:\\
\;\;\;\;\sinh im \cdot \left(-1 - \left(re \cdot re\right) \cdot -0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < 6.99999999999999993e-4

    1. Initial program 35.9%

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

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot im\right) \cdot \cos re + im \cdot \left(\left(\frac{-1}{6} \cdot \cos re\right) \cdot {im}^{2}\right) \]
      8. neg-mul-1N/A

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

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

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

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

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

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

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

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

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

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

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

    if 6.99999999999999993e-4 < im < 1.2e62

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(\color{blue}{\sinh im} \cdot \cos re\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sinh im \cdot \cos re\right) \]
      7. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\sinh im \cdot \cos re\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2e62 < im

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 89.4% accurate, 2.6× speedup?

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

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

\mathbf{elif}\;im \leq 1.02 \cdot 10^{+103}:\\
\;\;\;\;\sinh im \cdot \left(-1 - \left(re \cdot re\right) \cdot -0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if im < 6.99999999999999993e-4 or 1.01999999999999991e103 < im

    1. Initial program 46.9%

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

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

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

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

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

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

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

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

        \[\leadsto \left(-1 \cdot im\right) \cdot \cos re + im \cdot \left(\left(\frac{-1}{6} \cdot \cos re\right) \cdot {im}^{2}\right) \]
      8. neg-mul-1N/A

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

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

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

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

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

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

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

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

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

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

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

    if 6.99999999999999993e-4 < im < 1.01999999999999991e103

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(\color{blue}{\sinh im} \cdot \cos re\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sinh im \cdot \cos re\right) \]
      7. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\sinh im \cdot \cos re\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 68.7% accurate, 2.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\
\;\;\;\;0 - \cos re \cdot im\\

\mathbf{elif}\;im \leq 4.5 \cdot 10^{+134}:\\
\;\;\;\;\sinh im \cdot \left(-1 - \left(re \cdot re\right) \cdot -0.5\right)\\

\mathbf{else}:\\
\;\;\;\;0 - \sinh im\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < 1.75e-12

    1. Initial program 35.8%

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

      \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \cos re\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(im \cdot \cos re\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{im \cdot \cos re} \]
      3. --lowering--.f64N/A

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

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

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(im, \mathsf{cos.f64}\left(re\right)\right)\right) \]
    5. Simplified70.0%

      \[\leadsto \color{blue}{0 - im \cdot \cos re} \]
    6. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{neg}\left(im \cdot \cos re\right) \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(im \cdot \cos re\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\cos re \cdot im\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\cos re, im\right)\right) \]
      5. cos-lowering-cos.f6470.0%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), im\right)\right) \]
    7. Applied egg-rr70.0%

      \[\leadsto \color{blue}{-\cos re \cdot im} \]

    if 1.75e-12 < im < 4.4999999999999997e134

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(\color{blue}{\sinh im} \cdot \cos re\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sinh im \cdot \cos re\right) \]
      7. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\sinh im \cdot \cos re\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.4999999999999997e134 < im

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(\color{blue}{\sinh im} \cdot \cos re\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sinh im \cdot \cos re\right) \]
      7. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\sinh im \cdot \cos re\right)\right) \]
      8. *-commutativeN/A

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

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

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

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

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

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

        \[\leadsto -\color{blue}{1} \cdot \sinh im \]
    9. Recombined 3 regimes into one program.
    10. Final simplification74.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\ \;\;\;\;0 - \cos re \cdot im\\ \mathbf{elif}\;im \leq 4.5 \cdot 10^{+134}:\\ \;\;\;\;\sinh im \cdot \left(-1 - \left(re \cdot re\right) \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;0 - \sinh im\\ \end{array} \]
    11. Add Preprocessing

    Alternative 5: 68.8% accurate, 2.6× speedup?

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

      1. Initial program 35.8%

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

        \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \cos re\right)} \]
      4. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{neg}\left(im \cdot \cos re\right) \]
        2. neg-sub0N/A

          \[\leadsto 0 - \color{blue}{im \cdot \cos re} \]
        3. --lowering--.f64N/A

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

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

          \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(im, \mathsf{cos.f64}\left(re\right)\right)\right) \]
      5. Simplified70.0%

        \[\leadsto \color{blue}{0 - im \cdot \cos re} \]
      6. Step-by-step derivation
        1. sub0-negN/A

          \[\leadsto \mathsf{neg}\left(im \cdot \cos re\right) \]
        2. neg-lowering-neg.f64N/A

          \[\leadsto \mathsf{neg.f64}\left(\left(im \cdot \cos re\right)\right) \]
        3. *-commutativeN/A

          \[\leadsto \mathsf{neg.f64}\left(\left(\cos re \cdot im\right)\right) \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\cos re, im\right)\right) \]
        5. cos-lowering-cos.f6470.0%

          \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(re\right), im\right)\right) \]
      7. Applied egg-rr70.0%

        \[\leadsto \color{blue}{-\cos re \cdot im} \]

      if 1.75e-12 < im < 1.0000000000000001e44 or 1.99999999999999984e134 < im

      1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

          \[\leadsto -1 \cdot \left(\color{blue}{\sinh im} \cdot \cos re\right) \]
        6. mul-1-negN/A

          \[\leadsto \mathsf{neg}\left(\sinh im \cdot \cos re\right) \]
        7. neg-lowering-neg.f64N/A

          \[\leadsto \mathsf{neg.f64}\left(\left(\sinh im \cdot \cos re\right)\right) \]
        8. *-commutativeN/A

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

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

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

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

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

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

          \[\leadsto -\color{blue}{1} \cdot \sinh im \]

        if 1.0000000000000001e44 < im < 1.99999999999999984e134

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{2}\right)\right)\right), \mathsf{*.f64}\left(im, \left(\left(\left(\frac{-1}{120} + \left(im \cdot im\right) \cdot \frac{-1}{5040}\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \frac{-1}{6} \cdot \left(im \cdot im\right)\right) + \color{blue}{-1}\right)\right)\right) \]
        10. Applied egg-rr80.0%

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{2}\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{120}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, \frac{-1}{5040}\right), im\right)\right)\right), \frac{-1}{6}\right)\right)\right)\right)\right) \]
        12. Applied egg-rr80.0%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\ \;\;\;\;0 - \cos re \cdot im\\ \mathbf{elif}\;im \leq 10^{+44}:\\ \;\;\;\;0 - \sinh im\\ \mathbf{elif}\;im \leq 2 \cdot 10^{+134}:\\ \;\;\;\;\left(1 + re \cdot \left(re \cdot -0.5\right)\right) \cdot \left(im \cdot \left(-1 + \left(im \cdot im\right) \cdot \left(-0.16666666666666666 + \left(im \cdot im\right) \cdot \left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0 - \sinh im\\ \end{array} \]
      11. Add Preprocessing

      Alternative 6: 66.1% accurate, 2.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0 - \sinh im\\ \mathbf{if}\;im \leq 5.5 \cdot 10^{+43}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;im \leq 4.5 \cdot 10^{+134}:\\ \;\;\;\;\left(1 + re \cdot \left(re \cdot -0.5\right)\right) \cdot \left(im \cdot \left(-1 + \left(im \cdot im\right) \cdot \left(-0.16666666666666666 + \left(im \cdot im\right) \cdot \left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (re im)
       :precision binary64
       (let* ((t_0 (- 0.0 (sinh im))))
         (if (<= im 5.5e+43)
           t_0
           (if (<= im 4.5e+134)
             (*
              (+ 1.0 (* re (* re -0.5)))
              (*
               im
               (+
                -1.0
                (*
                 (* im im)
                 (+
                  -0.16666666666666666
                  (*
                   (* im im)
                   (+
                    -0.008333333333333333
                    (* im (* im -0.0001984126984126984)))))))))
             t_0))))
      double code(double re, double im) {
      	double t_0 = 0.0 - sinh(im);
      	double tmp;
      	if (im <= 5.5e+43) {
      		tmp = t_0;
      	} else if (im <= 4.5e+134) {
      		tmp = (1.0 + (re * (re * -0.5))) * (im * (-1.0 + ((im * im) * (-0.16666666666666666 + ((im * im) * (-0.008333333333333333 + (im * (im * -0.0001984126984126984))))))));
      	} 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 = 0.0d0 - sinh(im)
          if (im <= 5.5d+43) then
              tmp = t_0
          else if (im <= 4.5d+134) then
              tmp = (1.0d0 + (re * (re * (-0.5d0)))) * (im * ((-1.0d0) + ((im * im) * ((-0.16666666666666666d0) + ((im * im) * ((-0.008333333333333333d0) + (im * (im * (-0.0001984126984126984d0)))))))))
          else
              tmp = t_0
          end if
          code = tmp
      end function
      
      public static double code(double re, double im) {
      	double t_0 = 0.0 - Math.sinh(im);
      	double tmp;
      	if (im <= 5.5e+43) {
      		tmp = t_0;
      	} else if (im <= 4.5e+134) {
      		tmp = (1.0 + (re * (re * -0.5))) * (im * (-1.0 + ((im * im) * (-0.16666666666666666 + ((im * im) * (-0.008333333333333333 + (im * (im * -0.0001984126984126984))))))));
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      def code(re, im):
      	t_0 = 0.0 - math.sinh(im)
      	tmp = 0
      	if im <= 5.5e+43:
      		tmp = t_0
      	elif im <= 4.5e+134:
      		tmp = (1.0 + (re * (re * -0.5))) * (im * (-1.0 + ((im * im) * (-0.16666666666666666 + ((im * im) * (-0.008333333333333333 + (im * (im * -0.0001984126984126984))))))))
      	else:
      		tmp = t_0
      	return tmp
      
      function code(re, im)
      	t_0 = Float64(0.0 - sinh(im))
      	tmp = 0.0
      	if (im <= 5.5e+43)
      		tmp = t_0;
      	elseif (im <= 4.5e+134)
      		tmp = Float64(Float64(1.0 + Float64(re * Float64(re * -0.5))) * Float64(im * Float64(-1.0 + Float64(Float64(im * im) * Float64(-0.16666666666666666 + Float64(Float64(im * im) * Float64(-0.008333333333333333 + Float64(im * Float64(im * -0.0001984126984126984)))))))));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      function tmp_2 = code(re, im)
      	t_0 = 0.0 - sinh(im);
      	tmp = 0.0;
      	if (im <= 5.5e+43)
      		tmp = t_0;
      	elseif (im <= 4.5e+134)
      		tmp = (1.0 + (re * (re * -0.5))) * (im * (-1.0 + ((im * im) * (-0.16666666666666666 + ((im * im) * (-0.008333333333333333 + (im * (im * -0.0001984126984126984))))))));
      	else
      		tmp = t_0;
      	end
      	tmp_2 = tmp;
      end
      
      code[re_, im_] := Block[{t$95$0 = N[(0.0 - N[Sinh[im], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 5.5e+43], t$95$0, If[LessEqual[im, 4.5e+134], N[(N[(1.0 + N[(re * N[(re * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(im * N[(-1.0 + N[(N[(im * im), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(im * im), $MachinePrecision] * N[(-0.008333333333333333 + N[(im * N[(im * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := 0 - \sinh im\\
      \mathbf{if}\;im \leq 5.5 \cdot 10^{+43}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;im \leq 4.5 \cdot 10^{+134}:\\
      \;\;\;\;\left(1 + re \cdot \left(re \cdot -0.5\right)\right) \cdot \left(im \cdot \left(-1 + \left(im \cdot im\right) \cdot \left(-0.16666666666666666 + \left(im \cdot im\right) \cdot \left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right)\right)\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if im < 5.49999999999999989e43 or 4.4999999999999997e134 < im

        1. Initial program 48.6%

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\left(\cos re \cdot \left(e^{0 - im} - e^{im}\right)\right), \color{blue}{\frac{1}{2}}\right) \]
        4. Applied egg-rr99.9%

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

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

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

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

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

            \[\leadsto -1 \cdot \left(\color{blue}{\sinh im} \cdot \cos re\right) \]
          6. mul-1-negN/A

            \[\leadsto \mathsf{neg}\left(\sinh im \cdot \cos re\right) \]
          7. neg-lowering-neg.f64N/A

            \[\leadsto \mathsf{neg.f64}\left(\left(\sinh im \cdot \cos re\right)\right) \]
          8. *-commutativeN/A

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

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

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

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

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

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

            \[\leadsto -\color{blue}{1} \cdot \sinh im \]

          if 5.49999999999999989e43 < im < 4.4999999999999997e134

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{2}\right)\right)\right), \mathsf{*.f64}\left(im, \left(\left(\left(\frac{-1}{120} + \left(im \cdot im\right) \cdot \frac{-1}{5040}\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \frac{-1}{6} \cdot \left(im \cdot im\right)\right) + \color{blue}{-1}\right)\right)\right) \]
          10. Applied egg-rr80.0%

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{2}\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{120}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, \frac{-1}{5040}\right), im\right)\right)\right), \frac{-1}{6}\right)\right)\right)\right)\right) \]
          12. Applied egg-rr80.0%

            \[\leadsto \left(1 + re \cdot \left(re \cdot -0.5\right)\right) \cdot \left(im \cdot \left(-1 + \left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(-0.008333333333333333 + \color{blue}{\left(im \cdot -0.0001984126984126984\right) \cdot im}\right) + -0.16666666666666666\right)\right)\right) \]
        9. Recombined 2 regimes into one program.
        10. Final simplification63.9%

          \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 5.5 \cdot 10^{+43}:\\ \;\;\;\;0 - \sinh im\\ \mathbf{elif}\;im \leq 4.5 \cdot 10^{+134}:\\ \;\;\;\;\left(1 + re \cdot \left(re \cdot -0.5\right)\right) \cdot \left(im \cdot \left(-1 + \left(im \cdot im\right) \cdot \left(-0.16666666666666666 + \left(im \cdot im\right) \cdot \left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0 - \sinh im\\ \end{array} \]
        11. Add Preprocessing

        Alternative 7: 61.6% accurate, 5.6× speedup?

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

          1. Initial program 36.5%

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{120} \cdot \cos re + \frac{-1}{5040} \cdot \left({im}^{2} \cdot \cos re\right)\right)\right) + \color{blue}{\left(-1 \cdot \cos re + \left(\frac{-1}{6} \cdot \cos re\right) \cdot {im}^{2}\right)}\right)\right) \]
          5. Simplified94.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{2}\right)\right)\right), \mathsf{*.f64}\left(im, \left(\left(\left(\frac{-1}{120} + \left(im \cdot im\right) \cdot \frac{-1}{5040}\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \frac{-1}{6} \cdot \left(im \cdot im\right)\right) + \color{blue}{-1}\right)\right)\right) \]
          10. Applied egg-rr53.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{120}, \color{blue}{\left(\frac{-1}{5040} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right)\right)\right) \]
          13. Simplified54.5%

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

          if 510 < im < 2.2999999999999998e134

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\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), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{-1}{120}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{-1}{5040}\right)\right), \mathsf{*.f64}\left(\color{blue}{im}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, im\right)\right)\right)\right), \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right)\right)\right) \]
            5. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\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) + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{-1}{120}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{-1}{5040}\right)\right), \mathsf{*.f64}\left(im, \color{blue}{\mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, im\right)\right)}\right)\right), \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right)\right)\right) \]
            6. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{-1}{720}\right)\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{-1}{120}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{-1}{5040}\right)\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, im\right)\right)\right)\right), \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, im\right)\right)\right)\right)\right)\right) \]
            17. *-lowering-*.f6457.7%

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

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

          if 2.2999999999999998e134 < im

          1. Initial program 100.0%

            \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - 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(im \cdot \left(\frac{-1}{3} \cdot {im}^{2} - 2\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(im, \color{blue}{\left(\frac{-1}{3} \cdot {im}^{2} - 2\right)}\right)\right) \]
            2. sub-negN/A

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(im \cdot \color{blue}{\left(im \cdot \frac{-1}{3}\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(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \frac{-1}{3}\right)}\right)\right)\right)\right) \]
            10. *-lowering-*.f64100.0%

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

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

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

              \[\leadsto \color{blue}{0.5} \cdot \left(im \cdot \left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)\right) \]
          8. Recombined 3 regimes into one program.
          9. Final simplification58.8%

            \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 510:\\ \;\;\;\;im \cdot \left(-1 + \left(im \cdot im\right) \cdot \left(-0.16666666666666666 + im \cdot \left(im \cdot \left(-0.008333333333333333 + \left(im \cdot im\right) \cdot -0.0001984126984126984\right)\right)\right)\right)\\ \mathbf{elif}\;im \leq 2.3 \cdot 10^{+134}:\\ \;\;\;\;im \cdot \left(\left(1 + \left(re \cdot re\right) \cdot \left(-0.5 + re \cdot \left(re \cdot \left(0.041666666666666664 + \left(re \cdot re\right) \cdot -0.001388888888888889\right)\right)\right)\right) \cdot \left(\left(-1 + -0.16666666666666666 \cdot \left(im \cdot im\right)\right) + \left(-0.008333333333333333 + \left(im \cdot im\right) \cdot -0.0001984126984126984\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(im \cdot \left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)\right)\\ \end{array} \]
          10. Add Preprocessing

          Alternative 8: 62.0% accurate, 7.0× speedup?

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

            1. Initial program 36.5%

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{120} \cdot \cos re + \frac{-1}{5040} \cdot \left({im}^{2} \cdot \cos re\right)\right)\right) + \color{blue}{\left(-1 \cdot \cos re + \left(\frac{-1}{6} \cdot \cos re\right) \cdot {im}^{2}\right)}\right)\right) \]
            5. Simplified94.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{2}\right)\right)\right), \mathsf{*.f64}\left(im, \left(\left(\left(\frac{-1}{120} + \left(im \cdot im\right) \cdot \frac{-1}{5040}\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \frac{-1}{6} \cdot \left(im \cdot im\right)\right) + \color{blue}{-1}\right)\right)\right) \]
            10. Applied egg-rr53.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{120}, \color{blue}{\left(\frac{-1}{5040} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right)\right)\right) \]
            13. Simplified54.5%

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

            if 2950 < im < 7.5000000000000005e39

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{2}\right)\right)\right), \mathsf{*.f64}\left(im, \left(\left(\left(\frac{-1}{120} + \left(im \cdot im\right) \cdot \frac{-1}{5040}\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \frac{-1}{6} \cdot \left(im \cdot im\right)\right) + \color{blue}{-1}\right)\right)\right) \]
            10. Applied egg-rr12.9%

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{5040} \cdot {im}^{2} - \frac{1}{120}\right) - \frac{1}{6}\right) - 1\right) \cdot \color{blue}{\left(\frac{-1}{2} \cdot im + \frac{im}{{re}^{2}}\right)}\right)\right) \]
            13. Simplified59.4%

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

            if 7.5000000000000005e39 < im < 1.99999999999999984e134

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{2}\right)\right)\right), \mathsf{*.f64}\left(im, \left(\left(\left(\frac{-1}{120} + \left(im \cdot im\right) \cdot \frac{-1}{5040}\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \frac{-1}{6} \cdot \left(im \cdot im\right)\right) + \color{blue}{-1}\right)\right)\right) \]
            10. Applied egg-rr80.0%

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{2}\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{120}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, \frac{-1}{5040}\right), im\right)\right)\right), \frac{-1}{6}\right)\right)\right)\right)\right) \]
            12. Applied egg-rr80.0%

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

            if 1.99999999999999984e134 < im

            1. Initial program 100.0%

              \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - 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(im \cdot \left(\frac{-1}{3} \cdot {im}^{2} - 2\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(im, \color{blue}{\left(\frac{-1}{3} \cdot {im}^{2} - 2\right)}\right)\right) \]
              2. sub-negN/A

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(im \cdot \color{blue}{\left(im \cdot \frac{-1}{3}\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(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \frac{-1}{3}\right)}\right)\right)\right)\right) \]
              10. *-lowering-*.f64100.0%

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

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

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

                \[\leadsto \color{blue}{0.5} \cdot \left(im \cdot \left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)\right) \]
            8. Recombined 4 regimes into one program.
            9. Final simplification60.6%

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

            Alternative 9: 62.1% accurate, 7.0× speedup?

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

              1. Initial program 36.5%

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

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{120} \cdot \cos re + \frac{-1}{5040} \cdot \left({im}^{2} \cdot \cos re\right)\right)\right) + \color{blue}{\left(-1 \cdot \cos re + \left(\frac{-1}{6} \cdot \cos re\right) \cdot {im}^{2}\right)}\right)\right) \]
              5. Simplified94.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{2}\right)\right)\right), \mathsf{*.f64}\left(im, \left(\left(\left(\frac{-1}{120} + \left(im \cdot im\right) \cdot \frac{-1}{5040}\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \frac{-1}{6} \cdot \left(im \cdot im\right)\right) + \color{blue}{-1}\right)\right)\right) \]
              10. Applied egg-rr53.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{120}, \color{blue}{\left(\frac{-1}{5040} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right)\right)\right) \]
              13. Simplified54.5%

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

              if 270 < im < 1.0000000000000001e44

              1. Initial program 100.0%

                \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - 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(im \cdot \left(\frac{-1}{3} \cdot {im}^{2} - 2\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(im, \color{blue}{\left(\frac{-1}{3} \cdot {im}^{2} - 2\right)}\right)\right) \]
                2. sub-negN/A

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(im \cdot \color{blue}{\left(im \cdot \frac{-1}{3}\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(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \frac{-1}{3}\right)}\right)\right)\right)\right) \]
                10. *-lowering-*.f643.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{/.f64}\left(\frac{1}{2}, \left(re \cdot re\right)\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{-1}{3}\right)\right)\right)\right)\right) \]
                13. *-lowering-*.f6427.8%

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

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

              if 1.0000000000000001e44 < im < 1.99999999999999984e134

              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{2}\right)\right)\right), \mathsf{*.f64}\left(im, \left(\left(\left(\frac{-1}{120} + \left(im \cdot im\right) \cdot \frac{-1}{5040}\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \frac{-1}{6} \cdot \left(im \cdot im\right)\right) + \color{blue}{-1}\right)\right)\right) \]
              10. Applied egg-rr80.0%

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{2}\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{120}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, \frac{-1}{5040}\right), im\right)\right)\right), \frac{-1}{6}\right)\right)\right)\right)\right) \]
              12. Applied egg-rr80.0%

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

              if 1.99999999999999984e134 < im

              1. Initial program 100.0%

                \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - 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(im \cdot \left(\frac{-1}{3} \cdot {im}^{2} - 2\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(im, \color{blue}{\left(\frac{-1}{3} \cdot {im}^{2} - 2\right)}\right)\right) \]
                2. sub-negN/A

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(im \cdot \color{blue}{\left(im \cdot \frac{-1}{3}\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(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \frac{-1}{3}\right)}\right)\right)\right)\right) \]
                10. *-lowering-*.f64100.0%

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

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

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

                  \[\leadsto \color{blue}{0.5} \cdot \left(im \cdot \left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)\right) \]
              8. Recombined 4 regimes into one program.
              9. Final simplification59.1%

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

              Alternative 10: 61.0% accurate, 10.0× speedup?

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

                1. Initial program 36.5%

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

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

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{120} \cdot \cos re + \frac{-1}{5040} \cdot \left({im}^{2} \cdot \cos re\right)\right)\right) + \color{blue}{\left(-1 \cdot \cos re + \left(\frac{-1}{6} \cdot \cos re\right) \cdot {im}^{2}\right)}\right)\right) \]
                5. Simplified94.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{2}\right)\right)\right), \mathsf{*.f64}\left(im, \left(\left(\left(\frac{-1}{120} + \left(im \cdot im\right) \cdot \frac{-1}{5040}\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \frac{-1}{6} \cdot \left(im \cdot im\right)\right) + \color{blue}{-1}\right)\right)\right) \]
                10. Applied egg-rr53.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{120}, \color{blue}{\left(\frac{-1}{5040} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right)\right)\right) \]
                13. Simplified54.5%

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

                if 500 < im < 2.99999999999999997e134

                1. Initial program 100.0%

                  \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - 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(im \cdot \left(\frac{-1}{3} \cdot {im}^{2} - 2\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(im, \color{blue}{\left(\frac{-1}{3} \cdot {im}^{2} - 2\right)}\right)\right) \]
                  2. sub-negN/A

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(im \cdot \color{blue}{\left(im \cdot \frac{-1}{3}\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(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \frac{-1}{3}\right)}\right)\right)\right)\right) \]
                  10. *-lowering-*.f6423.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 2.99999999999999997e134 < im

                1. Initial program 100.0%

                  \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - 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(im \cdot \left(\frac{-1}{3} \cdot {im}^{2} - 2\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(im, \color{blue}{\left(\frac{-1}{3} \cdot {im}^{2} - 2\right)}\right)\right) \]
                  2. sub-negN/A

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(im \cdot \color{blue}{\left(im \cdot \frac{-1}{3}\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(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \frac{-1}{3}\right)}\right)\right)\right)\right) \]
                  10. *-lowering-*.f64100.0%

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

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

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

                    \[\leadsto \color{blue}{0.5} \cdot \left(im \cdot \left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)\right) \]
                8. Recombined 3 regimes into one program.
                9. Final simplification57.7%

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

                Alternative 11: 55.4% accurate, 13.4× speedup?

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

                  1. Initial program 45.9%

                    \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - 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(im \cdot \left(\frac{-1}{3} \cdot {im}^{2} - 2\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(im, \color{blue}{\left(\frac{-1}{3} \cdot {im}^{2} - 2\right)}\right)\right) \]
                    2. sub-negN/A

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

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(im \cdot \color{blue}{\left(im \cdot \frac{-1}{3}\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(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \frac{-1}{3}\right)}\right)\right)\right)\right) \]
                    10. *-lowering-*.f6490.6%

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

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

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

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

                    if 500 < im < 4.5999999999999996e134

                    1. Initial program 100.0%

                      \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - 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(im \cdot \left(\frac{-1}{3} \cdot {im}^{2} - 2\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(im, \color{blue}{\left(\frac{-1}{3} \cdot {im}^{2} - 2\right)}\right)\right) \]
                      2. sub-negN/A

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

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

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

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

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(im \cdot \color{blue}{\left(im \cdot \frac{-1}{3}\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(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \frac{-1}{3}\right)}\right)\right)\right)\right) \]
                      10. *-lowering-*.f6423.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 12: 60.8% accurate, 14.7× speedup?

                  \[\begin{array}{l} \\ im \cdot \left(-1 + \left(im \cdot im\right) \cdot \left(-0.16666666666666666 + im \cdot \left(im \cdot \left(-0.008333333333333333 + \left(im \cdot im\right) \cdot -0.0001984126984126984\right)\right)\right)\right) \end{array} \]
                  (FPCore (re im)
                   :precision binary64
                   (*
                    im
                    (+
                     -1.0
                     (*
                      (* im im)
                      (+
                       -0.16666666666666666
                       (*
                        im
                        (*
                         im
                         (+ -0.008333333333333333 (* (* im im) -0.0001984126984126984)))))))))
                  double code(double re, double im) {
                  	return im * (-1.0 + ((im * im) * (-0.16666666666666666 + (im * (im * (-0.008333333333333333 + ((im * im) * -0.0001984126984126984)))))));
                  }
                  
                  real(8) function code(re, im)
                      real(8), intent (in) :: re
                      real(8), intent (in) :: im
                      code = im * ((-1.0d0) + ((im * im) * ((-0.16666666666666666d0) + (im * (im * ((-0.008333333333333333d0) + ((im * im) * (-0.0001984126984126984d0))))))))
                  end function
                  
                  public static double code(double re, double im) {
                  	return im * (-1.0 + ((im * im) * (-0.16666666666666666 + (im * (im * (-0.008333333333333333 + ((im * im) * -0.0001984126984126984)))))));
                  }
                  
                  def code(re, im):
                  	return im * (-1.0 + ((im * im) * (-0.16666666666666666 + (im * (im * (-0.008333333333333333 + ((im * im) * -0.0001984126984126984)))))))
                  
                  function code(re, im)
                  	return Float64(im * Float64(-1.0 + Float64(Float64(im * im) * Float64(-0.16666666666666666 + Float64(im * Float64(im * Float64(-0.008333333333333333 + Float64(Float64(im * im) * -0.0001984126984126984))))))))
                  end
                  
                  function tmp = code(re, im)
                  	tmp = im * (-1.0 + ((im * im) * (-0.16666666666666666 + (im * (im * (-0.008333333333333333 + ((im * im) * -0.0001984126984126984)))))));
                  end
                  
                  code[re_, im_] := N[(im * N[(-1.0 + N[(N[(im * im), $MachinePrecision] * N[(-0.16666666666666666 + N[(im * N[(im * N[(-0.008333333333333333 + N[(N[(im * im), $MachinePrecision] * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  im \cdot \left(-1 + \left(im \cdot im\right) \cdot \left(-0.16666666666666666 + im \cdot \left(im \cdot \left(-0.008333333333333333 + \left(im \cdot im\right) \cdot -0.0001984126984126984\right)\right)\right)\right)
                  \end{array}
                  
                  Derivation
                  1. Initial program 52.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{2}\right)\right)\right), \mathsf{*.f64}\left(im, \left(\left(\left(\frac{-1}{120} + \left(im \cdot im\right) \cdot \frac{-1}{5040}\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \frac{-1}{6} \cdot \left(im \cdot im\right)\right) + \color{blue}{-1}\right)\right)\right) \]
                  10. Applied egg-rr55.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{120}, \color{blue}{\left(\frac{-1}{5040} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right)\right)\right) \]
                  13. Simplified57.2%

                    \[\leadsto \color{blue}{im \cdot \left(-1 + \left(im \cdot im\right) \cdot \left(-0.16666666666666666 + im \cdot \left(im \cdot \left(-0.008333333333333333 + \left(im \cdot im\right) \cdot -0.0001984126984126984\right)\right)\right)\right)} \]
                  14. Add Preprocessing

                  Alternative 13: 59.0% accurate, 18.2× speedup?

                  \[\begin{array}{l} \\ im \cdot \left(0.5 \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot -0.016666666666666666\right)\right)\right) \end{array} \]
                  (FPCore (re im)
                   :precision binary64
                   (*
                    im
                    (*
                     0.5
                     (+
                      -2.0
                      (*
                       (* im im)
                       (+ -0.3333333333333333 (* (* im im) -0.016666666666666666)))))))
                  double code(double re, double im) {
                  	return im * (0.5 * (-2.0 + ((im * im) * (-0.3333333333333333 + ((im * im) * -0.016666666666666666)))));
                  }
                  
                  real(8) function code(re, im)
                      real(8), intent (in) :: re
                      real(8), intent (in) :: im
                      code = im * (0.5d0 * ((-2.0d0) + ((im * im) * ((-0.3333333333333333d0) + ((im * im) * (-0.016666666666666666d0))))))
                  end function
                  
                  public static double code(double re, double im) {
                  	return im * (0.5 * (-2.0 + ((im * im) * (-0.3333333333333333 + ((im * im) * -0.016666666666666666)))));
                  }
                  
                  def code(re, im):
                  	return im * (0.5 * (-2.0 + ((im * im) * (-0.3333333333333333 + ((im * im) * -0.016666666666666666)))))
                  
                  function code(re, im)
                  	return Float64(im * Float64(0.5 * Float64(-2.0 + Float64(Float64(im * im) * Float64(-0.3333333333333333 + Float64(Float64(im * im) * -0.016666666666666666))))))
                  end
                  
                  function tmp = code(re, im)
                  	tmp = im * (0.5 * (-2.0 + ((im * im) * (-0.3333333333333333 + ((im * im) * -0.016666666666666666)))));
                  end
                  
                  code[re_, im_] := N[(im * N[(0.5 * N[(-2.0 + N[(N[(im * im), $MachinePrecision] * N[(-0.3333333333333333 + N[(N[(im * im), $MachinePrecision] * -0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  im \cdot \left(0.5 \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot -0.016666666666666666\right)\right)\right)
                  \end{array}
                  
                  Derivation
                  1. Initial program 52.7%

                    \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - 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(im \cdot \left({im}^{2} \cdot \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right) - 2\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(im, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right) - 2\right)}\right)\right) \]
                    2. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right)\right)\right), \frac{1}{2}\right)\right) \]
                    12. sub-negN/A

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

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

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

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

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

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

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

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

                    \[\leadsto \color{blue}{im \cdot \left(\left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot -0.016666666666666666\right)\right) \cdot 0.5\right)} \]
                  9. Final simplification56.4%

                    \[\leadsto im \cdot \left(0.5 \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot -0.016666666666666666\right)\right)\right) \]
                  10. Add Preprocessing

                  Alternative 14: 34.0% accurate, 22.0× speedup?

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

                    1. Initial program 36.5%

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

                      \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \cos re\right)} \]
                    4. Step-by-step derivation
                      1. mul-1-negN/A

                        \[\leadsto \mathsf{neg}\left(im \cdot \cos re\right) \]
                      2. neg-sub0N/A

                        \[\leadsto 0 - \color{blue}{im \cdot \cos re} \]
                      3. --lowering--.f64N/A

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

                        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(im, \color{blue}{\cos re}\right)\right) \]
                      5. cos-lowering-cos.f6469.9%

                        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(im, \mathsf{cos.f64}\left(re\right)\right)\right) \]
                    5. Simplified69.9%

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

                      \[\leadsto \color{blue}{-1 \cdot im} \]
                    7. Step-by-step derivation
                      1. mul-1-negN/A

                        \[\leadsto \mathsf{neg}\left(im\right) \]
                      2. neg-sub0N/A

                        \[\leadsto 0 - \color{blue}{im} \]
                      3. --lowering--.f6436.9%

                        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{im}\right) \]
                    8. Simplified36.9%

                      \[\leadsto \color{blue}{0 - im} \]
                    9. Step-by-step derivation
                      1. sub0-negN/A

                        \[\leadsto \mathsf{neg}\left(im\right) \]
                      2. neg-lowering-neg.f6436.9%

                        \[\leadsto \mathsf{neg.f64}\left(im\right) \]
                    10. Applied egg-rr36.9%

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

                    if 250 < im

                    1. Initial program 100.0%

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

                      \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \cos re\right)} \]
                    4. Step-by-step derivation
                      1. mul-1-negN/A

                        \[\leadsto \mathsf{neg}\left(im \cdot \cos re\right) \]
                      2. neg-sub0N/A

                        \[\leadsto 0 - \color{blue}{im \cdot \cos re} \]
                      3. --lowering--.f64N/A

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

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

                        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(im, \mathsf{cos.f64}\left(re\right)\right)\right) \]
                    5. Simplified5.2%

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

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

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

                        \[\leadsto \left(\mathsf{neg}\left(im\right)\right) + \color{blue}{\frac{1}{2} \cdot \left(im \cdot {re}^{2}\right)} \]
                      3. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 15: 53.9% accurate, 28.1× speedup?

                  \[\begin{array}{l} \\ 0.5 \cdot \left(im \cdot \left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)\right) \end{array} \]
                  (FPCore (re im)
                   :precision binary64
                   (* 0.5 (* im (+ -2.0 (* im (* im -0.3333333333333333))))))
                  double code(double re, double im) {
                  	return 0.5 * (im * (-2.0 + (im * (im * -0.3333333333333333))));
                  }
                  
                  real(8) function code(re, im)
                      real(8), intent (in) :: re
                      real(8), intent (in) :: im
                      code = 0.5d0 * (im * ((-2.0d0) + (im * (im * (-0.3333333333333333d0)))))
                  end function
                  
                  public static double code(double re, double im) {
                  	return 0.5 * (im * (-2.0 + (im * (im * -0.3333333333333333))));
                  }
                  
                  def code(re, im):
                  	return 0.5 * (im * (-2.0 + (im * (im * -0.3333333333333333))))
                  
                  function code(re, im)
                  	return Float64(0.5 * Float64(im * Float64(-2.0 + Float64(im * Float64(im * -0.3333333333333333)))))
                  end
                  
                  function tmp = code(re, im)
                  	tmp = 0.5 * (im * (-2.0 + (im * (im * -0.3333333333333333))));
                  end
                  
                  code[re_, im_] := N[(0.5 * N[(im * N[(-2.0 + N[(im * N[(im * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  0.5 \cdot \left(im \cdot \left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)\right)
                  \end{array}
                  
                  Derivation
                  1. Initial program 52.7%

                    \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - 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(im \cdot \left(\frac{-1}{3} \cdot {im}^{2} - 2\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(im, \color{blue}{\left(\frac{-1}{3} \cdot {im}^{2} - 2\right)}\right)\right) \]
                    2. sub-negN/A

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left(\frac{-1}{3} \cdot {im}^{2} + -2\right)\right)\right) \]
                    4. +-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left(-2 + \color{blue}{\frac{-1}{3} \cdot {im}^{2}}\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(im, \mathsf{+.f64}\left(-2, \color{blue}{\left(\frac{-1}{3} \cdot {im}^{2}\right)}\right)\right)\right) \]
                    6. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left({im}^{2} \cdot \color{blue}{\frac{-1}{3}}\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(im, \mathsf{+.f64}\left(-2, \left(\left(im \cdot im\right) \cdot \frac{-1}{3}\right)\right)\right)\right) \]
                    8. associate-*l*N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(im \cdot \color{blue}{\left(im \cdot \frac{-1}{3}\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(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \frac{-1}{3}\right)}\right)\right)\right)\right) \]
                    10. *-lowering-*.f6482.1%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{-1}{3}}\right)\right)\right)\right)\right) \]
                  5. Simplified82.1%

                    \[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(im \cdot \left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)\right)} \]
                  6. Taylor expanded in re around 0

                    \[\leadsto \mathsf{*.f64}\left(\color{blue}{\frac{1}{2}}, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{-1}{3}\right)\right)\right)\right)\right) \]
                  7. Step-by-step derivation
                    1. Simplified51.6%

                      \[\leadsto \color{blue}{0.5} \cdot \left(im \cdot \left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)\right) \]
                    2. Add Preprocessing

                    Alternative 16: 29.8% accurate, 103.0× speedup?

                    \[\begin{array}{l} \\ 0 - im \end{array} \]
                    (FPCore (re im) :precision binary64 (- 0.0 im))
                    double code(double re, double im) {
                    	return 0.0 - im;
                    }
                    
                    real(8) function code(re, im)
                        real(8), intent (in) :: re
                        real(8), intent (in) :: im
                        code = 0.0d0 - im
                    end function
                    
                    public static double code(double re, double im) {
                    	return 0.0 - im;
                    }
                    
                    def code(re, im):
                    	return 0.0 - im
                    
                    function code(re, im)
                    	return Float64(0.0 - im)
                    end
                    
                    function tmp = code(re, im)
                    	tmp = 0.0 - im;
                    end
                    
                    code[re_, im_] := N[(0.0 - im), $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    0 - im
                    \end{array}
                    
                    Derivation
                    1. Initial program 52.7%

                      \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - im} - e^{im}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in im around 0

                      \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \cos re\right)} \]
                    4. Step-by-step derivation
                      1. mul-1-negN/A

                        \[\leadsto \mathsf{neg}\left(im \cdot \cos re\right) \]
                      2. neg-sub0N/A

                        \[\leadsto 0 - \color{blue}{im \cdot \cos re} \]
                      3. --lowering--.f64N/A

                        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(im \cdot \cos re\right)}\right) \]
                      4. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(im, \color{blue}{\cos re}\right)\right) \]
                      5. cos-lowering-cos.f6453.5%

                        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(im, \mathsf{cos.f64}\left(re\right)\right)\right) \]
                    5. Simplified53.5%

                      \[\leadsto \color{blue}{0 - im \cdot \cos re} \]
                    6. Taylor expanded in re around 0

                      \[\leadsto \color{blue}{-1 \cdot im} \]
                    7. Step-by-step derivation
                      1. mul-1-negN/A

                        \[\leadsto \mathsf{neg}\left(im\right) \]
                      2. neg-sub0N/A

                        \[\leadsto 0 - \color{blue}{im} \]
                      3. --lowering--.f6428.6%

                        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{im}\right) \]
                    8. Simplified28.6%

                      \[\leadsto \color{blue}{0 - im} \]
                    9. Step-by-step derivation
                      1. sub0-negN/A

                        \[\leadsto \mathsf{neg}\left(im\right) \]
                      2. neg-lowering-neg.f6428.6%

                        \[\leadsto \mathsf{neg.f64}\left(im\right) \]
                    10. Applied egg-rr28.6%

                      \[\leadsto \color{blue}{-im} \]
                    11. Final simplification28.6%

                      \[\leadsto 0 - im \]
                    12. Add Preprocessing

                    Developer Target 1: 99.8% accurate, 0.7× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left|im\right| < 1:\\ \;\;\;\;-\cos re \cdot \left(\left(im + \left(\left(0.16666666666666666 \cdot im\right) \cdot im\right) \cdot im\right) + \left(\left(\left(\left(0.008333333333333333 \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - im} - e^{im}\right)\\ \end{array} \end{array} \]
                    (FPCore (re im)
                     :precision binary64
                     (if (< (fabs im) 1.0)
                       (-
                        (*
                         (cos re)
                         (+
                          (+ im (* (* (* 0.16666666666666666 im) im) im))
                          (* (* (* (* (* 0.008333333333333333 im) im) im) im) im))))
                       (* (* 0.5 (cos re)) (- (exp (- 0.0 im)) (exp im)))))
                    double code(double re, double im) {
                    	double tmp;
                    	if (fabs(im) < 1.0) {
                    		tmp = -(cos(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im)));
                    	} else {
                    		tmp = (0.5 * cos(re)) * (exp((0.0 - im)) - exp(im));
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(re, im)
                        real(8), intent (in) :: re
                        real(8), intent (in) :: im
                        real(8) :: tmp
                        if (abs(im) < 1.0d0) then
                            tmp = -(cos(re) * ((im + (((0.16666666666666666d0 * im) * im) * im)) + (((((0.008333333333333333d0 * im) * im) * im) * im) * im)))
                        else
                            tmp = (0.5d0 * cos(re)) * (exp((0.0d0 - im)) - exp(im))
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double re, double im) {
                    	double tmp;
                    	if (Math.abs(im) < 1.0) {
                    		tmp = -(Math.cos(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im)));
                    	} else {
                    		tmp = (0.5 * Math.cos(re)) * (Math.exp((0.0 - im)) - Math.exp(im));
                    	}
                    	return tmp;
                    }
                    
                    def code(re, im):
                    	tmp = 0
                    	if math.fabs(im) < 1.0:
                    		tmp = -(math.cos(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im)))
                    	else:
                    		tmp = (0.5 * math.cos(re)) * (math.exp((0.0 - im)) - math.exp(im))
                    	return tmp
                    
                    function code(re, im)
                    	tmp = 0.0
                    	if (abs(im) < 1.0)
                    		tmp = Float64(-Float64(cos(re) * Float64(Float64(im + Float64(Float64(Float64(0.16666666666666666 * im) * im) * im)) + Float64(Float64(Float64(Float64(Float64(0.008333333333333333 * im) * im) * im) * im) * im))));
                    	else
                    		tmp = Float64(Float64(0.5 * cos(re)) * Float64(exp(Float64(0.0 - im)) - exp(im)));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(re, im)
                    	tmp = 0.0;
                    	if (abs(im) < 1.0)
                    		tmp = -(cos(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im)));
                    	else
                    		tmp = (0.5 * cos(re)) * (exp((0.0 - im)) - exp(im));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[re_, im_] := If[Less[N[Abs[im], $MachinePrecision], 1.0], (-N[(N[Cos[re], $MachinePrecision] * N[(N[(im + N[(N[(N[(0.16666666666666666 * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(0.008333333333333333 * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), N[(N[(0.5 * N[Cos[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;\left|im\right| < 1:\\
                    \;\;\;\;-\cos re \cdot \left(\left(im + \left(\left(0.16666666666666666 \cdot im\right) \cdot im\right) \cdot im\right) + \left(\left(\left(\left(0.008333333333333333 \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - im} - e^{im}\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    

                    Reproduce

                    ?
                    herbie shell --seed 2024159 
                    (FPCore (re im)
                      :name "math.sin on complex, imaginary part"
                      :precision binary64
                    
                      :alt
                      (! :herbie-platform default (if (< (fabs im) 1) (- (* (cos re) (+ im (* 1/6 im im im) (* 1/120 im im im im im)))) (* (* 1/2 (cos re)) (- (exp (- 0 im)) (exp im)))))
                    
                      (* (* 0.5 (cos re)) (- (exp (- 0.0 im)) (exp im))))