1#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_PHI_HPP
2#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_PHI_HPP
10namespace opencl_kernels {
12static constexpr const char* phi_device_function
14 "#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_PHI\n"
15 "#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_PHI\n" STRINGIFY(
23 inline double Phi(
double x) {
26 }
else if (x < -5.0) {
27 return 0.5 *
erfc(-M_SQRT1_2 * x);
28 }
else if (x > 8.25) {
31 return 0.5 * (1.0 +
erf(M_SQRT1_2 * x));
double Phi(double x)
Return the Phi function applied to the specified argument.
fvar< T > erf(const fvar< T > &x)
fvar< T > erfc(const fvar< T > &x)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...