1#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_INV_LOGIT_HPP
2#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_INV_LOGIT_HPP
10namespace opencl_kernels {
13static constexpr const char* inv_logit_device_function
15 "#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_INV_LOGIT\n"
16 "#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_INV_LOGIT\n" STRINGIFY(
59 if (x <
log(DBL_EPSILON)) {
62 return exp(x) / (1 +
exp(x));
64 return 1.0 / (1 +
exp(-x));
double inv_logit(double x)
Returns the inverse logit function applied to the kernel generator expression.
fvar< T > log(const fvar< T > &x)
fvar< T > exp(const fvar< T > &x)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...