(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 (* (cos M) (pow (pow (exp (- (- (fabs (- n m)) (pow (- (* (+ n m) 0.5) M) 2.0)) l)) 3.0) 0.3333333333333333)))
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) {
return cos(M) * pow(pow(exp(((fabs((n - m)) - pow((((n + m) * 0.5) - M), 2.0)) - l)), 3.0), 0.3333333333333333);
}
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
code = cos(m_1) * ((exp(((abs((n - m)) - ((((n + m) * 0.5d0) - m_1) ** 2.0d0)) - l)) ** 3.0d0) ** 0.3333333333333333d0)
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) {
return Math.cos(M) * Math.pow(Math.pow(Math.exp(((Math.abs((n - m)) - Math.pow((((n + m) * 0.5) - M), 2.0)) - l)), 3.0), 0.3333333333333333);
}
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): return math.cos(M) * math.pow(math.pow(math.exp(((math.fabs((n - m)) - math.pow((((n + m) * 0.5) - M), 2.0)) - l)), 3.0), 0.3333333333333333)
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) return Float64(cos(M) * ((exp(Float64(Float64(abs(Float64(n - m)) - (Float64(Float64(Float64(n + m) * 0.5) - M) ^ 2.0)) - l)) ^ 3.0) ^ 0.3333333333333333)) 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 = code(K, m, n, M, l) tmp = cos(M) * ((exp(((abs((n - m)) - ((((n + m) * 0.5) - M) ^ 2.0)) - l)) ^ 3.0) ^ 0.3333333333333333); 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_] := N[(N[Cos[M], $MachinePrecision] * N[Power[N[Power[N[Exp[N[(N[(N[Abs[N[(n - m), $MachinePrecision]], $MachinePrecision] - N[Power[N[(N[(N[(n + m), $MachinePrecision] * 0.5), $MachinePrecision] - M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]], $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $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)}
\cos M \cdot {\left({\left(e^{\left(\left|n - m\right| - {\left(\left(n + m\right) \cdot 0.5 - M\right)}^{2}\right) - \ell}\right)}^{3}\right)}^{0.3333333333333333}
Results
Initial program 15.2
Simplified15.2
Taylor expanded in K around 0 1.2
Simplified1.2
Applied egg-rr1.2
Final simplification1.2
herbie shell --seed 2022207
(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)))))))