?

Average Accuracy: 75.7% → 96.7%
Time: 20.7s
Precision: binary64
Cost: 21444

?

\[ \begin{array}{c}[m, n] = \mathsf{sort}([m, n])\\ \end{array} \]
\[\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)} \]
\[\begin{array}{l} t_0 := n \cdot \left(n \cdot -0.25\right)\\ \mathbf{if}\;n \leq 0.5:\\ \;\;\;\;\cos \left(0.5 \cdot \left(n \cdot K\right) - M\right) \cdot e^{\left(\left|m - n\right| - \ell\right) + \left(\left(m \cdot 0.5 - M\right) \cdot \left(\left(M - n\right) + m \cdot -0.5\right) + t_0\right)}\\ \mathbf{else}:\\ \;\;\;\;\cos M \cdot e^{t_0}\\ \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)))))))
(FPCore (K m n M l)
 :precision binary64
 (let* ((t_0 (* n (* n -0.25))))
   (if (<= n 0.5)
     (*
      (cos (- (* 0.5 (* n K)) M))
      (exp
       (+
        (- (fabs (- m n)) l)
        (+ (* (- (* m 0.5) M) (+ (- M n) (* m -0.5))) t_0))))
     (* (cos M) (exp t_0)))))
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)))));
}
double code(double K, double m, double n, double M, double l) {
	double t_0 = n * (n * -0.25);
	double tmp;
	if (n <= 0.5) {
		tmp = cos(((0.5 * (n * K)) - M)) * exp(((fabs((m - n)) - l) + ((((m * 0.5) - M) * ((M - n) + (m * -0.5))) + t_0)));
	} else {
		tmp = cos(M) * exp(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
    code = cos((((k * (m + n)) / 2.0d0) - m_1)) * exp((-((((m + n) / 2.0d0) - m_1) ** 2.0d0) - (l - abs((m - n)))))
end function
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 = n * (n * (-0.25d0))
    if (n <= 0.5d0) then
        tmp = cos(((0.5d0 * (n * k)) - m_1)) * exp(((abs((m - n)) - l) + ((((m * 0.5d0) - m_1) * ((m_1 - n) + (m * (-0.5d0)))) + t_0)))
    else
        tmp = cos(m_1) * exp(t_0)
    end if
    code = tmp
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)))));
}
public static double code(double K, double m, double n, double M, double l) {
	double t_0 = n * (n * -0.25);
	double tmp;
	if (n <= 0.5) {
		tmp = Math.cos(((0.5 * (n * K)) - M)) * Math.exp(((Math.abs((m - n)) - l) + ((((m * 0.5) - M) * ((M - n) + (m * -0.5))) + t_0)));
	} else {
		tmp = Math.cos(M) * Math.exp(t_0);
	}
	return tmp;
}
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)))))
def code(K, m, n, M, l):
	t_0 = n * (n * -0.25)
	tmp = 0
	if n <= 0.5:
		tmp = math.cos(((0.5 * (n * K)) - M)) * math.exp(((math.fabs((m - n)) - l) + ((((m * 0.5) - M) * ((M - n) + (m * -0.5))) + t_0)))
	else:
		tmp = math.cos(M) * math.exp(t_0)
	return tmp
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 code(K, m, n, M, l)
	t_0 = Float64(n * Float64(n * -0.25))
	tmp = 0.0
	if (n <= 0.5)
		tmp = Float64(cos(Float64(Float64(0.5 * Float64(n * K)) - M)) * exp(Float64(Float64(abs(Float64(m - n)) - l) + Float64(Float64(Float64(Float64(m * 0.5) - M) * Float64(Float64(M - n) + Float64(m * -0.5))) + t_0))));
	else
		tmp = Float64(cos(M) * exp(t_0));
	end
	return tmp
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
function tmp_2 = code(K, m, n, M, l)
	t_0 = n * (n * -0.25);
	tmp = 0.0;
	if (n <= 0.5)
		tmp = cos(((0.5 * (n * K)) - M)) * exp(((abs((m - n)) - l) + ((((m * 0.5) - M) * ((M - n) + (m * -0.5))) + t_0)));
	else
		tmp = cos(M) * exp(t_0);
	end
	tmp_2 = tmp;
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]
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(n * N[(n * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, 0.5], N[(N[Cos[N[(N[(0.5 * N[(n * K), $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision] - l), $MachinePrecision] + N[(N[(N[(N[(m * 0.5), $MachinePrecision] - M), $MachinePrecision] * N[(N[(M - n), $MachinePrecision] + N[(m * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\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)}
\begin{array}{l}
t_0 := n \cdot \left(n \cdot -0.25\right)\\
\mathbf{if}\;n \leq 0.5:\\
\;\;\;\;\cos \left(0.5 \cdot \left(n \cdot K\right) - M\right) \cdot e^{\left(\left|m - n\right| - \ell\right) + \left(\left(m \cdot 0.5 - M\right) \cdot \left(\left(M - n\right) + m \cdot -0.5\right) + t_0\right)}\\

\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{t_0}\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 2 regimes
  2. if n < 0.5

    1. Initial program 80.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. Simplified80.3%

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

      [Start]80.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)} \]

      *-commutative [=>]80.2

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

      associate-*r/ [<=]80.3

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

      associate--r- [=>]80.3

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

      +-commutative [=>]80.3

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

      sub-neg [=>]80.3

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

      distribute-neg-out [=>]80.3

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

      sub-neg [<=]80.3

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

      +-commutative [=>]80.3

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

      associate--l- [<=]80.3

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

      \[\leadsto \cos \left(\left(m + n\right) \cdot \frac{K}{2} - M\right) \cdot e^{\left(\left|m - n\right| - \ell\right) - \color{blue}{\left({\left(0.5 \cdot m - M\right)}^{2} + \left(n \cdot \left(0.5 \cdot m - M\right) + 0.25 \cdot {n}^{2}\right)\right)}} \]
    4. Simplified80.3%

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

      [Start]80.0

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

      associate-+r+ [=>]80.0

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

      unpow2 [=>]80.0

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

      distribute-rgt-out [=>]80.3

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

      associate-+l- [=>]80.3

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

      *-commutative [=>]80.3

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

      unpow2 [=>]80.3

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

      associate-*l* [=>]80.3

      \[ \cos \left(\left(m + n\right) \cdot \frac{K}{2} - M\right) \cdot e^{\left(\left|m - n\right| - \ell\right) - \left(\left(0.5 \cdot m - M\right) \cdot \left(0.5 \cdot m - \left(M - n\right)\right) + \color{blue}{n \cdot \left(n \cdot 0.25\right)}\right)} \]
    5. Taylor expanded in m around 0 94.4%

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

    if 0.5 < n

    1. Initial program 70.1%

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

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

      [Start]70.1

      \[ \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)} \]

      *-commutative [=>]70.1

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

      associate-*r/ [<=]70.2

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

      associate--r- [=>]70.2

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

      +-commutative [=>]70.2

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

      sub-neg [=>]70.2

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

      distribute-neg-out [=>]70.2

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

      sub-neg [<=]70.2

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

      +-commutative [=>]70.2

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

      associate--l- [<=]70.2

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

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

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

      [Start]100.0

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

      cos-neg [=>]100.0

      \[ \color{blue}{\cos M} \cdot e^{\left(\left|m - n\right| - \ell\right) - {\left(\frac{m + n}{2} - M\right)}^{2}} \]
    5. Taylor expanded in n around inf 99.6%

      \[\leadsto \cos M \cdot e^{\color{blue}{-0.25 \cdot {n}^{2}}} \]
    6. Simplified99.6%

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

      [Start]99.6

      \[ \cos M \cdot e^{-0.25 \cdot {n}^{2}} \]

      *-commutative [=>]99.6

      \[ \cos M \cdot e^{\color{blue}{{n}^{2} \cdot -0.25}} \]

      unpow2 [=>]99.6

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

      associate-*l* [=>]99.6

      \[ \cos M \cdot e^{\color{blue}{n \cdot \left(n \cdot -0.25\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq 0.5:\\ \;\;\;\;\cos \left(0.5 \cdot \left(n \cdot K\right) - M\right) \cdot e^{\left(\left|m - n\right| - \ell\right) + \left(\left(m \cdot 0.5 - M\right) \cdot \left(\left(M - n\right) + m \cdot -0.5\right) + n \cdot \left(n \cdot -0.25\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\cos M \cdot e^{n \cdot \left(n \cdot -0.25\right)}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy97.9%
Cost26624
\[\cos M \cdot e^{\left(\left|m - n\right| - \ell\right) - {\left(\frac{m + n}{2} - M\right)}^{2}} \]
Alternative 2
Accuracy97.8%
Cost20676
\[\begin{array}{l} \mathbf{if}\;m \leq -7.2:\\ \;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\ \mathbf{else}:\\ \;\;\;\;\cos M \cdot e^{\left(\left|m - n\right| - \ell\right) + \left(n \cdot 0.5 - M\right) \cdot \left(\left(M - m\right) + n \cdot -0.5\right)}\\ \end{array} \]
Alternative 3
Accuracy95.4%
Cost14020
\[\begin{array}{l} \mathbf{if}\;n \leq 55:\\ \;\;\;\;\cos \left(0.5 \cdot \left(n \cdot K\right) - M\right) \cdot e^{\left(m - \left(n + \ell\right)\right) - M \cdot M}\\ \mathbf{else}:\\ \;\;\;\;\cos M \cdot e^{n \cdot \left(n \cdot -0.25\right)}\\ \end{array} \]
Alternative 4
Accuracy63.3%
Cost13516
\[\begin{array}{l} \mathbf{if}\;\ell \leq -9.5 \cdot 10^{-28}:\\ \;\;\;\;\cos M \cdot e^{\ell}\\ \mathbf{elif}\;\ell \leq -4.3 \cdot 10^{-162}:\\ \;\;\;\;\cos M \cdot e^{M \cdot m}\\ \mathbf{elif}\;\ell \leq 4.6 \cdot 10^{-6}:\\ \;\;\;\;\cos M \cdot e^{M \cdot n}\\ \mathbf{else}:\\ \;\;\;\;\cos M \cdot e^{-\ell}\\ \end{array} \]
Alternative 5
Accuracy77.7%
Cost13512
\[\begin{array}{l} \mathbf{if}\;\ell \leq -6.8 \cdot 10^{-10}:\\ \;\;\;\;\cos M \cdot e^{\ell}\\ \mathbf{elif}\;\ell \leq 420:\\ \;\;\;\;\cos M \cdot e^{M \cdot \left(n - M\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{-\ell}\\ \end{array} \]
Alternative 6
Accuracy81.7%
Cost13512
\[\begin{array}{l} \mathbf{if}\;M \leq -6.2:\\ \;\;\;\;\cos M \cdot e^{M \cdot \left(n - M\right)}\\ \mathbf{elif}\;M \leq 27:\\ \;\;\;\;\cos M \cdot e^{n \cdot \left(n \cdot -0.25\right)}\\ \mathbf{else}:\\ \;\;\;\;\cos M \cdot e^{M \cdot \left(-M\right)}\\ \end{array} \]
Alternative 7
Accuracy83.8%
Cost13512
\[\begin{array}{l} \mathbf{if}\;m \leq -7.2:\\ \;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\ \mathbf{elif}\;m \leq -3.1 \cdot 10^{-167}:\\ \;\;\;\;\cos M \cdot e^{M \cdot \left(-M\right)}\\ \mathbf{else}:\\ \;\;\;\;\cos M \cdot e^{n \cdot \left(n \cdot -0.25\right)}\\ \end{array} \]
Alternative 8
Accuracy96.4%
Cost13508
\[\begin{array}{l} \mathbf{if}\;n \leq 55:\\ \;\;\;\;\cos M \cdot e^{m - \left(\ell + M \cdot M\right)}\\ \mathbf{else}:\\ \;\;\;\;\cos M \cdot e^{n \cdot \left(n \cdot -0.25\right)}\\ \end{array} \]
Alternative 9
Accuracy77.1%
Cost13448
\[\begin{array}{l} \mathbf{if}\;\ell \leq -6.8 \cdot 10^{-10}:\\ \;\;\;\;\cos M \cdot e^{\ell}\\ \mathbf{elif}\;\ell \leq 420:\\ \;\;\;\;\cos M \cdot e^{M \cdot \left(-M\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{-\ell}\\ \end{array} \]
Alternative 10
Accuracy63.6%
Cost13384
\[\begin{array}{l} \mathbf{if}\;\ell \leq -9.5 \cdot 10^{-28}:\\ \;\;\;\;\cos M \cdot e^{\ell}\\ \mathbf{elif}\;\ell \leq 1.25 \cdot 10^{-6}:\\ \;\;\;\;\cos M \cdot e^{M \cdot m}\\ \mathbf{else}:\\ \;\;\;\;\cos M \cdot e^{-\ell}\\ \end{array} \]
Alternative 11
Accuracy52.2%
Cost13188
\[\begin{array}{l} \mathbf{if}\;\ell \leq -1 \cdot 10^{-208}:\\ \;\;\;\;\cos M \cdot e^{\ell}\\ \mathbf{else}:\\ \;\;\;\;\cos M \cdot e^{-\ell}\\ \end{array} \]
Alternative 12
Accuracy52.1%
Cost13124
\[\begin{array}{l} \mathbf{if}\;\ell \leq 0.102:\\ \;\;\;\;\cos M \cdot e^{\ell}\\ \mathbf{else}:\\ \;\;\;\;e^{-\ell}\\ \end{array} \]
Alternative 13
Accuracy33.1%
Cost6528
\[e^{-\ell} \]
Alternative 14
Accuracy7.5%
Cost6464
\[\cos M \]
Alternative 15
Accuracy7.5%
Cost64
\[1 \]

Error

Reproduce?

herbie shell --seed 2023140 
(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)))))))