Stan Math Library  2.20.0
reverse mode automatic differentiation
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 
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
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.
fvar< T > log1p(const fvar< T > &x)
Definition: log1p.hpp:12
int is_nan(const fvar< T > &x)
Returns 1 if the input&#39;s value is NaN and 0 otherwise.
Definition: is_nan.hpp:20
fvar< T > log1m(const fvar< T > &x)
Definition: log1m.hpp:12

     [ Stan Home Page ] © 2011–2018, Stan Development Team.