Automatic Differentiation
 
Loading...
Searching...
No Matches
lmultiply.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LMULTIPLY_HPP
2#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LMULTIPLY_HPP
3#ifdef STAN_OPENCL
4
6#include <string>
7
8namespace stan {
9namespace math {
10namespace opencl_kernels {
11
12// \cond
13static constexpr const char* lmultiply_device_function
14 = "\n"
15 "#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LMULTIPLY\n"
16 "#define "
17 "STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LMULTIPLY\n" STRINGIFY(
18 // \endcond
28 double lmultiply(double a, double b) {
29 if (b == 0.0 && a == 0.0) {
30 return 0.0;
31 }
32 return a * log(b);
33 }
34 // \cond
35 ) "\n#endif\n"; // NOLINT
36// \endcond
37
38} // namespace opencl_kernels
39} // namespace math
40} // namespace stan
41
42#endif
43#endif
double lmultiply(double a, double b)
Return the first argument times the natural log of the second argument if either argument is non-zero...
Definition lmultiply.hpp:28
fvar< T > log(const fvar< T > &x)
Definition log.hpp:15
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
#define STRINGIFY(...)
Definition stringify.hpp:9