Automatic Differentiation
 
Loading...
Searching...
No Matches
multiply_log.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_MULTIPLY_LOG_HPP
2#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_MULTIPLY_LOG_HPP
3#ifdef STAN_OPENCL
4
6#include <string>
7
8namespace stan {
9namespace math {
10namespace opencl_kernels {
11
12// \cond
13static constexpr const char* multiply_log_device_function
14 = "\n"
15 "#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_MULTIPLY_LOG\n"
16 "#define "
17 "STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_MULTIPLY_LOG\n" STRINGIFY(
18 // \endcond
57 double multiply_log(double a, double b) {
58 if (b == 0.0 && a == 0.0) {
59 return 0.0;
60 }
61 return a * log(b);
62 }
63 // \cond
64 ) "\n#endif\n"; // NOLINT
65// \endcond
66
67} // namespace opencl_kernels
68} // namespace math
69} // namespace stan
70
71#endif
72#endif
double multiply_log(double a, double b)
Calculate the value of the first argument times log of the second argument while behaving properly wi...
fvar< T > log(const fvar< T > &x)
Definition log.hpp:18
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
#define STRINGIFY(...)
Definition stringify.hpp:9