Maksimov and Kolovsky, Equation (32)

Percentage Accurate: 76.7% → 96.8%
Time: 13.3s
Alternatives: 13
Speedup: 2.0×

Specification

?
\[\begin{array}{l} \\ \cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \end{array} \]
(FPCore (K m n M l)
 :precision binary64
 (*
  (cos (- (/ (* K (+ m n)) 2.0) M))
  (exp (- (- (pow (- (/ (+ m n) 2.0) M) 2.0)) (- l (fabs (- m n)))))))
double code(double K, double m, double n, double M, double l) {
	return cos((((K * (m + n)) / 2.0) - M)) * exp((-pow((((m + n) / 2.0) - M), 2.0) - (l - fabs((m - n)))));
}
real(8) function code(k, m, n, m_1, l)
    real(8), intent (in) :: k
    real(8), intent (in) :: m
    real(8), intent (in) :: n
    real(8), intent (in) :: m_1
    real(8), intent (in) :: l
    code = cos((((k * (m + n)) / 2.0d0) - m_1)) * exp((-((((m + n) / 2.0d0) - m_1) ** 2.0d0) - (l - abs((m - n)))))
end function
public static double code(double K, double m, double n, double M, double l) {
	return Math.cos((((K * (m + n)) / 2.0) - M)) * Math.exp((-Math.pow((((m + n) / 2.0) - M), 2.0) - (l - Math.abs((m - n)))));
}
def code(K, m, n, M, l):
	return math.cos((((K * (m + n)) / 2.0) - M)) * math.exp((-math.pow((((m + n) / 2.0) - M), 2.0) - (l - math.fabs((m - n)))))
function code(K, m, n, M, l)
	return Float64(cos(Float64(Float64(Float64(K * Float64(m + n)) / 2.0) - M)) * exp(Float64(Float64(-(Float64(Float64(Float64(m + n) / 2.0) - M) ^ 2.0)) - Float64(l - abs(Float64(m - n))))))
end
function tmp = code(K, m, n, M, l)
	tmp = cos((((K * (m + n)) / 2.0) - M)) * exp((-((((m + n) / 2.0) - M) ^ 2.0) - (l - abs((m - n)))));
