1#ifndef STAN_MATH_PRIM_FUN_LOG_HPP
2#define STAN_MATH_PRIM_FUN_LOG_HPP
26template <
typename T, require_arithmetic_t<T>* =
nullptr>
27inline auto log(
const T x) {
38template <
typename T, require_complex_t<T>* =
nullptr>
39inline auto log(
const T x) {
55 static inline auto fun(
const T& x) {
69template <
typename Container, require_ad_container_t<Container>* =
nullptr>
70inline auto log(
const Container& x) {
82template <
typename Container,
84inline auto log(
const Container& x) {
85 return apply_vector_unary<Container>::apply(
86 x, [](
const auto& v) {
return v.array().
log(); });
105 return {
log(r), theta};
require_t< container_type_check_base< is_container, base_type_t, TypeCheck, Check... > > require_container_bt
Require type satisfies is_container.
std::complex< V > complex_log(const std::complex< V > &z)
Return the natural logarithm of the complex argument.
static constexpr double NOT_A_NUMBER
(Quiet) not-a-number value.
bool is_nan(T &&x)
Returns 1 if the input's value is NaN and 0 otherwise.
fvar< T > norm(const std::complex< fvar< T > > &z)
Return the squared magnitude of the complex argument.
fvar< T > arg(const std::complex< fvar< T > > &z)
Return the phase angle of the complex argument.
fvar< T > log(const fvar< T > &x)
fvar< T > sqrt(const fvar< T > &x)
int is_inf(const fvar< T > &x)
Returns 1 if the input's value is infinite and 0 otherwise.
static constexpr double INFTY
Positive infinity.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Base template class for vectorization of unary scalar functions defined by a template class F to a sc...
static auto fun(const T &x)
Return natural log of specified argument.
Structure to wrap log() so that it can be vectorized.