Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
stirling_coefficients.hpp
Go to the documentation of this file.
1#pragma once
2#include <array>
3#include <cstddef>
4
5namespace uni20::detail
6{
7// B_(2k)/(2k*(2k-1)), k=1..16. Keep numerator/denominator conversion in R;
8// no binary64 literal or MPFR dependency enters fixed-precision callers.
9template <class R> constexpr std::array<R, 16> native_stirling_coefficients()
10{
11 return {{
12 R(1LL) / R(12LL),
13 R(-1LL) / R(360LL),
14 R(1LL) / R(1260LL),
15 R(-1LL) / R(1680LL),
16 R(1LL) / R(1188LL),
17 R(-691LL) / R(360360LL),
18 R(1LL) / R(156LL),
19 R(-3617LL) / R(122400LL),
20 R(43867LL) / R(244188LL),
21 R(-174611LL) / R(125400LL),
22 R(77683LL) / R(5796LL),
23 R(-236364091LL) / R(1506960LL),
24 R(657931LL) / R(300LL),
25 R(-3392780147LL) / R(93960LL),
26 R(1723168255201LL) / R(2492028LL),
27 R(-7709321041217LL) / R(505920LL),
28 }};
29}
30} // namespace uni20::detail