end
code[K_, m_, n_, M_, l_] := N[(N[Cos[N[(N[(N[(K * N[(m + n), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-N[Power[N[(N[(N[(m + n), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision], 2.0], $MachinePrecision]) - N[(l - N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\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 13 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: 76.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \end{array} \]
(FPCore (K m n M l)
 :precision binary64
 (*
  (cos (- (/ (* K (+ m n)) 2.0) M))
  (exp (- (- (pow (- (/ (+ m n) 2.0) M) 2.0)) (- l (fabs (- m n)))))))
double code(double K, double m, double n, double M, double l) {
	return cos((((K * (m + n)) / 2.0) - M)) * exp((-pow((((m + n) / 2.0) - M), 2.0) - (l - fabs((m - n)))));
}
real(8) function code(k, m, n, m_1, l)
    real(8), intent (in) :: k
    real(8), intent (in) :: m
    real(8), intent (in) :: n
    real(8), intent (in) :: m_1
    real(8), intent (in) :: l
    code = cos((((k * (m + n)) / 2.0d0) - m_1)) * exp((-((((m + n) / 2.0d0) - m_1) ** 2.0d0) - (l - abs((m - n)))))
end function
public static double code(double K, double m, double n, double M, double l) {
	return Math.cos((((K * (m + n)) / 2.0) - M)) * Math.exp((-Math.pow((((m + n) / 2.0) - M), 2.0) - (l - Math.abs((m - n)))));
}
def code(K, m, n, M, l):
	return math.cos((((K * (m + n)) / 2.0) - M)) * math.exp((-math.pow((((m + n) / 2.0) - M), 2.0) - (l - math.fabs((m - n)))))
function code(K, m, n, M, l)
	return Float64(cos(Float64(Float64(Float64(K * Float64(m + n)) / 2.0) - M)) * exp(Float64(Float64(-(Float64(Float64(Float64(m + n) / 2.0) - M) ^ 2.0)) - Float64(l - abs(Float64(m - n))))))
end
function tmp = code(K, m, n, M, l)
	tmp = cos((((K * (m + n)) / 2.0) - M)) * exp((-((((m + n) / 2.0) - M) ^ 2.0) - (l - abs((m - n)))));
end
code[K_, m_, n_, M_, l_] := N[(N[Cos[N[(N[(N[(K * N[(m + n), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-N[Power[N[(N[(N[(m + n), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision], 2.0], $MachinePrecision]) - N[(l - N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)}
\end{array}

Alternative 1: 96.8% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(n + m\right)\\ \cos M \cdot e^{\left|n - m\right| + \left(\left(t\_0 - M\right) \cdot \left(M - t\_0\right) - \ell\right)} \end{array} \end{array} \]
(FPCore (K m n M l)
 :precision binary64
 (let* ((t_0 (* 0.5 (+ n m))))
   (* (cos M) (exp (+ (fabs (- n m)) (- (* (- t_0 M) (- M t_0)) l))))))
double code(double K, double m, double n, double M, double l) {
	double t_0 = 0.5 * (n + m);
	return cos(M) * exp((fabs((n - m)) + (((t_0 - M) * (M - t_0)) - l)));
}
real(8) function code(k, m, n, m_1, l)
    real(8), intent (in) :: k
    real(8), intent (in) :: m
    real(8), intent (in) :: n
    real(8), intent (in) :: m_1
    real(8), intent (in) :: l
    real(8) :: t_0
    t_0 = 0.5d0 * (n + m)
    code = cos(m_1) * exp((abs((n - m)) + (((t_0 - m_1) * (m_1 - t_0)) - l)))
end function
public static double code(double K, double m, double n, double M, double l) {
	double t_0 = 0.5 * (n + m);
	return Math.cos(M) * Math.exp((Math.abs((n - m)) + (((t_0 - M) * (M - t_0)) - l)));
}
def code(K, m, n, M, l):
	t_0 = 0.5 * (n + m)
	return math.cos(M) * math.exp((math.fabs((n - m)) + (((t_0 - M) * (M - t_0)) - l)))
function code(K, m, n, M, l)
	t_0 = Float64(0.5 * Float64(n + m))
	return Float64(cos(M) * exp(Float64(abs(Float64(n - m)) + Float64(Float64(Float64(t_0 - M) * Float64(M - t_0)) - l))))
end
function tmp = code(K, m, n, M, l)
	t_0 = 0.5 * (n + m);
	tmp = cos(M) * exp((abs((n - m)) + (((t_0 - M) * (M - t_0)) - l)));
end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(0.5 * N[(n + m), $MachinePrecision]), $MachinePrecision]}, N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[Abs[N[(n - m), $MachinePrecision]], $MachinePrecision] + N[(N[(N[(t$95$0 - M), $MachinePrecision] * N[(M - t$95$0), $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(n + m\right)\\
\cos M \cdot e^{\left|n - m\right| + \left(\left(t\_0 - M\right) \cdot \left(M - t\_0\right) - \ell\right)}
\end{array}
\end{array}
Derivation
  1. Initial program 72.5%

    \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in K around 0

    \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
  4. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
    2. cos-negN/A

      \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
    3. cos-lowering-cos.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
    4. exp-lowering-exp.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
    5. --lowering--.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
    6. fabs-subN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
    7. sub-negN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
    8. mul-1-negN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
    9. fabs-lowering-fabs.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
    10. mul-1-negN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
    11. sub-negN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
    12. --lowering--.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
    13. +-lowering-+.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
    14. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
    15. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
    16. --lowering--.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
    17. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
    18. +-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
    19. +-lowering-+.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
    20. --lowering--.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
  5. Simplified97.5%

    \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
  6. Final simplification97.5%

    \[\leadsto \cos M \cdot e^{\left|n - m\right| + \left(\left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(M - 0.5 \cdot \left(n + m\right)\right) - \ell\right)} \]
  7. Add Preprocessing

Alternative 2: 71.3% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -1.22 \cdot 10^{-119}:\\ \;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\ \mathbf{elif}\;n \leq 3.9 \cdot 10^{-176}:\\ \;\;\;\;\cos M \cdot \left(-0.0026041666666666665 \cdot {n}^{6}\right)\\ \mathbf{elif}\;n \leq 54:\\ \;\;\;\;\cos \left(\frac{K}{\frac{2}{n + m}} - M\right) \cdot e^{\left(\left|n - m\right| - \ell\right) - M \cdot M}\\ \mathbf{else}:\\ \;\;\;\;e^{-0.25 \cdot \left(n \cdot n\right)}\\ \end{array} \end{array} \]
(FPCore (K m n M l)
 :precision binary64
 (if (<= n -1.22e-119)
   (* (cos M) (exp (* -0.25 (* m m))))
   (if (<= n 3.9e-176)
     (* (cos M) (* -0.0026041666666666665 (pow n 6.0)))
     (if (<= n 54.0)
       (*
        (cos (- (/ K (/ 2.0 (+ n m))) M))
        (exp (- (- (fabs (- n m)) l) (* M M))))
       (exp (* -0.25 (* n n)))))))
double code(double K, double m, double n, double M, double l) {
	double tmp;
	if (n <= -1.22e-119) {
		tmp = cos(M) * exp((-0.25 * (m * m)));
	} else if (n <= 3.9e-176) {
		tmp = cos(M) * (-0.0026041666666666665 * pow(n, 6.0));
	} else if (n <= 54.0) {
		tmp = cos(((K / (2.0 / (n + m))) - M)) * exp(((fabs((n - m)) - l) - (M * M)));
	} else {
		tmp = exp((-0.25 * (n * n)));
	}
	return tmp;
}
real(8) function code(k, m, n, m_1, l)
    real(8), intent (in) :: k
    real(8), intent (in) :: m
    real(8), intent (in) :: n
    real(8), intent (in) :: m_1
    real(8), intent (in) :: l
    real(8) :: tmp
    if (n <= (-1.22d-119)) then
        tmp = cos(m_1) * exp(((-0.25d0) * (m * m)))
    else if (n <= 3.9d-176) then
        tmp = cos(m_1) * ((-0.0026041666666666665d0) * (n ** 6.0d0))
    else if (n <= 54.0d0) then
        tmp = cos(((k / (2.0d0 / (n + m))) - m_1)) * exp(((abs((n - m)) - l) - (m_1 * m_1)))
    else
        tmp = exp(((-0.25d0) * (n * n)))
    end if
    code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
	double tmp;
	if (n <= -1.22e-119) {
		tmp = Math.cos(M) * Math.exp((-0.25 * (m * m)));
	} else if (n <= 3.9e-176) {
		tmp = Math.cos(M) * (-0.0026041666666666665 * Math.pow(n, 6.0));
	} else if (n <= 54.0) {
		tmp = Math.cos(((K / (2.0 / (n + m))) - M)) * Math.exp(((Math.abs((n - m)) - l) - (M * M)));
	} else {
		tmp = Math.exp((-0.25 * (n * n)));
	}
	return tmp;
}
def code(K, m, n, M, l):
	tmp = 0
	if n <= -1.22e-119:
		tmp = math.cos(M) * math.exp((-0.25 * (m * m)))
	elif n <= 3.9e-176:
		tmp = math.cos(M) * (-0.0026041666666666665 * math.pow(n, 6.0))
	elif n <= 54.0:
		tmp = math.cos(((K / (2.0 / (n + m))) - M)) * math.exp(((math.fabs((n - m)) - l) - (M * M)))
	else:
		tmp = math.exp((-0.25 * (n * n)))
	return tmp
function code(K, m, n, M, l)
	tmp = 0.0
	if (n <= -1.22e-119)
		tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(m * m))));
	elseif (n <= 3.9e-176)
		tmp = Float64(cos(M) * Float64(-0.0026041666666666665 * (n ^ 6.0)));
	elseif (n <= 54.0)
		tmp = Float64(cos(Float64(Float64(K / Float64(2.0 / Float64(n + m))) - M)) * exp(Float64(Float64(abs(Float64(n - m)) - l) - Float64(M * M))));
	else
		tmp = exp(Float64(-0.25 * Float64(n * n)));
	end
	return tmp
end
function tmp_2 = code(K, m, n, M, l)
	tmp = 0.0;
	if (n <= -1.22e-119)
		tmp = cos(M) * exp((-0.25 * (m * m)));
	elseif (n <= 3.9e-176)
		tmp = cos(M) * (-0.0026041666666666665 * (n ^ 6.0));
	elseif (n <= 54.0)
		tmp = cos(((K / (2.0 / (n + m))) - M)) * exp(((abs((n - m)) - l) - (M * M)));
	else
		tmp = exp((-0.25 * (n * n)));
	end
	tmp_2 = tmp;
end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, -1.22e-119], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 3.9e-176], N[(N[Cos[M], $MachinePrecision] * N[(-0.0026041666666666665 * N[Power[n, 6.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 54.0], N[(N[Cos[N[(N[(K / N[(2.0 / N[(n + m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(N[Abs[N[(n - m), $MachinePrecision]], $MachinePrecision] - l), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Exp[N[(-0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.22 \cdot 10^{-119}:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\

\mathbf{elif}\;n \leq 3.9 \cdot 10^{-176}:\\
\;\;\;\;\cos M \cdot \left(-0.0026041666666666665 \cdot {n}^{6}\right)\\

\mathbf{elif}\;n \leq 54:\\
\;\;\;\;\cos \left(\frac{K}{\frac{2}{n + m}} - M\right) \cdot e^{\left(\left|n - m\right| - \ell\right) - M \cdot M}\\

\mathbf{else}:\\
\;\;\;\;e^{-0.25 \cdot \left(n \cdot n\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if n < -1.22e-119

    1. Initial program 68.4%

      \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in K around 0

      \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
      2. cos-negN/A

        \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
      3. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
      4. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      6. fabs-subN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      9. fabs-lowering-fabs.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      11. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      13. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
      14. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      16. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      19. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      20. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
    5. Simplified100.0%

      \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
    6. Taylor expanded in m around inf

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left({m}^{2}\right)\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left(m \cdot m\right)\right)\right)\right) \]
      3. *-lowering-*.f6449.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(m, m\right)\right)\right)\right) \]
    8. Simplified49.7%

      \[\leadsto \cos M \cdot e^{\color{blue}{-0.25 \cdot \left(m \cdot m\right)}} \]

    if -1.22e-119 < n < 3.8999999999999997e-176

    1. Initial program 71.2%

      \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in K around 0

      \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
      2. cos-negN/A

        \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
      3. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
      4. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      6. fabs-subN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      9. fabs-lowering-fabs.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      11. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      13. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
      14. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      16. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      19. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      20. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
    5. Simplified95.9%

      \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
    6. Taylor expanded in n around inf

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left({n}^{2}\right)\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left(n \cdot n\right)\right)\right)\right) \]
      3. *-lowering-*.f647.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(n, n\right)\right)\right)\right) \]
    8. Simplified7.5%

      \[\leadsto \cos M \cdot e^{\color{blue}{-0.25 \cdot \left(n \cdot n\right)}} \]
    9. Taylor expanded in n around 0

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \color{blue}{\left(1 + {n}^{2} \cdot \left({n}^{2} \cdot \left(\frac{1}{32} + \frac{-1}{384} \cdot {n}^{2}\right) - \frac{1}{4}\right)\right)}\right) \]
    10. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({n}^{2}\right), \color{blue}{\left({n}^{2} \cdot \left(\frac{1}{32} + \frac{-1}{384} \cdot {n}^{2}\right) - \frac{1}{4}\right)}\right)\right)\right) \]
      3. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \left(\color{blue}{{n}^{2} \cdot \left(\frac{1}{32} + \frac{-1}{384} \cdot {n}^{2}\right)} - \frac{1}{4}\right)\right)\right)\right) \]
      5. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \left({n}^{2} \cdot \left(\frac{1}{32} + \frac{-1}{384} \cdot {n}^{2}\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)}\right)\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \left({n}^{2} \cdot \left(\frac{1}{32} + \frac{-1}{384} \cdot {n}^{2}\right) + \frac{-1}{4}\right)\right)\right)\right) \]
      7. +-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(\left({n}^{2}\right), \color{blue}{\left(\frac{1}{32} + \frac{-1}{384} \cdot {n}^{2}\right)}\right)\right)\right)\right)\right) \]
      10. unpow2N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{1}{32}, \color{blue}{\left(\frac{-1}{384} \cdot {n}^{2}\right)}\right)\right)\right)\right)\right)\right) \]
      13. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{1}{32}, \mathsf{*.f64}\left(\left({n}^{2}\right), \color{blue}{\frac{-1}{384}}\right)\right)\right)\right)\right)\right)\right) \]
      15. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{1}{32}, \mathsf{*.f64}\left(\left(n \cdot n\right), \frac{-1}{384}\right)\right)\right)\right)\right)\right)\right) \]
      16. *-lowering-*.f647.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{1}{32}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \frac{-1}{384}\right)\right)\right)\right)\right)\right)\right) \]
    11. Simplified7.5%

      \[\leadsto \cos M \cdot \color{blue}{\left(1 + \left(n \cdot n\right) \cdot \left(-0.25 + \left(n \cdot n\right) \cdot \left(0.03125 + \left(n \cdot n\right) \cdot -0.0026041666666666665\right)\right)\right)} \]
    12. Taylor expanded in n around inf

      \[\leadsto \color{blue}{\frac{-1}{384} \cdot \left({n}^{6} \cdot \cos M\right)} \]
    13. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto \cos M \cdot \color{blue}{\left(\frac{-1}{384} \cdot {n}^{6}\right)} \]
      3. *-lowering-*.f64N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{*.f64}\left(\frac{-1}{384}, \color{blue}{\left({n}^{6}\right)}\right)\right) \]
      6. pow-lowering-pow.f6488.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{*.f64}\left(\frac{-1}{384}, \mathsf{pow.f64}\left(n, \color{blue}{6}\right)\right)\right) \]
    14. Simplified88.5%

      \[\leadsto \color{blue}{\cos M \cdot \left(-0.0026041666666666665 \cdot {n}^{6}\right)} \]

    if 3.8999999999999997e-176 < n < 54

    1. Initial program 85.6%

      \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in M around inf

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(K, \mathsf{+.f64}\left(m, n\right)\right), 2\right), M\right)\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left({M}^{2}\right)}\right), \mathsf{\_.f64}\left(\ell, \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(m, n\right)\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(K, \mathsf{+.f64}\left(m, n\right)\right), 2\right), M\right)\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(\left(M \cdot M\right)\right), \mathsf{\_.f64}\left(\ell, \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(m, n\right)\right)\right)\right)\right)\right) \]
      2. *-lowering-*.f6478.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(K, \mathsf{+.f64}\left(m, n\right)\right), 2\right), M\right)\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(M, M\right)\right), \mathsf{\_.f64}\left(\ell, \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(m, n\right)\right)\right)\right)\right)\right) \]
    5. Simplified78.2%

      \[\leadsto \cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-\color{blue}{M \cdot M}\right) - \left(\ell - \left|m - n\right|\right)} \]
    6. Step-by-step derivation
      1. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\left(\frac{K \cdot \left(m + n\right)}{2} - M\right)\right), \mathsf{exp.f64}\left(\color{blue}{\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(M, M\right)\right), \mathsf{\_.f64}\left(\ell, \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(m, n\right)\right)\right)\right)}\right)\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left(\frac{K \cdot \left(m + n\right)}{2}\right), M\right)\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\mathsf{neg.f64}\left(\mathsf{*.f64}\left(M, M\right)\right)}, \mathsf{\_.f64}\left(\ell, \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(m, n\right)\right)\right)\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left(K \cdot \frac{m + n}{2}\right), M\right)\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\mathsf{*.f64}\left(M, M\right)}\right), \mathsf{\_.f64}\left(\ell, \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(m, n\right)\right)\right)\right)\right)\right) \]
      4. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left(K \cdot \frac{1}{\frac{2}{m + n}}\right), M\right)\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(M, \color{blue}{M}\right)\right), \mathsf{\_.f64}\left(\ell, \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(m, n\right)\right)\right)\right)\right)\right) \]
      5. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\left(\frac{K}{\frac{2}{m + n}}\right), M\right)\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\mathsf{*.f64}\left(M, M\right)}\right), \mathsf{\_.f64}\left(\ell, \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(m, n\right)\right)\right)\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(K, \left(\frac{2}{m + n}\right)\right), M\right)\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\mathsf{*.f64}\left(M, M\right)}\right), \mathsf{\_.f64}\left(\ell, \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(m, n\right)\right)\right)\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(K, \mathsf{/.f64}\left(2, \left(m + n\right)\right)\right), M\right)\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(M, \color{blue}{M}\right)\right), \mathsf{\_.f64}\left(\ell, \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(m, n\right)\right)\right)\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(K, \mathsf{/.f64}\left(2, \left(n + m\right)\right)\right), M\right)\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(M, M\right)\right), \mathsf{\_.f64}\left(\ell, \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(m, n\right)\right)\right)\right)\right)\right) \]
      9. +-lowering-+.f6478.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(K, \mathsf{/.f64}\left(2, \mathsf{+.f64}\left(n, m\right)\right)\right), M\right)\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(M, M\right)\right), \mathsf{\_.f64}\left(\ell, \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(m, n\right)\right)\right)\right)\right)\right) \]
    7. Applied egg-rr78.8%

      \[\leadsto \color{blue}{\cos \left(\frac{K}{\frac{2}{n + m}} - M\right)} \cdot e^{\left(-M \cdot M\right) - \left(\ell - \left|m - n\right|\right)} \]

    if 54 < n

    1. Initial program 71.0%

      \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in K around 0

      \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
      2. cos-negN/A

        \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
      3. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
      4. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      6. fabs-subN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      9. fabs-lowering-fabs.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      11. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      13. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
      14. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      16. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      19. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      20. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
    5. Simplified98.6%

      \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
    6. Taylor expanded in n around inf

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left({n}^{2}\right)\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left(n \cdot n\right)\right)\right)\right) \]
      3. *-lowering-*.f6497.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(n, n\right)\right)\right)\right) \]
    8. Simplified97.1%

      \[\leadsto \cos M \cdot e^{\color{blue}{-0.25 \cdot \left(n \cdot n\right)}} \]
    9. Taylor expanded in M around 0

      \[\leadsto \color{blue}{e^{\frac{-1}{4} \cdot {n}^{2}}} \]
    10. Step-by-step derivation
      1. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{exp.f64}\left(\left(\frac{-1}{4} \cdot {n}^{2}\right)\right) \]
      2. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left(n \cdot n\right)\right)\right) \]
      4. *-lowering-*.f6497.1%

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(n, n\right)\right)\right) \]
    11. Simplified97.1%

      \[\leadsto \color{blue}{e^{-0.25 \cdot \left(n \cdot n\right)}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification77.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.22 \cdot 10^{-119}:\\ \;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\ \mathbf{elif}\;n \leq 3.9 \cdot 10^{-176}:\\ \;\;\;\;\cos M \cdot \left(-0.0026041666666666665 \cdot {n}^{6}\right)\\ \mathbf{elif}\;n \leq 54:\\ \;\;\;\;\cos \left(\frac{K}{\frac{2}{n + m}} - M\right) \cdot e^{\left(\left|n - m\right| - \ell\right) - M \cdot M}\\ \mathbf{else}:\\ \;\;\;\;e^{-0.25 \cdot \left(n \cdot n\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 72.4% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -1.22 \cdot 10^{-119}:\\ \;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\ \mathbf{elif}\;n \leq 5.7 \cdot 10^{-74}:\\ \;\;\;\;\cos M \cdot \left(-0.0026041666666666665 \cdot {n}^{6}\right)\\ \mathbf{elif}\;n \leq 54:\\ \;\;\;\;e^{M \cdot \left(0 - M\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{-0.25 \cdot \left(n \cdot n\right)}\\ \end{array} \end{array} \]
(FPCore (K m n M l)
 :precision binary64
 (if (<= n -1.22e-119)
   (* (cos M) (exp (* -0.25 (* m m))))
   (if (<= n 5.7e-74)
     (* (cos M) (* -0.0026041666666666665 (pow n 6.0)))
     (if (<= n 54.0) (exp (* M (- 0.0 M))) (exp (* -0.25 (* n n)))))))
double code(double K, double m, double n, double M, double l) {
	double tmp;
	if (n <= -1.22e-119) {
		tmp = cos(M) * exp((-0.25 * (m * m)));
	} else if (n <= 5.7e-74) {
		tmp = cos(M) * (-0.0026041666666666665 * pow(n, 6.0));
	} else if (n <= 54.0) {
		tmp = exp((M * (0.0 - M)));
	} else {
		tmp = exp((-0.25 * (n * n)));
	}
	return tmp;
}
real(8) function code(k, m, n, m_1, l)
    real(8), intent (in) :: k
    real(8), intent (in) :: m
    real(8), intent (in) :: n
    real(8), intent (in) :: m_1
    real(8), intent (in) :: l
    real(8) :: tmp
    if (n <= (-1.22d-119)) then
        tmp = cos(m_1) * exp(((-0.25d0) * (m * m)))
    else if (n <= 5.7d-74) then
        tmp = cos(m_1) * ((-0.0026041666666666665d0) * (n ** 6.0d0))
    else if (n <= 54.0d0) then
        tmp = exp((m_1 * (0.0d0 - m_1)))
    else
        tmp = exp(((-0.25d0) * (n * n)))
    end if
    code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
	double tmp;
	if (n <= -1.22e-119) {
		tmp = Math.cos(M) * Math.exp((-0.25 * (m * m)));
	} else if (n <= 5.7e-74) {
		tmp = Math.cos(M) * (-0.0026041666666666665 * Math.pow(n, 6.0));
	} else if (n <= 54.0) {
		tmp = Math.exp((M * (0.0 - M)));
	} else {
		tmp = Math.exp((-0.25 * (n * n)));
	}
	return tmp;
}
def code(K, m, n, M, l):
	tmp = 0
	if n <= -1.22e-119:
		tmp = math.cos(M) * math.exp((-0.25 * (m * m)))
	elif n <= 5.7e-74:
		tmp = math.cos(M) * (-0.0026041666666666665 * math.pow(n, 6.0))
	elif n <= 54.0:
		tmp = math.exp((M * (0.0 - M)))
	else:
		tmp = math.exp((-0.25 * (n * n)))
	return tmp
function code(K, m, n, M, l)
	tmp = 0.0
	if (n <= -1.22e-119)
		tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(m * m))));
	elseif (n <= 5.7e-74)
		tmp = Float64(cos(M) * Float64(-0.0026041666666666665 * (n ^ 6.0)));
	elseif (n <= 54.0)
		tmp = exp(Float64(M * Float64(0.0 - M)));
	else
		tmp = exp(Float64(-0.25 * Float64(n * n)));
	end
	return tmp
end
function tmp_2 = code(K, m, n, M, l)
	tmp = 0.0;
	if (n <= -1.22e-119)
		tmp = cos(M) * exp((-0.25 * (m * m)));
	elseif (n <= 5.7e-74)
		tmp = cos(M) * (-0.0026041666666666665 * (n ^ 6.0));
	elseif (n <= 54.0)
		tmp = exp((M * (0.0 - M)));
	else
		tmp = exp((-0.25 * (n * n)));
	end
	tmp_2 = tmp;
end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, -1.22e-119], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 5.7e-74], N[(N[Cos[M], $MachinePrecision] * N[(-0.0026041666666666665 * N[Power[n, 6.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 54.0], N[Exp[N[(M * N[(0.0 - M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Exp[N[(-0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.22 \cdot 10^{-119}:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\

\mathbf{elif}\;n \leq 5.7 \cdot 10^{-74}:\\
\;\;\;\;\cos M \cdot \left(-0.0026041666666666665 \cdot {n}^{6}\right)\\

\mathbf{elif}\;n \leq 54:\\
\;\;\;\;e^{M \cdot \left(0 - M\right)}\\

\mathbf{else}:\\
\;\;\;\;e^{-0.25 \cdot \left(n \cdot n\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if n < -1.22e-119

    1. Initial program 68.4%

      \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in K around 0

      \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
      2. cos-negN/A

        \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
      3. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
      4. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      6. fabs-subN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      9. fabs-lowering-fabs.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      11. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      13. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
      14. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      16. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      19. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      20. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
    5. Simplified100.0%

      \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
    6. Taylor expanded in m around inf

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left({m}^{2}\right)\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left(m \cdot m\right)\right)\right)\right) \]
      3. *-lowering-*.f6449.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(m, m\right)\right)\right)\right) \]
    8. Simplified49.7%

      \[\leadsto \cos M \cdot e^{\color{blue}{-0.25 \cdot \left(m \cdot m\right)}} \]

    if -1.22e-119 < n < 5.70000000000000025e-74

    1. Initial program 75.2%

      \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in K around 0

      \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
      2. cos-negN/A

        \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
      3. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
      4. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      6. fabs-subN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      9. fabs-lowering-fabs.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      11. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      13. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
      14. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      16. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      19. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      20. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
    5. Simplified94.9%

      \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
    6. Taylor expanded in n around inf

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left({n}^{2}\right)\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left(n \cdot n\right)\right)\right)\right) \]
      3. *-lowering-*.f646.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(n, n\right)\right)\right)\right) \]
    8. Simplified6.6%

      \[\leadsto \cos M \cdot e^{\color{blue}{-0.25 \cdot \left(n \cdot n\right)}} \]
    9. Taylor expanded in n around 0

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \color{blue}{\left(1 + {n}^{2} \cdot \left({n}^{2} \cdot \left(\frac{1}{32} + \frac{-1}{384} \cdot {n}^{2}\right) - \frac{1}{4}\right)\right)}\right) \]
    10. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({n}^{2}\right), \color{blue}{\left({n}^{2} \cdot \left(\frac{1}{32} + \frac{-1}{384} \cdot {n}^{2}\right) - \frac{1}{4}\right)}\right)\right)\right) \]
      3. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \left(\color{blue}{{n}^{2} \cdot \left(\frac{1}{32} + \frac{-1}{384} \cdot {n}^{2}\right)} - \frac{1}{4}\right)\right)\right)\right) \]
      5. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \left({n}^{2} \cdot \left(\frac{1}{32} + \frac{-1}{384} \cdot {n}^{2}\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)}\right)\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \left({n}^{2} \cdot \left(\frac{1}{32} + \frac{-1}{384} \cdot {n}^{2}\right) + \frac{-1}{4}\right)\right)\right)\right) \]
      7. +-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(\left({n}^{2}\right), \color{blue}{\left(\frac{1}{32} + \frac{-1}{384} \cdot {n}^{2}\right)}\right)\right)\right)\right)\right) \]
      10. unpow2N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{1}{32}, \color{blue}{\left(\frac{-1}{384} \cdot {n}^{2}\right)}\right)\right)\right)\right)\right)\right) \]
      13. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{1}{32}, \mathsf{*.f64}\left(\left({n}^{2}\right), \color{blue}{\frac{-1}{384}}\right)\right)\right)\right)\right)\right)\right) \]
      15. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{1}{32}, \mathsf{*.f64}\left(\left(n \cdot n\right), \frac{-1}{384}\right)\right)\right)\right)\right)\right)\right) \]
      16. *-lowering-*.f646.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{1}{32}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \frac{-1}{384}\right)\right)\right)\right)\right)\right)\right) \]
    11. Simplified6.6%

      \[\leadsto \cos M \cdot \color{blue}{\left(1 + \left(n \cdot n\right) \cdot \left(-0.25 + \left(n \cdot n\right) \cdot \left(0.03125 + \left(n \cdot n\right) \cdot -0.0026041666666666665\right)\right)\right)} \]
    12. Taylor expanded in n around inf

      \[\leadsto \color{blue}{\frac{-1}{384} \cdot \left({n}^{6} \cdot \cos M\right)} \]
    13. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto \cos M \cdot \color{blue}{\left(\frac{-1}{384} \cdot {n}^{6}\right)} \]
      3. *-lowering-*.f64N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{*.f64}\left(\frac{-1}{384}, \color{blue}{\left({n}^{6}\right)}\right)\right) \]
      6. pow-lowering-pow.f6488.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{*.f64}\left(\frac{-1}{384}, \mathsf{pow.f64}\left(n, \color{blue}{6}\right)\right)\right) \]
    14. Simplified88.2%

      \[\leadsto \color{blue}{\cos M \cdot \left(-0.0026041666666666665 \cdot {n}^{6}\right)} \]

    if 5.70000000000000025e-74 < n < 54

    1. Initial program 83.6%

      \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in K around 0

      \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
      2. cos-negN/A

        \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
      3. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
      4. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      6. fabs-subN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      9. fabs-lowering-fabs.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      11. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
      13. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
      14. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      16. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      19. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
      20. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
    5. Simplified96.0%

      \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
    6. Taylor expanded in M around inf

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot {M}^{2}\right)}\right)\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left({M}^{2}\right)\right)\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(0 - {M}^{2}\right)\right)\right) \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \left({M}^{2}\right)\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \left(M \cdot M\right)\right)\right)\right) \]
      5. *-lowering-*.f6473.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(M, M\right)\right)\right)\right) \]
    8. Simplified73.2%

      \[\leadsto \cos M \cdot e^{\color{blue}{0 - M \cdot M}} \]
    9. Taylor expanded in M around 0

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{1}, \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(M, M\right)\right)\right)\right) \]
    10. Step-by-step derivation
      1. Simplified73.2%

        \[\leadsto \color{blue}{1} \cdot e^{0 - M \cdot M} \]

      if 54 < n

      1. Initial program 71.0%

        \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in K around 0

        \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
      4. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
        2. cos-negN/A

          \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
        3. cos-lowering-cos.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
        4. exp-lowering-exp.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        5. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        6. fabs-subN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        7. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        8. mul-1-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        9. fabs-lowering-fabs.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        10. mul-1-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        11. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        12. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        13. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
        14. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        15. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        16. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        17. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        18. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        19. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        20. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
      5. Simplified98.6%

        \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
      6. Taylor expanded in n around inf

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left({n}^{2}\right)\right)\right)\right) \]
        2. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left(n \cdot n\right)\right)\right)\right) \]
        3. *-lowering-*.f6497.1%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(n, n\right)\right)\right)\right) \]
      8. Simplified97.1%

        \[\leadsto \cos M \cdot e^{\color{blue}{-0.25 \cdot \left(n \cdot n\right)}} \]
      9. Taylor expanded in M around 0

        \[\leadsto \color{blue}{e^{\frac{-1}{4} \cdot {n}^{2}}} \]
      10. Step-by-step derivation
        1. exp-lowering-exp.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\left(\frac{-1}{4} \cdot {n}^{2}\right)\right) \]
        2. *-lowering-*.f64N/A

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

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left(n \cdot n\right)\right)\right) \]
        4. *-lowering-*.f6497.1%

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(n, n\right)\right)\right) \]
      11. Simplified97.1%

        \[\leadsto \color{blue}{e^{-0.25 \cdot \left(n \cdot n\right)}} \]
    11. Recombined 4 regimes into one program.
    12. Final simplification77.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.22 \cdot 10^{-119}:\\ \;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\ \mathbf{elif}\;n \leq 5.7 \cdot 10^{-74}:\\ \;\;\;\;\cos M \cdot \left(-0.0026041666666666665 \cdot {n}^{6}\right)\\ \mathbf{elif}\;n \leq 54:\\ \;\;\;\;e^{M \cdot \left(0 - M\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{-0.25 \cdot \left(n \cdot n\right)}\\ \end{array} \]
    13. Add Preprocessing

    Alternative 4: 83.5% accurate, 2.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{-0.25 \cdot \left(n \cdot n\right)}\\ \mathbf{if}\;n \leq -1.85 \cdot 10^{-13}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 5.7 \cdot 10^{-74}:\\ \;\;\;\;\cos M \cdot \left(-0.0026041666666666665 \cdot {n}^{6}\right)\\ \mathbf{elif}\;n \leq 54:\\ \;\;\;\;e^{M \cdot \left(0 - M\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (K m n M l)
     :precision binary64
     (let* ((t_0 (exp (* -0.25 (* n n)))))
       (if (<= n -1.85e-13)
         t_0
         (if (<= n 5.7e-74)
           (* (cos M) (* -0.0026041666666666665 (pow n 6.0)))
           (if (<= n 54.0) (exp (* M (- 0.0 M))) t_0)))))
    double code(double K, double m, double n, double M, double l) {
    	double t_0 = exp((-0.25 * (n * n)));
    	double tmp;
    	if (n <= -1.85e-13) {
    		tmp = t_0;
    	} else if (n <= 5.7e-74) {
    		tmp = cos(M) * (-0.0026041666666666665 * pow(n, 6.0));
    	} else if (n <= 54.0) {
    		tmp = exp((M * (0.0 - M)));
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    real(8) function code(k, m, n, m_1, l)
        real(8), intent (in) :: k
        real(8), intent (in) :: m
        real(8), intent (in) :: n
        real(8), intent (in) :: m_1
        real(8), intent (in) :: l
        real(8) :: t_0
        real(8) :: tmp
        t_0 = exp(((-0.25d0) * (n * n)))
        if (n <= (-1.85d-13)) then
            tmp = t_0
        else if (n <= 5.7d-74) then
            tmp = cos(m_1) * ((-0.0026041666666666665d0) * (n ** 6.0d0))
        else if (n <= 54.0d0) then
            tmp = exp((m_1 * (0.0d0 - m_1)))
        else
            tmp = t_0
        end if
        code = tmp
    end function
    
    public static double code(double K, double m, double n, double M, double l) {
    	double t_0 = Math.exp((-0.25 * (n * n)));
    	double tmp;
    	if (n <= -1.85e-13) {
    		tmp = t_0;
    	} else if (n <= 5.7e-74) {
    		tmp = Math.cos(M) * (-0.0026041666666666665 * Math.pow(n, 6.0));
    	} else if (n <= 54.0) {
    		tmp = Math.exp((M * (0.0 - M)));
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    def code(K, m, n, M, l):
    	t_0 = math.exp((-0.25 * (n * n)))
    	tmp = 0
    	if n <= -1.85e-13:
    		tmp = t_0
    	elif n <= 5.7e-74:
    		tmp = math.cos(M) * (-0.0026041666666666665 * math.pow(n, 6.0))
    	elif n <= 54.0:
    		tmp = math.exp((M * (0.0 - M)))
    	else:
    		tmp = t_0
    	return tmp
    
    function code(K, m, n, M, l)
    	t_0 = exp(Float64(-0.25 * Float64(n * n)))
    	tmp = 0.0
    	if (n <= -1.85e-13)
    		tmp = t_0;
    	elseif (n <= 5.7e-74)
    		tmp = Float64(cos(M) * Float64(-0.0026041666666666665 * (n ^ 6.0)));
    	elseif (n <= 54.0)
    		tmp = exp(Float64(M * Float64(0.0 - M)));
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(K, m, n, M, l)
    	t_0 = exp((-0.25 * (n * n)));
    	tmp = 0.0;
    	if (n <= -1.85e-13)
    		tmp = t_0;
    	elseif (n <= 5.7e-74)
    		tmp = cos(M) * (-0.0026041666666666665 * (n ^ 6.0));
    	elseif (n <= 54.0)
    		tmp = exp((M * (0.0 - M)));
    	else
    		tmp = t_0;
    	end
    	tmp_2 = tmp;
    end
    
    code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[Exp[N[(-0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[n, -1.85e-13], t$95$0, If[LessEqual[n, 5.7e-74], N[(N[Cos[M], $MachinePrecision] * N[(-0.0026041666666666665 * N[Power[n, 6.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 54.0], N[Exp[N[(M * N[(0.0 - M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := e^{-0.25 \cdot \left(n \cdot n\right)}\\
    \mathbf{if}\;n \leq -1.85 \cdot 10^{-13}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;n \leq 5.7 \cdot 10^{-74}:\\
    \;\;\;\;\cos M \cdot \left(-0.0026041666666666665 \cdot {n}^{6}\right)\\
    
    \mathbf{elif}\;n \leq 54:\\
    \;\;\;\;e^{M \cdot \left(0 - M\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if n < -1.84999999999999994e-13 or 54 < n

      1. Initial program 69.5%

        \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in K around 0

        \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
      4. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
        2. cos-negN/A

          \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
        3. cos-lowering-cos.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
        4. exp-lowering-exp.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        5. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        6. fabs-subN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        7. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        8. mul-1-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        9. fabs-lowering-fabs.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        10. mul-1-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        11. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        12. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        13. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
        14. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        15. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        16. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        17. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        18. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        19. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        20. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
      5. Simplified99.2%

        \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
      6. Taylor expanded in n around inf

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left({n}^{2}\right)\right)\right)\right) \]
        2. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left(n \cdot n\right)\right)\right)\right) \]
        3. *-lowering-*.f6496.2%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(n, n\right)\right)\right)\right) \]
      8. Simplified96.2%

        \[\leadsto \cos M \cdot e^{\color{blue}{-0.25 \cdot \left(n \cdot n\right)}} \]
      9. Taylor expanded in M around 0

        \[\leadsto \color{blue}{e^{\frac{-1}{4} \cdot {n}^{2}}} \]
      10. Step-by-step derivation
        1. exp-lowering-exp.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\left(\frac{-1}{4} \cdot {n}^{2}\right)\right) \]
        2. *-lowering-*.f64N/A

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

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

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(n, n\right)\right)\right) \]
      11. Simplified96.2%

        \[\leadsto \color{blue}{e^{-0.25 \cdot \left(n \cdot n\right)}} \]

      if -1.84999999999999994e-13 < n < 5.70000000000000025e-74

      1. Initial program 74.3%

        \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in K around 0

        \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
      4. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
        2. cos-negN/A

          \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
        3. cos-lowering-cos.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
        4. exp-lowering-exp.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        5. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        6. fabs-subN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        7. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        8. mul-1-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        9. fabs-lowering-fabs.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        10. mul-1-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        11. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        12. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        13. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
        14. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        15. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        16. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        17. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        18. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        19. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        20. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
      5. Simplified95.8%

        \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
      6. Taylor expanded in n around inf

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left({n}^{2}\right)\right)\right)\right) \]
        2. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left(n \cdot n\right)\right)\right)\right) \]
        3. *-lowering-*.f646.8%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(n, n\right)\right)\right)\right) \]
      8. Simplified6.8%

        \[\leadsto \cos M \cdot e^{\color{blue}{-0.25 \cdot \left(n \cdot n\right)}} \]
      9. Taylor expanded in n around 0

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \color{blue}{\left(1 + {n}^{2} \cdot \left({n}^{2} \cdot \left(\frac{1}{32} + \frac{-1}{384} \cdot {n}^{2}\right) - \frac{1}{4}\right)\right)}\right) \]
      10. Step-by-step derivation
        1. +-lowering-+.f64N/A

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({n}^{2}\right), \color{blue}{\left({n}^{2} \cdot \left(\frac{1}{32} + \frac{-1}{384} \cdot {n}^{2}\right) - \frac{1}{4}\right)}\right)\right)\right) \]
        3. unpow2N/A

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \left(\color{blue}{{n}^{2} \cdot \left(\frac{1}{32} + \frac{-1}{384} \cdot {n}^{2}\right)} - \frac{1}{4}\right)\right)\right)\right) \]
        5. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \left({n}^{2} \cdot \left(\frac{1}{32} + \frac{-1}{384} \cdot {n}^{2}\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)}\right)\right)\right)\right) \]
        6. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \left({n}^{2} \cdot \left(\frac{1}{32} + \frac{-1}{384} \cdot {n}^{2}\right) + \frac{-1}{4}\right)\right)\right)\right) \]
        7. +-commutativeN/A

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(\left({n}^{2}\right), \color{blue}{\left(\frac{1}{32} + \frac{-1}{384} \cdot {n}^{2}\right)}\right)\right)\right)\right)\right) \]
        10. unpow2N/A

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{1}{32}, \color{blue}{\left(\frac{-1}{384} \cdot {n}^{2}\right)}\right)\right)\right)\right)\right)\right) \]
        13. *-commutativeN/A

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{1}{32}, \mathsf{*.f64}\left(\left({n}^{2}\right), \color{blue}{\frac{-1}{384}}\right)\right)\right)\right)\right)\right)\right) \]
        15. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{1}{32}, \mathsf{*.f64}\left(\left(n \cdot n\right), \frac{-1}{384}\right)\right)\right)\right)\right)\right)\right) \]
        16. *-lowering-*.f646.8%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \mathsf{+.f64}\left(\frac{1}{32}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(n, n\right), \frac{-1}{384}\right)\right)\right)\right)\right)\right)\right) \]
      11. Simplified6.8%

        \[\leadsto \cos M \cdot \color{blue}{\left(1 + \left(n \cdot n\right) \cdot \left(-0.25 + \left(n \cdot n\right) \cdot \left(0.03125 + \left(n \cdot n\right) \cdot -0.0026041666666666665\right)\right)\right)} \]
      12. Taylor expanded in n around inf

        \[\leadsto \color{blue}{\frac{-1}{384} \cdot \left({n}^{6} \cdot \cos M\right)} \]
      13. Step-by-step derivation
        1. associate-*r*N/A

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

          \[\leadsto \cos M \cdot \color{blue}{\left(\frac{-1}{384} \cdot {n}^{6}\right)} \]
        3. *-lowering-*.f64N/A

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{*.f64}\left(\frac{-1}{384}, \color{blue}{\left({n}^{6}\right)}\right)\right) \]
        6. pow-lowering-pow.f6480.8%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{*.f64}\left(\frac{-1}{384}, \mathsf{pow.f64}\left(n, \color{blue}{6}\right)\right)\right) \]
      14. Simplified80.8%

        \[\leadsto \color{blue}{\cos M \cdot \left(-0.0026041666666666665 \cdot {n}^{6}\right)} \]

      if 5.70000000000000025e-74 < n < 54

      1. Initial program 83.6%

        \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in K around 0

        \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
      4. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
        2. cos-negN/A

          \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
        3. cos-lowering-cos.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
        4. exp-lowering-exp.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        5. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        6. fabs-subN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        7. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        8. mul-1-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        9. fabs-lowering-fabs.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        10. mul-1-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        11. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        12. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
        13. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
        14. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        15. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        16. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        17. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        18. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        19. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
        20. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
      5. Simplified96.0%

        \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
      6. Taylor expanded in M around inf

        \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot {M}^{2}\right)}\right)\right) \]
      7. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left({M}^{2}\right)\right)\right)\right) \]
        2. neg-sub0N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(0 - {M}^{2}\right)\right)\right) \]
        3. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \left({M}^{2}\right)\right)\right)\right) \]
        4. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \left(M \cdot M\right)\right)\right)\right) \]
        5. *-lowering-*.f6473.2%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(M, M\right)\right)\right)\right) \]
      8. Simplified73.2%

        \[\leadsto \cos M \cdot e^{\color{blue}{0 - M \cdot M}} \]
      9. Taylor expanded in M around 0

        \[\leadsto \mathsf{*.f64}\left(\color{blue}{1}, \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(M, M\right)\right)\right)\right) \]
      10. Step-by-step derivation
        1. Simplified73.2%

          \[\leadsto \color{blue}{1} \cdot e^{0 - M \cdot M} \]
      11. Recombined 3 regimes into one program.
      12. Final simplification88.0%

        \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.85 \cdot 10^{-13}:\\ \;\;\;\;e^{-0.25 \cdot \left(n \cdot n\right)}\\ \mathbf{elif}\;n \leq 5.7 \cdot 10^{-74}:\\ \;\;\;\;\cos M \cdot \left(-0.0026041666666666665 \cdot {n}^{6}\right)\\ \mathbf{elif}\;n \leq 54:\\ \;\;\;\;e^{M \cdot \left(0 - M\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{-0.25 \cdot \left(n \cdot n\right)}\\ \end{array} \]
      13. Add Preprocessing

      Alternative 5: 73.0% accurate, 2.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{-0.25 \cdot \left(n \cdot n\right)}\\ \mathbf{if}\;n \leq -8.2 \cdot 10^{-14}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 1.35 \cdot 10^{-278}:\\ \;\;\;\;\cos M \cdot e^{0 - \ell}\\ \mathbf{elif}\;n \leq 54:\\ \;\;\;\;e^{M \cdot \left(0 - M\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (K m n M l)
       :precision binary64
       (let* ((t_0 (exp (* -0.25 (* n n)))))
         (if (<= n -8.2e-14)
           t_0
           (if (<= n 1.35e-278)
             (* (cos M) (exp (- 0.0 l)))
             (if (<= n 54.0) (exp (* M (- 0.0 M))) t_0)))))
      double code(double K, double m, double n, double M, double l) {
      	double t_0 = exp((-0.25 * (n * n)));
      	double tmp;
      	if (n <= -8.2e-14) {
      		tmp = t_0;
      	} else if (n <= 1.35e-278) {
      		tmp = cos(M) * exp((0.0 - l));
      	} else if (n <= 54.0) {
      		tmp = exp((M * (0.0 - M)));
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      real(8) function code(k, m, n, m_1, l)
          real(8), intent (in) :: k
          real(8), intent (in) :: m
          real(8), intent (in) :: n
          real(8), intent (in) :: m_1
          real(8), intent (in) :: l
          real(8) :: t_0
          real(8) :: tmp
          t_0 = exp(((-0.25d0) * (n * n)))
          if (n <= (-8.2d-14)) then
              tmp = t_0
          else if (n <= 1.35d-278) then
              tmp = cos(m_1) * exp((0.0d0 - l))
          else if (n <= 54.0d0) then
              tmp = exp((m_1 * (0.0d0 - m_1)))
          else
              tmp = t_0
          end if
          code = tmp
      end function
      
      public static double code(double K, double m, double n, double M, double l) {
      	double t_0 = Math.exp((-0.25 * (n * n)));
      	double tmp;
      	if (n <= -8.2e-14) {
      		tmp = t_0;
      	} else if (n <= 1.35e-278) {
      		tmp = Math.cos(M) * Math.exp((0.0 - l));
      	} else if (n <= 54.0) {
      		tmp = Math.exp((M * (0.0 - M)));
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      def code(K, m, n, M, l):
      	t_0 = math.exp((-0.25 * (n * n)))
      	tmp = 0
      	if n <= -8.2e-14:
      		tmp = t_0
      	elif n <= 1.35e-278:
      		tmp = math.cos(M) * math.exp((0.0 - l))
      	elif n <= 54.0:
      		tmp = math.exp((M * (0.0 - M)))
      	else:
      		tmp = t_0
      	return tmp
      
      function code(K, m, n, M, l)
      	t_0 = exp(Float64(-0.25 * Float64(n * n)))
      	tmp = 0.0
      	if (n <= -8.2e-14)
      		tmp = t_0;
      	elseif (n <= 1.35e-278)
      		tmp = Float64(cos(M) * exp(Float64(0.0 - l)));
      	elseif (n <= 54.0)
      		tmp = exp(Float64(M * Float64(0.0 - M)));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      function tmp_2 = code(K, m, n, M, l)
      	t_0 = exp((-0.25 * (n * n)));
      	tmp = 0.0;
      	if (n <= -8.2e-14)
      		tmp = t_0;
      	elseif (n <= 1.35e-278)
      		tmp = cos(M) * exp((0.0 - l));
      	elseif (n <= 54.0)
      		tmp = exp((M * (0.0 - M)));
      	else
      		tmp = t_0;
      	end
      	tmp_2 = tmp;
      end
      
      code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[Exp[N[(-0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[n, -8.2e-14], t$95$0, If[LessEqual[n, 1.35e-278], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(0.0 - l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 54.0], N[Exp[N[(M * N[(0.0 - M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := e^{-0.25 \cdot \left(n \cdot n\right)}\\
      \mathbf{if}\;n \leq -8.2 \cdot 10^{-14}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;n \leq 1.35 \cdot 10^{-278}:\\
      \;\;\;\;\cos M \cdot e^{0 - \ell}\\
      
      \mathbf{elif}\;n \leq 54:\\
      \;\;\;\;e^{M \cdot \left(0 - M\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if n < -8.2000000000000004e-14 or 54 < n

        1. Initial program 69.5%

          \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in K around 0

          \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
          2. cos-negN/A

            \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
          3. cos-lowering-cos.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
          4. exp-lowering-exp.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          5. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          6. fabs-subN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          7. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          8. mul-1-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          9. fabs-lowering-fabs.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          10. mul-1-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          11. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          12. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          13. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
          14. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
          15. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
          16. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
          17. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
          18. +-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
          19. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
          20. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
        5. Simplified99.2%

          \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
        6. Taylor expanded in n around inf

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left({n}^{2}\right)\right)\right)\right) \]
          2. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left(n \cdot n\right)\right)\right)\right) \]
          3. *-lowering-*.f6496.2%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(n, n\right)\right)\right)\right) \]
        8. Simplified96.2%

          \[\leadsto \cos M \cdot e^{\color{blue}{-0.25 \cdot \left(n \cdot n\right)}} \]
        9. Taylor expanded in M around 0

          \[\leadsto \color{blue}{e^{\frac{-1}{4} \cdot {n}^{2}}} \]
        10. Step-by-step derivation
          1. exp-lowering-exp.f64N/A

            \[\leadsto \mathsf{exp.f64}\left(\left(\frac{-1}{4} \cdot {n}^{2}\right)\right) \]
          2. *-lowering-*.f64N/A

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

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

            \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(n, n\right)\right)\right) \]
        11. Simplified96.2%

          \[\leadsto \color{blue}{e^{-0.25 \cdot \left(n \cdot n\right)}} \]

        if -8.2000000000000004e-14 < n < 1.3500000000000001e-278

        1. Initial program 68.4%

          \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in K around 0

          \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
          2. cos-negN/A

            \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
          3. cos-lowering-cos.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
          4. exp-lowering-exp.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          5. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          6. fabs-subN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          7. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          8. mul-1-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          9. fabs-lowering-fabs.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          10. mul-1-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          11. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          12. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          13. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
          14. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
          15. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
          16. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
          17. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
          18. +-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
          19. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
          20. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
        5. Simplified95.7%

          \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
        6. Taylor expanded in l around inf

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot \ell\right)}\right)\right) \]
        7. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
          2. neg-sub0N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(0 - \ell\right)\right)\right) \]
          3. --lowering--.f6453.7%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
        8. Simplified53.7%

          \[\leadsto \cos M \cdot e^{\color{blue}{0 - \ell}} \]

        if 1.3500000000000001e-278 < n < 54

        1. Initial program 82.9%

          \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in K around 0

          \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
          2. cos-negN/A

            \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
          3. cos-lowering-cos.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
          4. exp-lowering-exp.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          5. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          6. fabs-subN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          7. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          8. mul-1-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          9. fabs-lowering-fabs.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          10. mul-1-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          11. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          12. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
          13. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
          14. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
          15. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
          16. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
          17. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
          18. +-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
          19. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
          20. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
        5. Simplified96.1%

          \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
        6. Taylor expanded in M around inf

          \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot {M}^{2}\right)}\right)\right) \]
        7. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left({M}^{2}\right)\right)\right)\right) \]
          2. neg-sub0N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(0 - {M}^{2}\right)\right)\right) \]
          3. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \left({M}^{2}\right)\right)\right)\right) \]
          4. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \left(M \cdot M\right)\right)\right)\right) \]
          5. *-lowering-*.f6465.3%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(M, M\right)\right)\right)\right) \]
        8. Simplified65.3%

          \[\leadsto \cos M \cdot e^{\color{blue}{0 - M \cdot M}} \]
        9. Taylor expanded in M around 0

          \[\leadsto \mathsf{*.f64}\left(\color{blue}{1}, \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(M, M\right)\right)\right)\right) \]
        10. Step-by-step derivation
          1. Simplified65.3%

            \[\leadsto \color{blue}{1} \cdot e^{0 - M \cdot M} \]
        11. Recombined 3 regimes into one program.
        12. Final simplification77.8%

          \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -8.2 \cdot 10^{-14}:\\ \;\;\;\;e^{-0.25 \cdot \left(n \cdot n\right)}\\ \mathbf{elif}\;n \leq 1.35 \cdot 10^{-278}:\\ \;\;\;\;\cos M \cdot e^{0 - \ell}\\ \mathbf{elif}\;n \leq 54:\\ \;\;\;\;e^{M \cdot \left(0 - M\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{-0.25 \cdot \left(n \cdot n\right)}\\ \end{array} \]
        13. Add Preprocessing

        Alternative 6: 73.1% accurate, 3.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{-0.25 \cdot \left(n \cdot n\right)}\\ \mathbf{if}\;n \leq -10.6:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 2.7 \cdot 10^{-275}:\\ \;\;\;\;\frac{1}{e^{\ell}}\\ \mathbf{elif}\;n \leq 54:\\ \;\;\;\;e^{M \cdot \left(0 - M\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
        (FPCore (K m n M l)
         :precision binary64
         (let* ((t_0 (exp (* -0.25 (* n n)))))
           (if (<= n -10.6)
             t_0
             (if (<= n 2.7e-275)
               (/ 1.0 (exp l))
               (if (<= n 54.0) (exp (* M (- 0.0 M))) t_0)))))
        double code(double K, double m, double n, double M, double l) {
        	double t_0 = exp((-0.25 * (n * n)));
        	double tmp;
        	if (n <= -10.6) {
        		tmp = t_0;
        	} else if (n <= 2.7e-275) {
        		tmp = 1.0 / exp(l);
        	} else if (n <= 54.0) {
        		tmp = exp((M * (0.0 - M)));
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        real(8) function code(k, m, n, m_1, l)
            real(8), intent (in) :: k
            real(8), intent (in) :: m
            real(8), intent (in) :: n
            real(8), intent (in) :: m_1
            real(8), intent (in) :: l
            real(8) :: t_0
            real(8) :: tmp
            t_0 = exp(((-0.25d0) * (n * n)))
            if (n <= (-10.6d0)) then
                tmp = t_0
            else if (n <= 2.7d-275) then
                tmp = 1.0d0 / exp(l)
            else if (n <= 54.0d0) then
                tmp = exp((m_1 * (0.0d0 - m_1)))
            else
                tmp = t_0
            end if
            code = tmp
        end function
        
        public static double code(double K, double m, double n, double M, double l) {
        	double t_0 = Math.exp((-0.25 * (n * n)));
        	double tmp;
        	if (n <= -10.6) {
        		tmp = t_0;
        	} else if (n <= 2.7e-275) {
        		tmp = 1.0 / Math.exp(l);
        	} else if (n <= 54.0) {
        		tmp = Math.exp((M * (0.0 - M)));
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        def code(K, m, n, M, l):
        	t_0 = math.exp((-0.25 * (n * n)))
        	tmp = 0
        	if n <= -10.6:
        		tmp = t_0
        	elif n <= 2.7e-275:
        		tmp = 1.0 / math.exp(l)
        	elif n <= 54.0:
        		tmp = math.exp((M * (0.0 - M)))
        	else:
        		tmp = t_0
        	return tmp
        
        function code(K, m, n, M, l)
        	t_0 = exp(Float64(-0.25 * Float64(n * n)))
        	tmp = 0.0
        	if (n <= -10.6)
        		tmp = t_0;
        	elseif (n <= 2.7e-275)
        		tmp = Float64(1.0 / exp(l));
        	elseif (n <= 54.0)
        		tmp = exp(Float64(M * Float64(0.0 - M)));
        	else
        		tmp = t_0;
        	end
        	return tmp
        end
        
        function tmp_2 = code(K, m, n, M, l)
        	t_0 = exp((-0.25 * (n * n)));
        	tmp = 0.0;
        	if (n <= -10.6)
        		tmp = t_0;
        	elseif (n <= 2.7e-275)
        		tmp = 1.0 / exp(l);
        	elseif (n <= 54.0)
        		tmp = exp((M * (0.0 - M)));
        	else
        		tmp = t_0;
        	end
        	tmp_2 = tmp;
        end
        
        code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[Exp[N[(-0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[n, -10.6], t$95$0, If[LessEqual[n, 2.7e-275], N[(1.0 / N[Exp[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 54.0], N[Exp[N[(M * N[(0.0 - M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := e^{-0.25 \cdot \left(n \cdot n\right)}\\
        \mathbf{if}\;n \leq -10.6:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;n \leq 2.7 \cdot 10^{-275}:\\
        \;\;\;\;\frac{1}{e^{\ell}}\\
        
        \mathbf{elif}\;n \leq 54:\\
        \;\;\;\;e^{M \cdot \left(0 - M\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if n < -10.5999999999999996 or 54 < n

          1. Initial program 69.3%

            \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in K around 0

            \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
          4. Step-by-step derivation
            1. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
            2. cos-negN/A

              \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
            3. cos-lowering-cos.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
            4. exp-lowering-exp.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            5. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            6. fabs-subN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            7. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            8. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            9. fabs-lowering-fabs.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            10. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            11. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            12. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            13. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
            14. unpow2N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            15. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            16. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            17. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            18. +-commutativeN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            19. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            20. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
          5. Simplified99.2%

            \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
          6. Taylor expanded in n around inf

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left({n}^{2}\right)\right)\right)\right) \]
            2. unpow2N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left(n \cdot n\right)\right)\right)\right) \]
            3. *-lowering-*.f6496.9%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(n, n\right)\right)\right)\right) \]
          8. Simplified96.9%

            \[\leadsto \cos M \cdot e^{\color{blue}{-0.25 \cdot \left(n \cdot n\right)}} \]
          9. Taylor expanded in M around 0

            \[\leadsto \color{blue}{e^{\frac{-1}{4} \cdot {n}^{2}}} \]
          10. Step-by-step derivation
            1. exp-lowering-exp.f64N/A

              \[\leadsto \mathsf{exp.f64}\left(\left(\frac{-1}{4} \cdot {n}^{2}\right)\right) \]
            2. *-lowering-*.f64N/A

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

              \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left(n \cdot n\right)\right)\right) \]
            4. *-lowering-*.f6496.9%

              \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(n, n\right)\right)\right) \]
          11. Simplified96.9%

            \[\leadsto \color{blue}{e^{-0.25 \cdot \left(n \cdot n\right)}} \]

          if -10.5999999999999996 < n < 2.69999999999999993e-275

          1. Initial program 68.8%

            \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in K around 0

            \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
          4. Step-by-step derivation
            1. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
            2. cos-negN/A

              \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
            3. cos-lowering-cos.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
            4. exp-lowering-exp.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            5. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            6. fabs-subN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            7. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            8. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            9. fabs-lowering-fabs.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            10. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            11. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            12. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            13. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
            14. unpow2N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            15. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            16. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            17. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            18. +-commutativeN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            19. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            20. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
          5. Simplified95.7%

            \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
          6. Taylor expanded in l around inf

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot \ell\right)}\right)\right) \]
          7. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
            2. neg-sub0N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(0 - \ell\right)\right)\right) \]
            3. --lowering--.f6452.9%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
          8. Simplified52.9%

            \[\leadsto \cos M \cdot e^{\color{blue}{0 - \ell}} \]
          9. Taylor expanded in M around 0

            \[\leadsto \color{blue}{e^{\mathsf{neg}\left(\ell\right)}} \]
          10. Step-by-step derivation
            1. exp-negN/A

              \[\leadsto \frac{1}{\color{blue}{e^{\ell}}} \]
            2. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(e^{\ell}\right)}\right) \]
            3. exp-lowering-exp.f6452.9%

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{exp.f64}\left(\ell\right)\right) \]
          11. Simplified52.9%

            \[\leadsto \color{blue}{\frac{1}{e^{\ell}}} \]

          if 2.69999999999999993e-275 < n < 54

          1. Initial program 82.9%

            \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in K around 0

            \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
          4. Step-by-step derivation
            1. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
            2. cos-negN/A

              \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
            3. cos-lowering-cos.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
            4. exp-lowering-exp.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            5. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            6. fabs-subN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            7. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            8. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            9. fabs-lowering-fabs.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            10. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            11. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            12. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            13. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
            14. unpow2N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            15. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            16. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            17. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            18. +-commutativeN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            19. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            20. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
          5. Simplified96.1%

            \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
          6. Taylor expanded in M around inf

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot {M}^{2}\right)}\right)\right) \]
          7. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left({M}^{2}\right)\right)\right)\right) \]
            2. neg-sub0N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(0 - {M}^{2}\right)\right)\right) \]
            3. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \left({M}^{2}\right)\right)\right)\right) \]
            4. unpow2N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \left(M \cdot M\right)\right)\right)\right) \]
            5. *-lowering-*.f6465.3%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(M, M\right)\right)\right)\right) \]
          8. Simplified65.3%

            \[\leadsto \cos M \cdot e^{\color{blue}{0 - M \cdot M}} \]
          9. Taylor expanded in M around 0

            \[\leadsto \mathsf{*.f64}\left(\color{blue}{1}, \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(M, M\right)\right)\right)\right) \]
          10. Step-by-step derivation
            1. Simplified65.3%

              \[\leadsto \color{blue}{1} \cdot e^{0 - M \cdot M} \]
          11. Recombined 3 regimes into one program.
          12. Final simplification77.8%

            \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -10.6:\\ \;\;\;\;e^{-0.25 \cdot \left(n \cdot n\right)}\\ \mathbf{elif}\;n \leq 2.7 \cdot 10^{-275}:\\ \;\;\;\;\frac{1}{e^{\ell}}\\ \mathbf{elif}\;n \leq 54:\\ \;\;\;\;e^{M \cdot \left(0 - M\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{-0.25 \cdot \left(n \cdot n\right)}\\ \end{array} \]
          13. Add Preprocessing

          Alternative 7: 70.6% accurate, 3.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.06 \cdot 10^{+106}:\\ \;\;\;\;\frac{1}{1 + \ell \cdot \left(1 + \ell \cdot \left(0.5 + \ell \cdot 0.16666666666666666\right)\right)}\\ \mathbf{elif}\;\ell \leq 0.135:\\ \;\;\;\;e^{-0.25 \cdot \left(n \cdot n\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{e^{\ell}}\\ \end{array} \end{array} \]
          (FPCore (K m n M l)
           :precision binary64
           (if (<= l -1.06e+106)
             (/ 1.0 (+ 1.0 (* l (+ 1.0 (* l (+ 0.5 (* l 0.16666666666666666)))))))
             (if (<= l 0.135) (exp (* -0.25 (* n n))) (/ 1.0 (exp l)))))
          double code(double K, double m, double n, double M, double l) {
          	double tmp;
          	if (l <= -1.06e+106) {
          		tmp = 1.0 / (1.0 + (l * (1.0 + (l * (0.5 + (l * 0.16666666666666666))))));
          	} else if (l <= 0.135) {
          		tmp = exp((-0.25 * (n * n)));
          	} else {
          		tmp = 1.0 / exp(l);
          	}
          	return tmp;
          }
          
          real(8) function code(k, m, n, m_1, l)
              real(8), intent (in) :: k
              real(8), intent (in) :: m
              real(8), intent (in) :: n
              real(8), intent (in) :: m_1
              real(8), intent (in) :: l
              real(8) :: tmp
              if (l <= (-1.06d+106)) then
                  tmp = 1.0d0 / (1.0d0 + (l * (1.0d0 + (l * (0.5d0 + (l * 0.16666666666666666d0))))))
              else if (l <= 0.135d0) then
                  tmp = exp(((-0.25d0) * (n * n)))
              else
                  tmp = 1.0d0 / exp(l)
              end if
              code = tmp
          end function
          
          public static double code(double K, double m, double n, double M, double l) {
          	double tmp;
          	if (l <= -1.06e+106) {
          		tmp = 1.0 / (1.0 + (l * (1.0 + (l * (0.5 + (l * 0.16666666666666666))))));
          	} else if (l <= 0.135) {
          		tmp = Math.exp((-0.25 * (n * n)));
          	} else {
          		tmp = 1.0 / Math.exp(l);
          	}
          	return tmp;
          }
          
          def code(K, m, n, M, l):
          	tmp = 0
          	if l <= -1.06e+106:
          		tmp = 1.0 / (1.0 + (l * (1.0 + (l * (0.5 + (l * 0.16666666666666666))))))
          	elif l <= 0.135:
          		tmp = math.exp((-0.25 * (n * n)))
          	else:
          		tmp = 1.0 / math.exp(l)
          	return tmp
          
          function code(K, m, n, M, l)
          	tmp = 0.0
          	if (l <= -1.06e+106)
          		tmp = Float64(1.0 / Float64(1.0 + Float64(l * Float64(1.0 + Float64(l * Float64(0.5 + Float64(l * 0.16666666666666666)))))));
          	elseif (l <= 0.135)
          		tmp = exp(Float64(-0.25 * Float64(n * n)));
          	else
          		tmp = Float64(1.0 / exp(l));
          	end
          	return tmp
          end
          
          function tmp_2 = code(K, m, n, M, l)
          	tmp = 0.0;
          	if (l <= -1.06e+106)
          		tmp = 1.0 / (1.0 + (l * (1.0 + (l * (0.5 + (l * 0.16666666666666666))))));
          	elseif (l <= 0.135)
          		tmp = exp((-0.25 * (n * n)));
          	else
          		tmp = 1.0 / exp(l);
          	end
          	tmp_2 = tmp;
          end
          
          code[K_, m_, n_, M_, l_] := If[LessEqual[l, -1.06e+106], N[(1.0 / N[(1.0 + N[(l * N[(1.0 + N[(l * N[(0.5 + N[(l * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 0.135], N[Exp[N[(-0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(1.0 / N[Exp[l], $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;\ell \leq -1.06 \cdot 10^{+106}:\\
          \;\;\;\;\frac{1}{1 + \ell \cdot \left(1 + \ell \cdot \left(0.5 + \ell \cdot 0.16666666666666666\right)\right)}\\
          
          \mathbf{elif}\;\ell \leq 0.135:\\
          \;\;\;\;e^{-0.25 \cdot \left(n \cdot n\right)}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{1}{e^{\ell}}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if l < -1.06e106

            1. Initial program 63.2%

              \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
            2. Add Preprocessing
            3. Taylor expanded in K around 0

              \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
            4. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
              2. cos-negN/A

                \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
              3. cos-lowering-cos.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
              4. exp-lowering-exp.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              5. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              6. fabs-subN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              7. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              8. mul-1-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              9. fabs-lowering-fabs.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              10. mul-1-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              11. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              12. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              13. +-lowering-+.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
              14. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              15. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              16. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              17. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              18. +-commutativeN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              19. +-lowering-+.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              20. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
            5. Simplified94.7%

              \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
            6. Taylor expanded in l around inf

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot \ell\right)}\right)\right) \]
            7. Step-by-step derivation
              1. mul-1-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
              2. neg-sub0N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(0 - \ell\right)\right)\right) \]
              3. --lowering--.f6422.2%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
            8. Simplified22.2%

              \[\leadsto \cos M \cdot e^{\color{blue}{0 - \ell}} \]
            9. Taylor expanded in M around 0

              \[\leadsto \color{blue}{e^{\mathsf{neg}\left(\ell\right)}} \]
            10. Step-by-step derivation
              1. exp-negN/A

                \[\leadsto \frac{1}{\color{blue}{e^{\ell}}} \]
              2. /-lowering-/.f64N/A

                \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(e^{\ell}\right)}\right) \]
              3. exp-lowering-exp.f6422.2%

                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{exp.f64}\left(\ell\right)\right) \]
            11. Simplified22.2%

              \[\leadsto \color{blue}{\frac{1}{e^{\ell}}} \]
            12. Taylor expanded in l around 0

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

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

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

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

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

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

                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{2}, \left(\ell \cdot \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
              7. *-lowering-*.f6474.1%

                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\ell, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
            14. Simplified74.1%

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

            if -1.06e106 < l < 0.13500000000000001

            1. Initial program 70.4%

              \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
            2. Add Preprocessing
            3. Taylor expanded in K around 0

              \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
            4. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
              2. cos-negN/A

                \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
              3. cos-lowering-cos.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
              4. exp-lowering-exp.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              5. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              6. fabs-subN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              7. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              8. mul-1-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              9. fabs-lowering-fabs.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              10. mul-1-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              11. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              12. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              13. +-lowering-+.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
              14. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              15. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              16. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              17. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              18. +-commutativeN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              19. +-lowering-+.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              20. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
            5. Simplified97.0%

              \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
            6. Taylor expanded in n around inf

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left({n}^{2}\right)\right)\right)\right) \]
              2. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left(n \cdot n\right)\right)\right)\right) \]
              3. *-lowering-*.f6463.8%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(n, n\right)\right)\right)\right) \]
            8. Simplified63.8%

              \[\leadsto \cos M \cdot e^{\color{blue}{-0.25 \cdot \left(n \cdot n\right)}} \]
            9. Taylor expanded in M around 0

              \[\leadsto \color{blue}{e^{\frac{-1}{4} \cdot {n}^{2}}} \]
            10. Step-by-step derivation
              1. exp-lowering-exp.f64N/A

                \[\leadsto \mathsf{exp.f64}\left(\left(\frac{-1}{4} \cdot {n}^{2}\right)\right) \]
              2. *-lowering-*.f64N/A

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

                \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left(n \cdot n\right)\right)\right) \]
              4. *-lowering-*.f6463.8%

                \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(n, n\right)\right)\right) \]
            11. Simplified63.8%

              \[\leadsto \color{blue}{e^{-0.25 \cdot \left(n \cdot n\right)}} \]

            if 0.13500000000000001 < l

            1. Initial program 81.3%

              \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
            2. Add Preprocessing
            3. Taylor expanded in K around 0

              \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
            4. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
              2. cos-negN/A

                \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
              3. cos-lowering-cos.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
              4. exp-lowering-exp.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              5. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              6. fabs-subN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              7. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              8. mul-1-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              9. fabs-lowering-fabs.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              10. mul-1-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              11. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              12. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              13. +-lowering-+.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
              14. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              15. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              16. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              17. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              18. +-commutativeN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              19. +-lowering-+.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              20. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
            5. Simplified100.0%

              \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
            6. Taylor expanded in l around inf

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot \ell\right)}\right)\right) \]
            7. Step-by-step derivation
              1. mul-1-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
              2. neg-sub0N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(0 - \ell\right)\right)\right) \]
              3. --lowering--.f6497.4%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
            8. Simplified97.4%

              \[\leadsto \cos M \cdot e^{\color{blue}{0 - \ell}} \]
            9. Taylor expanded in M around 0

              \[\leadsto \color{blue}{e^{\mathsf{neg}\left(\ell\right)}} \]
            10. Step-by-step derivation
              1. exp-negN/A

                \[\leadsto \frac{1}{\color{blue}{e^{\ell}}} \]
              2. /-lowering-/.f64N/A

                \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(e^{\ell}\right)}\right) \]
              3. exp-lowering-exp.f6497.4%

                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{exp.f64}\left(\ell\right)\right) \]
            11. Simplified97.4%

              \[\leadsto \color{blue}{\frac{1}{e^{\ell}}} \]
          3. Recombined 3 regimes into one program.
          4. Add Preprocessing

          Alternative 8: 43.4% accurate, 3.9× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.7 \cdot 10^{+79}:\\ \;\;\;\;\frac{1}{1 + \ell \cdot \left(1 + \ell \cdot \left(0.5 + \ell \cdot 0.16666666666666666\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{e^{\ell}}\\ \end{array} \end{array} \]
          (FPCore (K m n M l)
           :precision binary64
           (if (<= l -1.7e+79)
             (/ 1.0 (+ 1.0 (* l (+ 1.0 (* l (+ 0.5 (* l 0.16666666666666666)))))))
             (/ 1.0 (exp l))))
          double code(double K, double m, double n, double M, double l) {
          	double tmp;
          	if (l <= -1.7e+79) {
          		tmp = 1.0 / (1.0 + (l * (1.0 + (l * (0.5 + (l * 0.16666666666666666))))));
          	} else {
          		tmp = 1.0 / exp(l);
          	}
          	return tmp;
          }
          
          real(8) function code(k, m, n, m_1, l)
              real(8), intent (in) :: k
              real(8), intent (in) :: m
              real(8), intent (in) :: n
              real(8), intent (in) :: m_1
              real(8), intent (in) :: l
              real(8) :: tmp
              if (l <= (-1.7d+79)) then
                  tmp = 1.0d0 / (1.0d0 + (l * (1.0d0 + (l * (0.5d0 + (l * 0.16666666666666666d0))))))
              else
                  tmp = 1.0d0 / exp(l)
              end if
              code = tmp
          end function
          
          public static double code(double K, double m, double n, double M, double l) {
          	double tmp;
          	if (l <= -1.7e+79) {
          		tmp = 1.0 / (1.0 + (l * (1.0 + (l * (0.5 + (l * 0.16666666666666666))))));
          	} else {
          		tmp = 1.0 / Math.exp(l);
          	}
          	return tmp;
          }
          
          def code(K, m, n, M, l):
          	tmp = 0
          	if l <= -1.7e+79:
          		tmp = 1.0 / (1.0 + (l * (1.0 + (l * (0.5 + (l * 0.16666666666666666))))))
          	else:
          		tmp = 1.0 / math.exp(l)
          	return tmp
          
          function code(K, m, n, M, l)
          	tmp = 0.0
          	if (l <= -1.7e+79)
          		tmp = Float64(1.0 / Float64(1.0 + Float64(l * Float64(1.0 + Float64(l * Float64(0.5 + Float64(l * 0.16666666666666666)))))));
          	else
          		tmp = Float64(1.0 / exp(l));
          	end
          	return tmp
          end
          
          function tmp_2 = code(K, m, n, M, l)
          	tmp = 0.0;
          	if (l <= -1.7e+79)
          		tmp = 1.0 / (1.0 + (l * (1.0 + (l * (0.5 + (l * 0.16666666666666666))))));
          	else
          		tmp = 1.0 / exp(l);
          	end
          	tmp_2 = tmp;
          end
          
          code[K_, m_, n_, M_, l_] := If[LessEqual[l, -1.7e+79], N[(1.0 / N[(1.0 + N[(l * N[(1.0 + N[(l * N[(0.5 + N[(l * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Exp[l], $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;\ell \leq -1.7 \cdot 10^{+79}:\\
          \;\;\;\;\frac{1}{1 + \ell \cdot \left(1 + \ell \cdot \left(0.5 + \ell \cdot 0.16666666666666666\right)\right)}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{1}{e^{\ell}}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if l < -1.70000000000000016e79

            1. Initial program 63.6%

              \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
            2. Add Preprocessing
            3. Taylor expanded in K around 0

              \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
            4. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
              2. cos-negN/A

                \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
              3. cos-lowering-cos.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
              4. exp-lowering-exp.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              5. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              6. fabs-subN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              7. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              8. mul-1-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              9. fabs-lowering-fabs.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              10. mul-1-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              11. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              12. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              13. +-lowering-+.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
              14. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              15. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              16. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              17. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              18. +-commutativeN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              19. +-lowering-+.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              20. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
            5. Simplified95.5%

              \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
            6. Taylor expanded in l around inf

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot \ell\right)}\right)\right) \]
            7. Step-by-step derivation
              1. mul-1-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
              2. neg-sub0N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(0 - \ell\right)\right)\right) \]
              3. --lowering--.f6419.4%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
            8. Simplified19.4%

              \[\leadsto \cos M \cdot e^{\color{blue}{0 - \ell}} \]
            9. Taylor expanded in M around 0

              \[\leadsto \color{blue}{e^{\mathsf{neg}\left(\ell\right)}} \]
            10. Step-by-step derivation
              1. exp-negN/A

                \[\leadsto \frac{1}{\color{blue}{e^{\ell}}} \]
              2. /-lowering-/.f64N/A

                \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(e^{\ell}\right)}\right) \]
              3. exp-lowering-exp.f6419.4%

                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{exp.f64}\left(\ell\right)\right) \]
            11. Simplified19.4%

              \[\leadsto \color{blue}{\frac{1}{e^{\ell}}} \]
            12. Taylor expanded in l around 0

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

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

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

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

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

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

                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{2}, \left(\ell \cdot \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
              7. *-lowering-*.f6469.3%

                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\ell, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
            14. Simplified69.3%

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

            if -1.70000000000000016e79 < l

            1. Initial program 74.4%

              \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
            2. Add Preprocessing
            3. Taylor expanded in K around 0

              \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
            4. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
              2. cos-negN/A

                \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
              3. cos-lowering-cos.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
              4. exp-lowering-exp.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              5. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              6. fabs-subN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              7. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              8. mul-1-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              9. fabs-lowering-fabs.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              10. mul-1-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              11. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              12. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
              13. +-lowering-+.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
              14. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              15. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              16. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              17. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              18. +-commutativeN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              19. +-lowering-+.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
              20. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
            5. Simplified98.0%

              \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
            6. Taylor expanded in l around inf

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot \ell\right)}\right)\right) \]
            7. Step-by-step derivation
              1. mul-1-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
              2. neg-sub0N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(0 - \ell\right)\right)\right) \]
              3. --lowering--.f6440.8%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
            8. Simplified40.8%

              \[\leadsto \cos M \cdot e^{\color{blue}{0 - \ell}} \]
            9. Taylor expanded in M around 0

              \[\leadsto \color{blue}{e^{\mathsf{neg}\left(\ell\right)}} \]
            10. Step-by-step derivation
              1. exp-negN/A

                \[\leadsto \frac{1}{\color{blue}{e^{\ell}}} \]
              2. /-lowering-/.f64N/A

                \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(e^{\ell}\right)}\right) \]
              3. exp-lowering-exp.f6440.8%

                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{exp.f64}\left(\ell\right)\right) \]
            11. Simplified40.8%

              \[\leadsto \color{blue}{\frac{1}{e^{\ell}}} \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 9: 35.0% accurate, 28.3× speedup?

          \[\begin{array}{l} \\ \frac{1}{1 + \ell \cdot \left(1 + \ell \cdot \left(0.5 + \ell \cdot 0.16666666666666666\right)\right)} \end{array} \]
          (FPCore (K m n M l)
           :precision binary64
           (/ 1.0 (+ 1.0 (* l (+ 1.0 (* l (+ 0.5 (* l 0.16666666666666666))))))))
          double code(double K, double m, double n, double M, double l) {
          	return 1.0 / (1.0 + (l * (1.0 + (l * (0.5 + (l * 0.16666666666666666))))));
          }
          
          real(8) function code(k, m, n, m_1, l)
              real(8), intent (in) :: k
              real(8), intent (in) :: m
              real(8), intent (in) :: n
              real(8), intent (in) :: m_1
              real(8), intent (in) :: l
              code = 1.0d0 / (1.0d0 + (l * (1.0d0 + (l * (0.5d0 + (l * 0.16666666666666666d0))))))
          end function
          
          public static double code(double K, double m, double n, double M, double l) {
          	return 1.0 / (1.0 + (l * (1.0 + (l * (0.5 + (l * 0.16666666666666666))))));
          }
          
          def code(K, m, n, M, l):
          	return 1.0 / (1.0 + (l * (1.0 + (l * (0.5 + (l * 0.16666666666666666))))))
          
          function code(K, m, n, M, l)
          	return Float64(1.0 / Float64(1.0 + Float64(l * Float64(1.0 + Float64(l * Float64(0.5 + Float64(l * 0.16666666666666666)))))))
          end
          
          function tmp = code(K, m, n, M, l)
          	tmp = 1.0 / (1.0 + (l * (1.0 + (l * (0.5 + (l * 0.16666666666666666))))));
          end
          
          code[K_, m_, n_, M_, l_] := N[(1.0 / N[(1.0 + N[(l * N[(1.0 + N[(l * N[(0.5 + N[(l * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          \frac{1}{1 + \ell \cdot \left(1 + \ell \cdot \left(0.5 + \ell \cdot 0.16666666666666666\right)\right)}
          \end{array}
          
          Derivation
          1. Initial program 72.5%

            \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in K around 0

            \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
          4. Step-by-step derivation
            1. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
            2. cos-negN/A

              \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
            3. cos-lowering-cos.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
            4. exp-lowering-exp.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            5. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            6. fabs-subN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            7. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            8. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            9. fabs-lowering-fabs.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            10. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            11. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            12. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            13. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
            14. unpow2N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            15. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            16. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            17. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            18. +-commutativeN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            19. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            20. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
          5. Simplified97.5%

            \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
          6. Taylor expanded in l around inf

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot \ell\right)}\right)\right) \]
          7. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
            2. neg-sub0N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(0 - \ell\right)\right)\right) \]
            3. --lowering--.f6437.1%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
          8. Simplified37.1%

            \[\leadsto \cos M \cdot e^{\color{blue}{0 - \ell}} \]
          9. Taylor expanded in M around 0

            \[\leadsto \color{blue}{e^{\mathsf{neg}\left(\ell\right)}} \]
          10. Step-by-step derivation
            1. exp-negN/A

              \[\leadsto \frac{1}{\color{blue}{e^{\ell}}} \]
            2. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(e^{\ell}\right)}\right) \]
            3. exp-lowering-exp.f6437.1%

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{exp.f64}\left(\ell\right)\right) \]
          11. Simplified37.1%

            \[\leadsto \color{blue}{\frac{1}{e^{\ell}}} \]
          12. Taylor expanded in l around 0

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

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{2}, \left(\ell \cdot \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
            7. *-lowering-*.f6435.4%

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\ell, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
          14. Simplified35.4%

            \[\leadsto \frac{1}{\color{blue}{1 + \ell \cdot \left(1 + \ell \cdot \left(0.5 + \ell \cdot 0.16666666666666666\right)\right)}} \]
          15. Add Preprocessing

          Alternative 10: 27.8% accurate, 38.6× speedup?

          \[\begin{array}{l} \\ \frac{1}{1 + \ell \cdot \left(1 + \ell \cdot 0.5\right)} \end{array} \]
          (FPCore (K m n M l)
           :precision binary64
           (/ 1.0 (+ 1.0 (* l (+ 1.0 (* l 0.5))))))
          double code(double K, double m, double n, double M, double l) {
          	return 1.0 / (1.0 + (l * (1.0 + (l * 0.5))));
          }
          
          real(8) function code(k, m, n, m_1, l)
              real(8), intent (in) :: k
              real(8), intent (in) :: m
              real(8), intent (in) :: n
              real(8), intent (in) :: m_1
              real(8), intent (in) :: l
              code = 1.0d0 / (1.0d0 + (l * (1.0d0 + (l * 0.5d0))))
          end function
          
          public static double code(double K, double m, double n, double M, double l) {
          	return 1.0 / (1.0 + (l * (1.0 + (l * 0.5))));
          }
          
          def code(K, m, n, M, l):
          	return 1.0 / (1.0 + (l * (1.0 + (l * 0.5))))
          
          function code(K, m, n, M, l)
          	return Float64(1.0 / Float64(1.0 + Float64(l * Float64(1.0 + Float64(l * 0.5)))))
          end
          
          function tmp = code(K, m, n, M, l)
          	tmp = 1.0 / (1.0 + (l * (1.0 + (l * 0.5))));
          end
          
          code[K_, m_, n_, M_, l_] := N[(1.0 / N[(1.0 + N[(l * N[(1.0 + N[(l * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          \frac{1}{1 + \ell \cdot \left(1 + \ell \cdot 0.5\right)}
          \end{array}
          
          Derivation
          1. Initial program 72.5%

            \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in K around 0

            \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
          4. Step-by-step derivation
            1. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
            2. cos-negN/A

              \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
            3. cos-lowering-cos.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
            4. exp-lowering-exp.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            5. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            6. fabs-subN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            7. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            8. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            9. fabs-lowering-fabs.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            10. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            11. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            12. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            13. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
            14. unpow2N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            15. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            16. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            17. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            18. +-commutativeN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            19. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            20. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
          5. Simplified97.5%

            \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
          6. Taylor expanded in l around inf

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot \ell\right)}\right)\right) \]
          7. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
            2. neg-sub0N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(0 - \ell\right)\right)\right) \]
            3. --lowering--.f6437.1%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
          8. Simplified37.1%

            \[\leadsto \cos M \cdot e^{\color{blue}{0 - \ell}} \]
          9. Taylor expanded in M around 0

            \[\leadsto \color{blue}{e^{\mathsf{neg}\left(\ell\right)}} \]
          10. Step-by-step derivation
            1. exp-negN/A

              \[\leadsto \frac{1}{\color{blue}{e^{\ell}}} \]
            2. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(e^{\ell}\right)}\right) \]
            3. exp-lowering-exp.f6437.1%

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{exp.f64}\left(\ell\right)\right) \]
          11. Simplified37.1%

            \[\leadsto \color{blue}{\frac{1}{e^{\ell}}} \]
          12. Taylor expanded in l around 0

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(1, \left(\ell \cdot \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
            5. *-lowering-*.f6427.7%

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\ell, \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
          14. Simplified27.7%

            \[\leadsto \frac{1}{\color{blue}{1 + \ell \cdot \left(1 + \ell \cdot 0.5\right)}} \]
          15. Add Preprocessing

          Alternative 11: 9.1% accurate, 47.2× speedup?

          \[\begin{array}{l} \\ 1 + \ell \cdot \left(\ell \cdot 0.5 + -1\right) \end{array} \]
          (FPCore (K m n M l) :precision binary64 (+ 1.0 (* l (+ (* l 0.5) -1.0))))
          double code(double K, double m, double n, double M, double l) {
          	return 1.0 + (l * ((l * 0.5) + -1.0));
          }
          
          real(8) function code(k, m, n, m_1, l)
              real(8), intent (in) :: k
              real(8), intent (in) :: m
              real(8), intent (in) :: n
              real(8), intent (in) :: m_1
              real(8), intent (in) :: l
              code = 1.0d0 + (l * ((l * 0.5d0) + (-1.0d0)))
          end function
          
          public static double code(double K, double m, double n, double M, double l) {
          	return 1.0 + (l * ((l * 0.5) + -1.0));
          }
          
          def code(K, m, n, M, l):
          	return 1.0 + (l * ((l * 0.5) + -1.0))
          
          function code(K, m, n, M, l)
          	return Float64(1.0 + Float64(l * Float64(Float64(l * 0.5) + -1.0)))
          end
          
          function tmp = code(K, m, n, M, l)
          	tmp = 1.0 + (l * ((l * 0.5) + -1.0));
          end
          
          code[K_, m_, n_, M_, l_] := N[(1.0 + N[(l * N[(N[(l * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          1 + \ell \cdot \left(\ell \cdot 0.5 + -1\right)
          \end{array}
          
          Derivation
          1. Initial program 72.5%

            \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in K around 0

            \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
          4. Step-by-step derivation
            1. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
            2. cos-negN/A

              \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
            3. cos-lowering-cos.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
            4. exp-lowering-exp.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            5. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            6. fabs-subN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            7. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            8. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            9. fabs-lowering-fabs.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            10. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            11. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            12. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            13. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
            14. unpow2N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            15. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            16. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            17. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            18. +-commutativeN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            19. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            20. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
          5. Simplified97.5%

            \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
          6. Taylor expanded in l around inf

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot \ell\right)}\right)\right) \]
          7. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
            2. neg-sub0N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(0 - \ell\right)\right)\right) \]
            3. --lowering--.f6437.1%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
          8. Simplified37.1%

            \[\leadsto \cos M \cdot e^{\color{blue}{0 - \ell}} \]
          9. Taylor expanded in M around 0

            \[\leadsto \color{blue}{e^{\mathsf{neg}\left(\ell\right)}} \]
          10. Step-by-step derivation
            1. exp-negN/A

              \[\leadsto \frac{1}{\color{blue}{e^{\ell}}} \]
            2. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(e^{\ell}\right)}\right) \]
            3. exp-lowering-exp.f6437.1%

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{exp.f64}\left(\ell\right)\right) \]
          11. Simplified37.1%

            \[\leadsto \color{blue}{\frac{1}{e^{\ell}}} \]
          12. Taylor expanded in l around 0

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

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

              \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\ell, \color{blue}{\left(\frac{1}{2} \cdot \ell - 1\right)}\right)\right) \]
            3. sub-negN/A

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

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

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

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

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

              \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\ell, \color{blue}{\frac{1}{2}}\right)\right)\right)\right) \]
          14. Simplified7.0%

            \[\leadsto \color{blue}{1 + \ell \cdot \left(-1 + \ell \cdot 0.5\right)} \]
          15. Final simplification7.0%

            \[\leadsto 1 + \ell \cdot \left(\ell \cdot 0.5 + -1\right) \]
          16. Add Preprocessing

          Alternative 12: 7.7% accurate, 85.0× speedup?

          \[\begin{array}{l} \\ \frac{1}{\ell + 1} \end{array} \]
          (FPCore (K m n M l) :precision binary64 (/ 1.0 (+ l 1.0)))
          double code(double K, double m, double n, double M, double l) {
          	return 1.0 / (l + 1.0);
          }
          
          real(8) function code(k, m, n, m_1, l)
              real(8), intent (in) :: k
              real(8), intent (in) :: m
              real(8), intent (in) :: n
              real(8), intent (in) :: m_1
              real(8), intent (in) :: l
              code = 1.0d0 / (l + 1.0d0)
          end function
          
          public static double code(double K, double m, double n, double M, double l) {
          	return 1.0 / (l + 1.0);
          }
          
          def code(K, m, n, M, l):
          	return 1.0 / (l + 1.0)
          
          function code(K, m, n, M, l)
          	return Float64(1.0 / Float64(l + 1.0))
          end
          
          function tmp = code(K, m, n, M, l)
          	tmp = 1.0 / (l + 1.0);
          end
          
          code[K_, m_, n_, M_, l_] := N[(1.0 / N[(l + 1.0), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          \frac{1}{\ell + 1}
          \end{array}
          
          Derivation
          1. Initial program 72.5%

            \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in K around 0

            \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
          4. Step-by-step derivation
            1. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
            2. cos-negN/A

              \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
            3. cos-lowering-cos.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
            4. exp-lowering-exp.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            5. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            6. fabs-subN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            7. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            8. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            9. fabs-lowering-fabs.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            10. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            11. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            12. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            13. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
            14. unpow2N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            15. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            16. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            17. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            18. +-commutativeN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            19. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            20. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
          5. Simplified97.5%

            \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
          6. Taylor expanded in l around inf

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot \ell\right)}\right)\right) \]
          7. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
            2. neg-sub0N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(0 - \ell\right)\right)\right) \]
            3. --lowering--.f6437.1%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
          8. Simplified37.1%

            \[\leadsto \cos M \cdot e^{\color{blue}{0 - \ell}} \]
          9. Taylor expanded in M around 0

            \[\leadsto \color{blue}{e^{\mathsf{neg}\left(\ell\right)}} \]
          10. Step-by-step derivation
            1. exp-negN/A

              \[\leadsto \frac{1}{\color{blue}{e^{\ell}}} \]
            2. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(e^{\ell}\right)}\right) \]
            3. exp-lowering-exp.f6437.1%

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{exp.f64}\left(\ell\right)\right) \]
          11. Simplified37.1%

            \[\leadsto \color{blue}{\frac{1}{e^{\ell}}} \]
          12. Taylor expanded in l around 0

            \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(1 + \ell\right)}\right) \]
          13. Step-by-step derivation
            1. +-lowering-+.f646.2%

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\ell}\right)\right) \]
          14. Simplified6.2%

            \[\leadsto \frac{1}{\color{blue}{1 + \ell}} \]
          15. Final simplification6.2%

            \[\leadsto \frac{1}{\ell + 1} \]
          16. Add Preprocessing

          Alternative 13: 6.8% accurate, 425.0× speedup?

          \[\begin{array}{l} \\ 1 \end{array} \]
          (FPCore (K m n M l) :precision binary64 1.0)
          double code(double K, double m, double n, double M, double l) {
          	return 1.0;
          }
          
          real(8) function code(k, m, n, m_1, l)
              real(8), intent (in) :: k
              real(8), intent (in) :: m
              real(8), intent (in) :: n
              real(8), intent (in) :: m_1
              real(8), intent (in) :: l
              code = 1.0d0
          end function
          
          public static double code(double K, double m, double n, double M, double l) {
          	return 1.0;
          }
          
          def code(K, m, n, M, l):
          	return 1.0
          
          function code(K, m, n, M, l)
          	return 1.0
          end
          
          function tmp = code(K, m, n, M, l)
          	tmp = 1.0;
          end
          
          code[K_, m_, n_, M_, l_] := 1.0
          
          \begin{array}{l}
          
          \\
          1
          \end{array}
          
          Derivation
          1. Initial program 72.5%

            \[\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in K around 0

            \[\leadsto \color{blue}{\cos \left(\mathsf{neg}\left(M\right)\right) \cdot e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}} \]
          4. Step-by-step derivation
            1. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\cos \left(\mathsf{neg}\left(M\right)\right), \color{blue}{\left(e^{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}\right)}\right) \]
            2. cos-negN/A

              \[\leadsto \mathsf{*.f64}\left(\cos M, \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
            3. cos-lowering-cos.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \left(e^{\color{blue}{\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)}}\right)\right) \]
            4. exp-lowering-exp.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\left|m - n\right| - \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            5. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|m - n\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            6. fabs-subN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n - m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            7. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + \left(\mathsf{neg}\left(m\right)\right)\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            8. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\left|n + -1 \cdot m\right|\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            9. fabs-lowering-fabs.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + -1 \cdot m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            10. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n + \left(\mathsf{neg}\left(m\right)\right)\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            11. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\left(n - m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            12. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \left(\ell + {\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right) \]
            13. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left({\left(\frac{1}{2} \cdot \left(m + n\right) - M\right)}^{2}\right)\right)\right)\right)\right) \]
            14. unpow2N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right) \cdot \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            15. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right) - M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            16. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            17. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(m + n\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            18. +-commutativeN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(n + m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            19. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \left(\frac{1}{2} \cdot \left(m + n\right) - M\right)\right)\right)\right)\right)\right) \]
            20. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(n, m\right)\right), \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(n, m\right)\right), M\right), \mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \left(m + n\right)\right), M\right)\right)\right)\right)\right)\right) \]
          5. Simplified97.5%

            \[\leadsto \color{blue}{\cos M \cdot e^{\left|n - m\right| - \left(\ell + \left(0.5 \cdot \left(n + m\right) - M\right) \cdot \left(0.5 \cdot \left(n + m\right) - M\right)\right)}} \]
          6. Taylor expanded in M around inf

            \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot {M}^{2}\right)}\right)\right) \]
          7. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left({M}^{2}\right)\right)\right)\right) \]
            2. neg-sub0N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\left(0 - {M}^{2}\right)\right)\right) \]
            3. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \left({M}^{2}\right)\right)\right)\right) \]
            4. unpow2N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \left(M \cdot M\right)\right)\right)\right) \]
            5. *-lowering-*.f6451.0%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{cos.f64}\left(M\right), \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(M, M\right)\right)\right)\right) \]
          8. Simplified51.0%

            \[\leadsto \cos M \cdot e^{\color{blue}{0 - M \cdot M}} \]
          9. Taylor expanded in M around 0

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

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

            Reproduce

            ?
            herbie shell --seed 2024192 
            (FPCore (K m n M l)
              :name "Maksimov and Kolovsky, Equation (32)"
              :precision binary64
              (* (cos (- (/ (* K (+ m n)) 2.0) M)) (exp (- (- (pow (- (/ (+ m n) 2.0) M) 2.0)) (- l (fabs (- m n)))))))