1#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LGAMMA_STIRLING_HPP
2#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LGAMMA_STIRLING_HPP
10namespace opencl_kernels {
13static constexpr const char* lgamma_stirling_device_function
15 "#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LGAMMA_STIRLING\n"
17 "STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LGAMMA_STIRLING\n" STRINGIFY(
31 return 0.5 * (M_LN2 +
log(M_PI)) + (x - 0.5) *
log(x) - x;
double lgamma_stirling(double x)
Return the Stirling approximation to the lgamma function.
fvar< T > log(const fvar< T > &x)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...