6namespace uni20::detail::native_math
11template <NativeReal R> R stirling_correction(R inverse)
13 constexpr int bits = numeric_limits<R>::digits();
14 constexpr int terms = bits <= 24 ? 4 : bits <= 53 ? 8 : bits <= 64 ? 10 : 16;
15 constexpr auto coefficients = uni20::detail::native_stirling_coefficients<R>();
16 R
square = inverse * inverse, result = coefficients[terms - 1];
17 for (
int k = terms - 2; k >= 0; --k)
18 result = std::fma(result,
square, coefficients[k]);
19 return inverse * result;
AsyncTask square(ReadBuffer< int > in, WriteBuffer< int > out)
Definition async_tbb_reduction_example.cpp:39