Stan Math Library
2.20.0
reverse mode automatic differentiation
stan
math
prim
scal
fun
log1m.hpp
Go to the documentation of this file.
1
#ifndef STAN_MATH_PRIM_SCAL_FUN_LOG1M_HPP
2
#define STAN_MATH_PRIM_SCAL_FUN_LOG1M_HPP
3
4
#include <
stan/math/prim/meta.hpp
>
5
#include <
stan/math/prim/scal/fun/log1p.hpp
>
6
#include <
stan/math/prim/scal/fun/is_nan.hpp
>
7
#include <
stan/math/prim/scal/err/check_less_or_equal.hpp
>
8
9
namespace
stan
{
10
namespace
math {
11
42
inline
double
log1m
(
double
x) {
43
if
(!
is_nan
(x))
44
check_less_or_equal
(
"log1m"
,
"x"
, x, 1);
45
return
stan::math::log1p
(-x);
46
}
47
48
}
// namespace math
49
}
// namespace stan
50
51
#endif
stan::math::check_less_or_equal
void check_less_or_equal(const char *function, const char *name, const T_y &y, const T_high &high)
Check if y is less or equal to high.
Definition:
check_less_or_equal.hpp:62
is_nan.hpp
stan
Definition:
log_sum_exp.hpp:8
meta.hpp
check_less_or_equal.hpp
stan::math::log1p
fvar< T > log1p(const fvar< T > &x)
Definition:
log1p.hpp:12
log1p.hpp
stan::math::is_nan
int is_nan(const fvar< T > &x)
Returns 1 if the input's value is NaN and 0 otherwise.
Definition:
is_nan.hpp:20
stan::math::log1m
fvar< T > log1m(const fvar< T > &x)
Definition:
log1m.hpp:12
[
Stan Home Page
]
© 2011–2018, Stan Development Team.