| Stan Math Library 2.11.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

constants.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_FUN_CONSTANTS_HPP
2 #define STAN_MATH_PRIM_SCAL_FUN_CONSTANTS_HPP
3
4 #include <boost/math/constants/constants.hpp>
5 #include <limits>
6
7 namespace stan {
8
9 namespace math {
10
15 const double E = boost::math::constants::e<double>();
16
21 const double SQRT_2 = std::sqrt(2.0);
22
27 const double INV_SQRT_2 = 1.0 / SQRT_2;
28
33 const double LOG_2 = std::log(2.0);
34
39 const double LOG_10 = std::log(10.0);
40
44 const double INFTY = std::numeric_limits<double>::infinity();
45
49 const double NEGATIVE_INFTY
50 = - std::numeric_limits<double>::infinity();
51
55 const double NOT_A_NUMBER
56 = std::numeric_limits<double>::quiet_NaN();
57
61 const double EPSILON = std::numeric_limits<double>::epsilon();
62
66 const double NEGATIVE_EPSILON
67 = - std::numeric_limits<double>::epsilon();
68
72 const double POISSON_MAX_RATE = std::pow(2.0, 30);
73
78 const double LOG_PI_OVER_FOUR
79 = std::log(boost::math::constants::pi<double>()) / 4.0;
80
86 inline double pi() {
87 return boost::math::constants::pi<double>();
88 }
89
95 inline double e() {
96 return E;
97 }
98
104 inline double sqrt2() {
105 return SQRT_2;
106 }
107
108
114 inline double log10() {
115 return LOG_10;
116 }
117
123 inline double positive_infinity() {
124 return INFTY;
125 }
126
132 inline double negative_infinity() {
133 return NEGATIVE_INFTY;
134 }
135
141 inline double not_a_number() {
142 return NOT_A_NUMBER;
143 }
144
151 inline double machine_precision() {
152 return EPSILON;
153 }
154
155 const double SQRT_PI
156 = std::sqrt(boost::math::constants::pi<double>());
157
158 const double SQRT_2_TIMES_SQRT_PI = SQRT_2 * SQRT_PI;
159
160 const double TWO_OVER_SQRT_PI
161 = 2.0 / SQRT_PI;
162
163 const double NEG_TWO_OVER_SQRT_PI = -TWO_OVER_SQRT_PI;
164
165 const double INV_SQRT_TWO_PI
166 = 1.0 / std::sqrt(2.0 * boost::math::constants::pi<double>());
167
168
169 const double LOG_PI
170 = std::log(boost::math::constants::pi<double>());
171
172 const double LOG_SQRT_PI
173 = std::log(SQRT_PI);
174
175 const double LOG_ZERO = std::log(0.0);
176
177 const double LOG_TWO = std::log(2.0);
178
179 const double LOG_HALF = std::log(0.5);
180
181 const double NEG_LOG_TWO = - LOG_TWO;
182
183 const double NEG_LOG_SQRT_TWO_PI
184 = - std::log(std::sqrt(2.0 * boost::math::constants::pi<double>()));
185
186 const double NEG_LOG_PI = - LOG_PI;
187
188 const double NEG_LOG_SQRT_PI
189 = -std::log(std::sqrt(boost::math::constants::pi<double>()));
190
191 const double NEG_LOG_TWO_OVER_TWO = - LOG_TWO / 2.0;
192
193 const double LOG_TWO_PI = LOG_TWO + LOG_PI;
194
195 const double NEG_LOG_TWO_PI = - LOG_TWO_PI;
196
197 }
198 }
199
200 #endif
stan::math::LOG_2
const double LOG_2
The natural logarithm of 2, .
Definition: constants.hpp:33
stan::math::NEG_LOG_PI
const double NEG_LOG_PI
Definition: constants.hpp:186
stan::math::LOG_HALF
const double LOG_HALF
Definition: constants.hpp:179
stan::math::INV_SQRT_TWO_PI
const double INV_SQRT_TWO_PI
Definition: constants.hpp:166
stan::math::sqrt
fvar< T > sqrt(const fvar< T > &x)
Definition: sqrt.hpp:15
stan::math::NOT_A_NUMBER
const double NOT_A_NUMBER
(Quiet) not-a-number value.
Definition: constants.hpp:56
stan
Definition: log_sum_exp.hpp:8
stan::math::LOG_PI
const double LOG_PI
Definition: constants.hpp:170
stan::math::log
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:15
stan::math::NEG_LOG_SQRT_PI
const double NEG_LOG_SQRT_PI
Definition: constants.hpp:189
stan::math::LOG_SQRT_PI
const double LOG_SQRT_PI
Definition: constants.hpp:173
stan::math::LOG_10
const double LOG_10
The natural logarithm of 10, .
Definition: constants.hpp:39
stan::math::log10
fvar< T > log10(const fvar< T > &x)
Definition: log10.hpp:15
stan::math::LOG_ZERO
const double LOG_ZERO
Definition: constants.hpp:175
stan::math::LOG_TWO
const double LOG_TWO
Definition: constants.hpp:177
stan::math::LOG_TWO_PI
const double LOG_TWO_PI
Definition: constants.hpp:193
stan::math::sqrt2
double sqrt2()
Return the square root of two.
Definition: constants.hpp:104
stan::math::TWO_OVER_SQRT_PI
const double TWO_OVER_SQRT_PI
Definition: constants.hpp:161
stan::math::SQRT_2_TIMES_SQRT_PI
const double SQRT_2_TIMES_SQRT_PI
Definition: constants.hpp:158
stan::math::SQRT_2
const double SQRT_2
The value of the square root of 2, .
Definition: constants.hpp:21
stan::math::INV_SQRT_2
const double INV_SQRT_2
The value of 1 over the square root of 2, .
Definition: constants.hpp:27
stan::math::EPSILON
const double EPSILON
Smallest positive value.
Definition: constants.hpp:61
stan::math::LOG_PI_OVER_FOUR
const double LOG_PI_OVER_FOUR
Log pi divided by 4 .
Definition: constants.hpp:79
stan::math::machine_precision
double machine_precision()
Returns the difference between 1.0 and the next value representable.
Definition: constants.hpp:151
stan::math::NEG_TWO_OVER_SQRT_PI
const double NEG_TWO_OVER_SQRT_PI
Definition: constants.hpp:163
stan::math::POISSON_MAX_RATE
const double POISSON_MAX_RATE
Largest rate parameter allowed in Poisson RNG.
Definition: constants.hpp:72
stan::math::NEG_LOG_SQRT_TWO_PI
const double NEG_LOG_SQRT_TWO_PI
Definition: constants.hpp:184
stan::math::positive_infinity
double positive_infinity()
Return positive infinity.
Definition: constants.hpp:123
stan::math::e
double e()
Return the base of the natural logarithm.
Definition: constants.hpp:95
stan::math::E
const double E
The base of the natural logarithm, .
Definition: constants.hpp:15
stan::math::NEG_LOG_TWO
const double NEG_LOG_TWO
Definition: constants.hpp:181
stan::math::NEG_LOG_TWO_PI
const double NEG_LOG_TWO_PI
Definition: constants.hpp:195
stan::math::NEG_LOG_TWO_OVER_TWO
const double NEG_LOG_TWO_OVER_TWO
Definition: constants.hpp:191
stan::math::INFTY
const double INFTY
Positive infinity.
Definition: constants.hpp:44
stan::math::pi
double pi()
Return the value of pi.
Definition: constants.hpp:86
stan::math::pow
fvar< T > pow(const fvar< T > &x1, const fvar< T > &x2)
Definition: pow.hpp:18
stan::math::not_a_number
double not_a_number()
Return (quiet) not-a-number.
Definition: constants.hpp:141
stan::math::NEGATIVE_INFTY
const double NEGATIVE_INFTY
Negative infinity.
Definition: constants.hpp:50
stan::math::NEGATIVE_EPSILON
const double NEGATIVE_EPSILON
Largest negative value (i.e., smallest absolute value).
Definition: constants.hpp:67
stan::math::SQRT_PI
const double SQRT_PI
Definition: constants.hpp:156
stan::math::negative_infinity
double negative_infinity()
Return negative infinity.
Definition: constants.hpp:132

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