Stan  1.0
probability, sampling & optimization
constants.hpp
Go to the documentation of this file.
1 #ifndef __STAN__PROB__DISTRIBUTIONS_CONSTANTS_HPP__
2 #define __STAN__PROB__DISTRIBUTIONS_CONSTANTS_HPP__
3 
4 #include <boost/math/constants/constants.hpp>
5 
6 namespace stan {
7 
8  namespace prob {
9 
10 
11  namespace {
12 
13  const double LOG_PI = std::log(boost::math::constants::pi<double>());
14 
15  const double LOG_ZERO = std::log(0.0);
16 
17  const double LOG_TWO = std::log(2.0);
18 
19  const double NEG_LOG_TWO = - LOG_TWO;
20 
21  const double NEG_LOG_SQRT_TWO_PI
22  = - std::log(std::sqrt(2.0 * boost::math::constants::pi<double>()));
23 
24  const double NEG_LOG_PI = - LOG_PI;
25 
26  const double NEG_LOG_SQRT_PI
27  = -std::log(std::sqrt(boost::math::constants::pi<double>()));
28 
29  const double NEG_LOG_TWO_OVER_TWO = - LOG_TWO / 2.0;
30 
31  const double SQRT_2 = std::sqrt(2.0);
32 
33  }
34 
35  }
36 
37 }
38 
39 #endif
var sqrt(const var &a)
Return the square root of the specified variable (cmath).
Definition: agrad.hpp:1761
var log(const var &a)
Return the natural log of the specified variable (cmath).
Definition: agrad.hpp:1730
const double SQRT_2
The value of the square root of 2, .
Definition: constants.hpp:20
Probability, optimization and sampling library.
Definition: agrad.cpp:6

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