
(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:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(FPCore (K m n M l) :precision binary64 (* (cos M) (exp (- (- (fabs (- n m)) l) (pow (- (* (+ m n) 0.5) M) 2.0)))))
double code(double K, double m, double n, double M, double l) {
return cos(M) * exp(((fabs((n - m)) - l) - pow((((m + n) * 0.5) - M), 2.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 = cos(m_1) * exp(((abs((n - m)) - l) - ((((m + n) * 0.5d0) - m_1) ** 2.0d0)))
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.cos(M) * Math.exp(((Math.abs((n - m)) - l) - Math.pow((((m + n) * 0.5) - M), 2.0)));
}
def code(K, m, n, M, l): return math.cos(M) * math.exp(((math.fabs((n - m)) - l) - math.pow((((m + n) * 0.5) - M), 2.0)))
function code(K, m, n, M, l) return Float64(cos(M) * exp(Float64(Float64(abs(Float64(n - m)) - l) - (Float64(Float64(Float64(m + n) * 0.5) - M) ^ 2.0)))) end
function tmp = code(K, m, n, M, l) tmp = cos(M) * exp(((abs((n - m)) - l) - ((((m + n) * 0.5) - M) ^ 2.0))); end
code[K_, m_, n_, M_, l_] := N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(N[Abs[N[(n - m), $MachinePrecision]], $MachinePrecision] - l), $MachinePrecision] - N[Power[N[(N[(N[(m + n), $MachinePrecision] * 0.5), $MachinePrecision] - M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos M \cdot e^{\left(\left|n - m\right| - \ell\right) - {\left(\left(m + n\right) \cdot 0.5 - M\right)}^{2}}
\end{array}
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (/ (cos (- (* n (* 0.5 K)) M)) (exp (+ n l))))
(t_1 (fabs (- m n)))
(t_2 (* (cos M) (exp (- (- t_1 l) (* (* m 0.5) (+ n (* m 0.5)))))))
(t_3 (* (cos M) (exp (- (* M (- n M)) (- l t_1))))))
(if (<= m -90000.0)
t_2
(if (<= m -1.7e-163)
t_3
(if (<= m -4.5e-221)
t_0
(if (<= m 9.8e-254) t_3 (if (<= m 1.0) t_0 t_2)))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = cos(((n * (0.5 * K)) - M)) / exp((n + l));
double t_1 = fabs((m - n));
double t_2 = cos(M) * exp(((t_1 - l) - ((m * 0.5) * (n + (m * 0.5)))));
double t_3 = cos(M) * exp(((M * (n - M)) - (l - t_1)));
double tmp;
if (m <= -90000.0) {
tmp = t_2;
} else if (m <= -1.7e-163) {
tmp = t_3;
} else if (m <= -4.5e-221) {
tmp = t_0;
} else if (m <= 9.8e-254) {
tmp = t_3;
} else if (m <= 1.0) {
tmp = t_0;
} else {
tmp = t_2;
}
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = cos(((n * (0.5d0 * k)) - m_1)) / exp((n + l))
t_1 = abs((m - n))
t_2 = cos(m_1) * exp(((t_1 - l) - ((m * 0.5d0) * (n + (m * 0.5d0)))))
t_3 = cos(m_1) * exp(((m_1 * (n - m_1)) - (l - t_1)))
if (m <= (-90000.0d0)) then
tmp = t_2
else if (m <= (-1.7d-163)) then
tmp = t_3
else if (m <= (-4.5d-221)) then
tmp = t_0
else if (m <= 9.8d-254) then
tmp = t_3
else if (m <= 1.0d0) then
tmp = t_0
else
tmp = t_2
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double t_0 = Math.cos(((n * (0.5 * K)) - M)) / Math.exp((n + l));
double t_1 = Math.abs((m - n));
double t_2 = Math.cos(M) * Math.exp(((t_1 - l) - ((m * 0.5) * (n + (m * 0.5)))));
double t_3 = Math.cos(M) * Math.exp(((M * (n - M)) - (l - t_1)));
double tmp;
if (m <= -90000.0) {
tmp = t_2;
} else if (m <= -1.7e-163) {
tmp = t_3;
} else if (m <= -4.5e-221) {
tmp = t_0;
} else if (m <= 9.8e-254) {
tmp = t_3;
} else if (m <= 1.0) {
tmp = t_0;
} else {
tmp = t_2;
}
return tmp;
}
def code(K, m, n, M, l): t_0 = math.cos(((n * (0.5 * K)) - M)) / math.exp((n + l)) t_1 = math.fabs((m - n)) t_2 = math.cos(M) * math.exp(((t_1 - l) - ((m * 0.5) * (n + (m * 0.5))))) t_3 = math.cos(M) * math.exp(((M * (n - M)) - (l - t_1))) tmp = 0 if m <= -90000.0: tmp = t_2 elif m <= -1.7e-163: tmp = t_3 elif m <= -4.5e-221: tmp = t_0 elif m <= 9.8e-254: tmp = t_3 elif m <= 1.0: tmp = t_0 else: tmp = t_2 return tmp
function code(K, m, n, M, l) t_0 = Float64(cos(Float64(Float64(n * Float64(0.5 * K)) - M)) / exp(Float64(n + l))) t_1 = abs(Float64(m - n)) t_2 = Float64(cos(M) * exp(Float64(Float64(t_1 - l) - Float64(Float64(m * 0.5) * Float64(n + Float64(m * 0.5)))))) t_3 = Float64(cos(M) * exp(Float64(Float64(M * Float64(n - M)) - Float64(l - t_1)))) tmp = 0.0 if (m <= -90000.0) tmp = t_2; elseif (m <= -1.7e-163) tmp = t_3; elseif (m <= -4.5e-221) tmp = t_0; elseif (m <= 9.8e-254) tmp = t_3; elseif (m <= 1.0) tmp = t_0; else tmp = t_2; end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = cos(((n * (0.5 * K)) - M)) / exp((n + l)); t_1 = abs((m - n)); t_2 = cos(M) * exp(((t_1 - l) - ((m * 0.5) * (n + (m * 0.5))))); t_3 = cos(M) * exp(((M * (n - M)) - (l - t_1))); tmp = 0.0; if (m <= -90000.0) tmp = t_2; elseif (m <= -1.7e-163) tmp = t_3; elseif (m <= -4.5e-221) tmp = t_0; elseif (m <= 9.8e-254) tmp = t_3; elseif (m <= 1.0) tmp = t_0; else tmp = t_2; end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[Cos[N[(N[(n * N[(0.5 * K), $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(n + l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(t$95$1 - l), $MachinePrecision] - N[(N[(m * 0.5), $MachinePrecision] * N[(n + N[(m * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(M * N[(n - M), $MachinePrecision]), $MachinePrecision] - N[(l - t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, -90000.0], t$95$2, If[LessEqual[m, -1.7e-163], t$95$3, If[LessEqual[m, -4.5e-221], t$95$0, If[LessEqual[m, 9.8e-254], t$95$3, If[LessEqual[m, 1.0], t$95$0, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\cos \left(n \cdot \left(0.5 \cdot K\right) - M\right)}{e^{n + \ell}}\\
t_1 := \left|m - n\right|\\
t_2 := \cos M \cdot e^{\left(t_1 - \ell\right) - \left(m \cdot 0.5\right) \cdot \left(n + m \cdot 0.5\right)}\\
t_3 := \cos M \cdot e^{M \cdot \left(n - M\right) - \left(\ell - t_1\right)}\\
\mathbf{if}\;m \leq -90000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;m \leq -1.7 \cdot 10^{-163}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;m \leq -4.5 \cdot 10^{-221}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;m \leq 9.8 \cdot 10^{-254}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;m \leq 1:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (fabs (- m n)))
(t_1 (- t_0 l))
(t_2 (* (cos M) (exp (- t_1 (* (* m 0.5) (+ n (* m 0.5))))))))
(if (<= m -46000.0)
t_2
(if (<= m -4e-164)
(* (cos M) (exp (- (* M (- n M)) (- l t_0))))
(if (<= m -4.7e-212)
(/ (cos (* (* n 0.5) K)) (exp (+ n l)))
(if (<= m 9.5)
(* (cos (- (* m (* 0.5 K)) M)) (exp (+ t_1 (* M (- m M)))))
t_2))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = fabs((m - n));
double t_1 = t_0 - l;
double t_2 = cos(M) * exp((t_1 - ((m * 0.5) * (n + (m * 0.5)))));
double tmp;
if (m <= -46000.0) {
tmp = t_2;
} else if (m <= -4e-164) {
tmp = cos(M) * exp(((M * (n - M)) - (l - t_0)));
} else if (m <= -4.7e-212) {
tmp = cos(((n * 0.5) * K)) / exp((n + l));
} else if (m <= 9.5) {
tmp = cos(((m * (0.5 * K)) - M)) * exp((t_1 + (M * (m - M))));
} else {
tmp = t_2;
}
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = abs((m - n))
t_1 = t_0 - l
t_2 = cos(m_1) * exp((t_1 - ((m * 0.5d0) * (n + (m * 0.5d0)))))
if (m <= (-46000.0d0)) then
tmp = t_2
else if (m <= (-4d-164)) then
tmp = cos(m_1) * exp(((m_1 * (n - m_1)) - (l - t_0)))
else if (m <= (-4.7d-212)) then
tmp = cos(((n * 0.5d0) * k)) / exp((n + l))
else if (m <= 9.5d0) then
tmp = cos(((m * (0.5d0 * k)) - m_1)) * exp((t_1 + (m_1 * (m - m_1))))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double t_0 = Math.abs((m - n));
double t_1 = t_0 - l;
double t_2 = Math.cos(M) * Math.exp((t_1 - ((m * 0.5) * (n + (m * 0.5)))));
double tmp;
if (m <= -46000.0) {
tmp = t_2;
} else if (m <= -4e-164) {
tmp = Math.cos(M) * Math.exp(((M * (n - M)) - (l - t_0)));
} else if (m <= -4.7e-212) {
tmp = Math.cos(((n * 0.5) * K)) / Math.exp((n + l));
} else if (m <= 9.5) {
tmp = Math.cos(((m * (0.5 * K)) - M)) * Math.exp((t_1 + (M * (m - M))));
} else {
tmp = t_2;
}
return tmp;
}
def code(K, m, n, M, l): t_0 = math.fabs((m - n)) t_1 = t_0 - l t_2 = math.cos(M) * math.exp((t_1 - ((m * 0.5) * (n + (m * 0.5))))) tmp = 0 if m <= -46000.0: tmp = t_2 elif m <= -4e-164: tmp = math.cos(M) * math.exp(((M * (n - M)) - (l - t_0))) elif m <= -4.7e-212: tmp = math.cos(((n * 0.5) * K)) / math.exp((n + l)) elif m <= 9.5: tmp = math.cos(((m * (0.5 * K)) - M)) * math.exp((t_1 + (M * (m - M)))) else: tmp = t_2 return tmp
function code(K, m, n, M, l) t_0 = abs(Float64(m - n)) t_1 = Float64(t_0 - l) t_2 = Float64(cos(M) * exp(Float64(t_1 - Float64(Float64(m * 0.5) * Float64(n + Float64(m * 0.5)))))) tmp = 0.0 if (m <= -46000.0) tmp = t_2; elseif (m <= -4e-164) tmp = Float64(cos(M) * exp(Float64(Float64(M * Float64(n - M)) - Float64(l - t_0)))); elseif (m <= -4.7e-212) tmp = Float64(cos(Float64(Float64(n * 0.5) * K)) / exp(Float64(n + l))); elseif (m <= 9.5) tmp = Float64(cos(Float64(Float64(m * Float64(0.5 * K)) - M)) * exp(Float64(t_1 + Float64(M * Float64(m - M))))); else tmp = t_2; end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = abs((m - n)); t_1 = t_0 - l; t_2 = cos(M) * exp((t_1 - ((m * 0.5) * (n + (m * 0.5))))); tmp = 0.0; if (m <= -46000.0) tmp = t_2; elseif (m <= -4e-164) tmp = cos(M) * exp(((M * (n - M)) - (l - t_0))); elseif (m <= -4.7e-212) tmp = cos(((n * 0.5) * K)) / exp((n + l)); elseif (m <= 9.5) tmp = cos(((m * (0.5 * K)) - M)) * exp((t_1 + (M * (m - M)))); else tmp = t_2; end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - l), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(t$95$1 - N[(N[(m * 0.5), $MachinePrecision] * N[(n + N[(m * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, -46000.0], t$95$2, If[LessEqual[m, -4e-164], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(M * N[(n - M), $MachinePrecision]), $MachinePrecision] - N[(l - t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, -4.7e-212], N[(N[Cos[N[(N[(n * 0.5), $MachinePrecision] * K), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(n + l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 9.5], N[(N[Cos[N[(N[(m * N[(0.5 * K), $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(t$95$1 + N[(M * N[(m - M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|m - n\right|\\
t_1 := t_0 - \ell\\
t_2 := \cos M \cdot e^{t_1 - \left(m \cdot 0.5\right) \cdot \left(n + m \cdot 0.5\right)}\\
\mathbf{if}\;m \leq -46000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;m \leq -4 \cdot 10^{-164}:\\
\;\;\;\;\cos M \cdot e^{M \cdot \left(n - M\right) - \left(\ell - t_0\right)}\\
\mathbf{elif}\;m \leq -4.7 \cdot 10^{-212}:\\
\;\;\;\;\frac{\cos \left(\left(n \cdot 0.5\right) \cdot K\right)}{e^{n + \ell}}\\
\mathbf{elif}\;m \leq 9.5:\\
\;\;\;\;\cos \left(m \cdot \left(0.5 \cdot K\right) - M\right) \cdot e^{t_1 + M \cdot \left(m - M\right)}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
(FPCore (K m n M l)
:precision binary64
(if (<= n 3e+15)
(*
(cos M)
(exp (+ (- (fabs (- m n)) l) (* (+ n (- (* m 0.5) M)) (- M (* m 0.5))))))
(if (<= n 7.8e+146)
(/ (cos (* (* n 0.5) K)) (exp (+ n l)))
(/ (cos M) (exp (+ (+ n l) (* M (- n M))))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= 3e+15) {
tmp = cos(M) * exp(((fabs((m - n)) - l) + ((n + ((m * 0.5) - M)) * (M - (m * 0.5)))));
} else if (n <= 7.8e+146) {
tmp = cos(((n * 0.5) * K)) / exp((n + l));
} else {
tmp = cos(M) / exp(((n + l) + (M * (n - M))));
}
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 <= 3d+15) then
tmp = cos(m_1) * exp(((abs((m - n)) - l) + ((n + ((m * 0.5d0) - m_1)) * (m_1 - (m * 0.5d0)))))
else if (n <= 7.8d+146) then
tmp = cos(((n * 0.5d0) * k)) / exp((n + l))
else
tmp = cos(m_1) / exp(((n + l) + (m_1 * (n - m_1))))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= 3e+15) {
tmp = Math.cos(M) * Math.exp(((Math.abs((m - n)) - l) + ((n + ((m * 0.5) - M)) * (M - (m * 0.5)))));
} else if (n <= 7.8e+146) {
tmp = Math.cos(((n * 0.5) * K)) / Math.exp((n + l));
} else {
tmp = Math.cos(M) / Math.exp(((n + l) + (M * (n - M))));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if n <= 3e+15: tmp = math.cos(M) * math.exp(((math.fabs((m - n)) - l) + ((n + ((m * 0.5) - M)) * (M - (m * 0.5))))) elif n <= 7.8e+146: tmp = math.cos(((n * 0.5) * K)) / math.exp((n + l)) else: tmp = math.cos(M) / math.exp(((n + l) + (M * (n - M)))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (n <= 3e+15) tmp = Float64(cos(M) * exp(Float64(Float64(abs(Float64(m - n)) - l) + Float64(Float64(n + Float64(Float64(m * 0.5) - M)) * Float64(M - Float64(m * 0.5)))))); elseif (n <= 7.8e+146) tmp = Float64(cos(Float64(Float64(n * 0.5) * K)) / exp(Float64(n + l))); else tmp = Float64(cos(M) / exp(Float64(Float64(n + l) + Float64(M * Float64(n - M))))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (n <= 3e+15) tmp = cos(M) * exp(((abs((m - n)) - l) + ((n + ((m * 0.5) - M)) * (M - (m * 0.5))))); elseif (n <= 7.8e+146) tmp = cos(((n * 0.5) * K)) / exp((n + l)); else tmp = cos(M) / exp(((n + l) + (M * (n - M)))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, 3e+15], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision] - l), $MachinePrecision] + N[(N[(n + N[(N[(m * 0.5), $MachinePrecision] - M), $MachinePrecision]), $MachinePrecision] * N[(M - N[(m * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 7.8e+146], N[(N[Cos[N[(N[(n * 0.5), $MachinePrecision] * K), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(n + l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] / N[Exp[N[(N[(n + l), $MachinePrecision] + N[(M * N[(n - M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 3 \cdot 10^{+15}:\\
\;\;\;\;\cos M \cdot e^{\left(\left|m - n\right| - \ell\right) + \left(n + \left(m \cdot 0.5 - M\right)\right) \cdot \left(M - m \cdot 0.5\right)}\\
\mathbf{elif}\;n \leq 7.8 \cdot 10^{+146}:\\
\;\;\;\;\frac{\cos \left(\left(n \cdot 0.5\right) \cdot K\right)}{e^{n + \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos M}{e^{\left(n + \ell\right) + M \cdot \left(n - M\right)}}\\
\end{array}
\end{array}
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (- (fabs (- m n)) l)))
(if (<= m -1e+42)
(* (cos M) (exp (+ t_0 (* (+ n (- (* m 0.5) M)) (- M (* m 0.5))))))
(* (cos M) (exp (+ t_0 (* (- (* n 0.5) M) (- (- M (* n 0.5)) m))))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = fabs((m - n)) - l;
double tmp;
if (m <= -1e+42) {
tmp = cos(M) * exp((t_0 + ((n + ((m * 0.5) - M)) * (M - (m * 0.5)))));
} else {
tmp = cos(M) * exp((t_0 + (((n * 0.5) - M) * ((M - (n * 0.5)) - m))));
}
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 = abs((m - n)) - l
if (m <= (-1d+42)) then
tmp = cos(m_1) * exp((t_0 + ((n + ((m * 0.5d0) - m_1)) * (m_1 - (m * 0.5d0)))))
else
tmp = cos(m_1) * exp((t_0 + (((n * 0.5d0) - m_1) * ((m_1 - (n * 0.5d0)) - m))))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double t_0 = Math.abs((m - n)) - l;
double tmp;
if (m <= -1e+42) {
tmp = Math.cos(M) * Math.exp((t_0 + ((n + ((m * 0.5) - M)) * (M - (m * 0.5)))));
} else {
tmp = Math.cos(M) * Math.exp((t_0 + (((n * 0.5) - M) * ((M - (n * 0.5)) - m))));
}
return tmp;
}
def code(K, m, n, M, l): t_0 = math.fabs((m - n)) - l tmp = 0 if m <= -1e+42: tmp = math.cos(M) * math.exp((t_0 + ((n + ((m * 0.5) - M)) * (M - (m * 0.5))))) else: tmp = math.cos(M) * math.exp((t_0 + (((n * 0.5) - M) * ((M - (n * 0.5)) - m)))) return tmp
function code(K, m, n, M, l) t_0 = Float64(abs(Float64(m - n)) - l) tmp = 0.0 if (m <= -1e+42) tmp = Float64(cos(M) * exp(Float64(t_0 + Float64(Float64(n + Float64(Float64(m * 0.5) - M)) * Float64(M - Float64(m * 0.5)))))); else tmp = Float64(cos(M) * exp(Float64(t_0 + Float64(Float64(Float64(n * 0.5) - M) * Float64(Float64(M - Float64(n * 0.5)) - m))))); end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = abs((m - n)) - l; tmp = 0.0; if (m <= -1e+42) tmp = cos(M) * exp((t_0 + ((n + ((m * 0.5) - M)) * (M - (m * 0.5))))); else tmp = cos(M) * exp((t_0 + (((n * 0.5) - M) * ((M - (n * 0.5)) - m)))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision] - l), $MachinePrecision]}, If[LessEqual[m, -1e+42], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(t$95$0 + N[(N[(n + N[(N[(m * 0.5), $MachinePrecision] - M), $MachinePrecision]), $MachinePrecision] * N[(M - N[(m * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(t$95$0 + N[(N[(N[(n * 0.5), $MachinePrecision] - M), $MachinePrecision] * N[(N[(M - N[(n * 0.5), $MachinePrecision]), $MachinePrecision] - m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|m - n\right| - \ell\\
\mathbf{if}\;m \leq -1 \cdot 10^{+42}:\\
\;\;\;\;\cos M \cdot e^{t_0 + \left(n + \left(m \cdot 0.5 - M\right)\right) \cdot \left(M - m \cdot 0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{t_0 + \left(n \cdot 0.5 - M\right) \cdot \left(\left(M - n \cdot 0.5\right) - m\right)}\\
\end{array}
\end{array}
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (+ n (- l m)))
(t_1 (* M (- n M)))
(t_2 (* (cos M) (exp (- t_1 (- l (fabs (- m n)))))))
(t_3 (cos (- (* (* (+ m n) 0.5) K) M))))
(if (<= M -1.0)
t_2
(if (<= M 3.6e-196)
(/ t_3 (exp (+ t_1 t_0)))
(if (<= M 3e+54)
(/ (cos M) (exp (+ (+ n l) t_1)))
(if (<= M 2.4e+113)
(/ t_3 (exp (+ t_0 (* n (- M (* m 0.5))))))
t_2))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = n + (l - m);
double t_1 = M * (n - M);
double t_2 = cos(M) * exp((t_1 - (l - fabs((m - n)))));
double t_3 = cos(((((m + n) * 0.5) * K) - M));
double tmp;
if (M <= -1.0) {
tmp = t_2;
} else if (M <= 3.6e-196) {
tmp = t_3 / exp((t_1 + t_0));
} else if (M <= 3e+54) {
tmp = cos(M) / exp(((n + l) + t_1));
} else if (M <= 2.4e+113) {
tmp = t_3 / exp((t_0 + (n * (M - (m * 0.5)))));
} else {
tmp = t_2;
}
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = n + (l - m)
t_1 = m_1 * (n - m_1)
t_2 = cos(m_1) * exp((t_1 - (l - abs((m - n)))))
t_3 = cos(((((m + n) * 0.5d0) * k) - m_1))
if (m_1 <= (-1.0d0)) then
tmp = t_2
else if (m_1 <= 3.6d-196) then
tmp = t_3 / exp((t_1 + t_0))
else if (m_1 <= 3d+54) then
tmp = cos(m_1) / exp(((n + l) + t_1))
else if (m_1 <= 2.4d+113) then
tmp = t_3 / exp((t_0 + (n * (m_1 - (m * 0.5d0)))))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double t_0 = n + (l - m);
double t_1 = M * (n - M);
double t_2 = Math.cos(M) * Math.exp((t_1 - (l - Math.abs((m - n)))));
double t_3 = Math.cos(((((m + n) * 0.5) * K) - M));
double tmp;
if (M <= -1.0) {
tmp = t_2;
} else if (M <= 3.6e-196) {
tmp = t_3 / Math.exp((t_1 + t_0));
} else if (M <= 3e+54) {
tmp = Math.cos(M) / Math.exp(((n + l) + t_1));
} else if (M <= 2.4e+113) {
tmp = t_3 / Math.exp((t_0 + (n * (M - (m * 0.5)))));
} else {
tmp = t_2;
}
return tmp;
}
def code(K, m, n, M, l): t_0 = n + (l - m) t_1 = M * (n - M) t_2 = math.cos(M) * math.exp((t_1 - (l - math.fabs((m - n))))) t_3 = math.cos(((((m + n) * 0.5) * K) - M)) tmp = 0 if M <= -1.0: tmp = t_2 elif M <= 3.6e-196: tmp = t_3 / math.exp((t_1 + t_0)) elif M <= 3e+54: tmp = math.cos(M) / math.exp(((n + l) + t_1)) elif M <= 2.4e+113: tmp = t_3 / math.exp((t_0 + (n * (M - (m * 0.5))))) else: tmp = t_2 return tmp
function code(K, m, n, M, l) t_0 = Float64(n + Float64(l - m)) t_1 = Float64(M * Float64(n - M)) t_2 = Float64(cos(M) * exp(Float64(t_1 - Float64(l - abs(Float64(m - n)))))) t_3 = cos(Float64(Float64(Float64(Float64(m + n) * 0.5) * K) - M)) tmp = 0.0 if (M <= -1.0) tmp = t_2; elseif (M <= 3.6e-196) tmp = Float64(t_3 / exp(Float64(t_1 + t_0))); elseif (M <= 3e+54) tmp = Float64(cos(M) / exp(Float64(Float64(n + l) + t_1))); elseif (M <= 2.4e+113) tmp = Float64(t_3 / exp(Float64(t_0 + Float64(n * Float64(M - Float64(m * 0.5)))))); else tmp = t_2; end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = n + (l - m); t_1 = M * (n - M); t_2 = cos(M) * exp((t_1 - (l - abs((m - n))))); t_3 = cos(((((m + n) * 0.5) * K) - M)); tmp = 0.0; if (M <= -1.0) tmp = t_2; elseif (M <= 3.6e-196) tmp = t_3 / exp((t_1 + t_0)); elseif (M <= 3e+54) tmp = cos(M) / exp(((n + l) + t_1)); elseif (M <= 2.4e+113) tmp = t_3 / exp((t_0 + (n * (M - (m * 0.5))))); else tmp = t_2; end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(n + N[(l - m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(M * N[(n - M), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(t$95$1 - N[(l - N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Cos[N[(N[(N[(N[(m + n), $MachinePrecision] * 0.5), $MachinePrecision] * K), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[M, -1.0], t$95$2, If[LessEqual[M, 3.6e-196], N[(t$95$3 / N[Exp[N[(t$95$1 + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 3e+54], N[(N[Cos[M], $MachinePrecision] / N[Exp[N[(N[(n + l), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 2.4e+113], N[(t$95$3 / N[Exp[N[(t$95$0 + N[(n * N[(M - N[(m * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := n + \left(\ell - m\right)\\
t_1 := M \cdot \left(n - M\right)\\
t_2 := \cos M \cdot e^{t_1 - \left(\ell - \left|m - n\right|\right)}\\
t_3 := \cos \left(\left(\left(m + n\right) \cdot 0.5\right) \cdot K - M\right)\\
\mathbf{if}\;M \leq -1:\\
\;\;\;\;t_2\\
\mathbf{elif}\;M \leq 3.6 \cdot 10^{-196}:\\
\;\;\;\;\frac{t_3}{e^{t_1 + t_0}}\\
\mathbf{elif}\;M \leq 3 \cdot 10^{+54}:\\
\;\;\;\;\frac{\cos M}{e^{\left(n + \ell\right) + t_1}}\\
\mathbf{elif}\;M \leq 2.4 \cdot 10^{+113}:\\
\;\;\;\;\frac{t_3}{e^{t_0 + n \cdot \left(M - m \cdot 0.5\right)}}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (* M (- n M)))
(t_1 (+ n (- l m)))
(t_2 (cos (- (* (* (+ m n) 0.5) K) M))))
(if (<= n -1e-57)
(/ t_2 (exp (+ t_0 t_1)))
(if (<= n 880000000.0)
(/ t_2 (exp (+ t_1 (* n (- M (* m 0.5))))))
(if (<= n 2.5e+149)
(/ (cos (* (* n 0.5) K)) (exp (+ n l)))
(/ (cos M) (exp (+ (+ n l) t_0))))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = M * (n - M);
double t_1 = n + (l - m);
double t_2 = cos(((((m + n) * 0.5) * K) - M));
double tmp;
if (n <= -1e-57) {
tmp = t_2 / exp((t_0 + t_1));
} else if (n <= 880000000.0) {
tmp = t_2 / exp((t_1 + (n * (M - (m * 0.5)))));
} else if (n <= 2.5e+149) {
tmp = cos(((n * 0.5) * K)) / exp((n + l));
} else {
tmp = cos(M) / exp(((n + l) + 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = m_1 * (n - m_1)
t_1 = n + (l - m)
t_2 = cos(((((m + n) * 0.5d0) * k) - m_1))
if (n <= (-1d-57)) then
tmp = t_2 / exp((t_0 + t_1))
else if (n <= 880000000.0d0) then
tmp = t_2 / exp((t_1 + (n * (m_1 - (m * 0.5d0)))))
else if (n <= 2.5d+149) then
tmp = cos(((n * 0.5d0) * k)) / exp((n + l))
else
tmp = cos(m_1) / exp(((n + l) + 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 = M * (n - M);
double t_1 = n + (l - m);
double t_2 = Math.cos(((((m + n) * 0.5) * K) - M));
double tmp;
if (n <= -1e-57) {
tmp = t_2 / Math.exp((t_0 + t_1));
} else if (n <= 880000000.0) {
tmp = t_2 / Math.exp((t_1 + (n * (M - (m * 0.5)))));
} else if (n <= 2.5e+149) {
tmp = Math.cos(((n * 0.5) * K)) / Math.exp((n + l));
} else {
tmp = Math.cos(M) / Math.exp(((n + l) + t_0));
}
return tmp;
}
def code(K, m, n, M, l): t_0 = M * (n - M) t_1 = n + (l - m) t_2 = math.cos(((((m + n) * 0.5) * K) - M)) tmp = 0 if n <= -1e-57: tmp = t_2 / math.exp((t_0 + t_1)) elif n <= 880000000.0: tmp = t_2 / math.exp((t_1 + (n * (M - (m * 0.5))))) elif n <= 2.5e+149: tmp = math.cos(((n * 0.5) * K)) / math.exp((n + l)) else: tmp = math.cos(M) / math.exp(((n + l) + t_0)) return tmp
function code(K, m, n, M, l) t_0 = Float64(M * Float64(n - M)) t_1 = Float64(n + Float64(l - m)) t_2 = cos(Float64(Float64(Float64(Float64(m + n) * 0.5) * K) - M)) tmp = 0.0 if (n <= -1e-57) tmp = Float64(t_2 / exp(Float64(t_0 + t_1))); elseif (n <= 880000000.0) tmp = Float64(t_2 / exp(Float64(t_1 + Float64(n * Float64(M - Float64(m * 0.5)))))); elseif (n <= 2.5e+149) tmp = Float64(cos(Float64(Float64(n * 0.5) * K)) / exp(Float64(n + l))); else tmp = Float64(cos(M) / exp(Float64(Float64(n + l) + t_0))); end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = M * (n - M); t_1 = n + (l - m); t_2 = cos(((((m + n) * 0.5) * K) - M)); tmp = 0.0; if (n <= -1e-57) tmp = t_2 / exp((t_0 + t_1)); elseif (n <= 880000000.0) tmp = t_2 / exp((t_1 + (n * (M - (m * 0.5))))); elseif (n <= 2.5e+149) tmp = cos(((n * 0.5) * K)) / exp((n + l)); else tmp = cos(M) / exp(((n + l) + t_0)); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(M * N[(n - M), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(n + N[(l - m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(N[(N[(N[(m + n), $MachinePrecision] * 0.5), $MachinePrecision] * K), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[n, -1e-57], N[(t$95$2 / N[Exp[N[(t$95$0 + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 880000000.0], N[(t$95$2 / N[Exp[N[(t$95$1 + N[(n * N[(M - N[(m * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.5e+149], N[(N[Cos[N[(N[(n * 0.5), $MachinePrecision] * K), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(n + l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] / N[Exp[N[(N[(n + l), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := M \cdot \left(n - M\right)\\
t_1 := n + \left(\ell - m\right)\\
t_2 := \cos \left(\left(\left(m + n\right) \cdot 0.5\right) \cdot K - M\right)\\
\mathbf{if}\;n \leq -1 \cdot 10^{-57}:\\
\;\;\;\;\frac{t_2}{e^{t_0 + t_1}}\\
\mathbf{elif}\;n \leq 880000000:\\
\;\;\;\;\frac{t_2}{e^{t_1 + n \cdot \left(M - m \cdot 0.5\right)}}\\
\mathbf{elif}\;n \leq 2.5 \cdot 10^{+149}:\\
\;\;\;\;\frac{\cos \left(\left(n \cdot 0.5\right) \cdot K\right)}{e^{n + \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos M}{e^{\left(n + \ell\right) + t_0}}\\
\end{array}
\end{array}
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (* M (- n M))))
(if (<= n 1.08e-218)
(/ (cos (- (* (* (+ m n) 0.5) K) M)) (exp (+ t_0 (+ n (- l m)))))
(if (<= n 2.05e+149)
(/ (cos (* (* n 0.5) K)) (exp (+ n l)))
(/ (cos M) (exp (+ (+ n l) t_0)))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = M * (n - M);
double tmp;
if (n <= 1.08e-218) {
tmp = cos(((((m + n) * 0.5) * K) - M)) / exp((t_0 + (n + (l - m))));
} else if (n <= 2.05e+149) {
tmp = cos(((n * 0.5) * K)) / exp((n + l));
} else {
tmp = cos(M) / exp(((n + l) + 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 = m_1 * (n - m_1)
if (n <= 1.08d-218) then
tmp = cos(((((m + n) * 0.5d0) * k) - m_1)) / exp((t_0 + (n + (l - m))))
else if (n <= 2.05d+149) then
tmp = cos(((n * 0.5d0) * k)) / exp((n + l))
else
tmp = cos(m_1) / exp(((n + l) + 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 = M * (n - M);
double tmp;
if (n <= 1.08e-218) {
tmp = Math.cos(((((m + n) * 0.5) * K) - M)) / Math.exp((t_0 + (n + (l - m))));
} else if (n <= 2.05e+149) {
tmp = Math.cos(((n * 0.5) * K)) / Math.exp((n + l));
} else {
tmp = Math.cos(M) / Math.exp(((n + l) + t_0));
}
return tmp;
}
def code(K, m, n, M, l): t_0 = M * (n - M) tmp = 0 if n <= 1.08e-218: tmp = math.cos(((((m + n) * 0.5) * K) - M)) / math.exp((t_0 + (n + (l - m)))) elif n <= 2.05e+149: tmp = math.cos(((n * 0.5) * K)) / math.exp((n + l)) else: tmp = math.cos(M) / math.exp(((n + l) + t_0)) return tmp
function code(K, m, n, M, l) t_0 = Float64(M * Float64(n - M)) tmp = 0.0 if (n <= 1.08e-218) tmp = Float64(cos(Float64(Float64(Float64(Float64(m + n) * 0.5) * K) - M)) / exp(Float64(t_0 + Float64(n + Float64(l - m))))); elseif (n <= 2.05e+149) tmp = Float64(cos(Float64(Float64(n * 0.5) * K)) / exp(Float64(n + l))); else tmp = Float64(cos(M) / exp(Float64(Float64(n + l) + t_0))); end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = M * (n - M); tmp = 0.0; if (n <= 1.08e-218) tmp = cos(((((m + n) * 0.5) * K) - M)) / exp((t_0 + (n + (l - m)))); elseif (n <= 2.05e+149) tmp = cos(((n * 0.5) * K)) / exp((n + l)); else tmp = cos(M) / exp(((n + l) + t_0)); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(M * N[(n - M), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, 1.08e-218], N[(N[Cos[N[(N[(N[(N[(m + n), $MachinePrecision] * 0.5), $MachinePrecision] * K), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(t$95$0 + N[(n + N[(l - m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.05e+149], N[(N[Cos[N[(N[(n * 0.5), $MachinePrecision] * K), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(n + l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] / N[Exp[N[(N[(n + l), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := M \cdot \left(n - M\right)\\
\mathbf{if}\;n \leq 1.08 \cdot 10^{-218}:\\
\;\;\;\;\frac{\cos \left(\left(\left(m + n\right) \cdot 0.5\right) \cdot K - M\right)}{e^{t_0 + \left(n + \left(\ell - m\right)\right)}}\\
\mathbf{elif}\;n \leq 2.05 \cdot 10^{+149}:\\
\;\;\;\;\frac{\cos \left(\left(n \cdot 0.5\right) \cdot K\right)}{e^{n + \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos M}{e^{\left(n + \ell\right) + t_0}}\\
\end{array}
\end{array}
(FPCore (K m n M l) :precision binary64 (if (<= l 0.18) (/ (cos (* (* n 0.5) K)) (exp (+ n l))) (exp (- l))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= 0.18) {
tmp = cos(((n * 0.5) * K)) / exp((n + l));
} else {
tmp = 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 <= 0.18d0) then
tmp = cos(((n * 0.5d0) * k)) / exp((n + l))
else
tmp = 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 <= 0.18) {
tmp = Math.cos(((n * 0.5) * K)) / Math.exp((n + l));
} else {
tmp = Math.exp(-l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if l <= 0.18: tmp = math.cos(((n * 0.5) * K)) / math.exp((n + l)) else: tmp = math.exp(-l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (l <= 0.18) tmp = Float64(cos(Float64(Float64(n * 0.5) * K)) / exp(Float64(n + l))); else tmp = exp(Float64(-l)); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (l <= 0.18) tmp = cos(((n * 0.5) * K)) / exp((n + l)); else tmp = exp(-l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[l, 0.18], N[(N[Cos[N[(N[(n * 0.5), $MachinePrecision] * K), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(n + l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Exp[(-l)], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 0.18:\\
\;\;\;\;\frac{\cos \left(\left(n \cdot 0.5\right) \cdot K\right)}{e^{n + \ell}}\\
\mathbf{else}:\\
\;\;\;\;e^{-\ell}\\
\end{array}
\end{array}
(FPCore (K m n M l) :precision binary64 (exp (- l)))
double code(double K, double m, double n, double M, double l) {
return exp(-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
code = exp(-l)
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.exp(-l);
}
def code(K, m, n, M, l): return math.exp(-l)
function code(K, m, n, M, l) return exp(Float64(-l)) end
function tmp = code(K, m, n, M, l) tmp = exp(-l); end
code[K_, m_, n_, M_, l_] := N[Exp[(-l)], $MachinePrecision]
\begin{array}{l}
\\
e^{-\ell}
\end{array}
herbie shell --seed 2024006
(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)))))))