| Stan Math Library 2.12.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 namespace math {
9
14 const double E = boost::math::constants::e<double>();
15
20 const double SQRT_2 = std::sqrt(2.0);
21
26 const double INV_SQRT_2 = 1.0 / SQRT_2;
27
32 const double LOG_2 = std::log(2.0);
33
38 const double LOG_10 = std::log(10.0);
39
43 const double INFTY = std::numeric_limits<double>::infinity();
44
48 const double NEGATIVE_INFTY
49 = - std::numeric_limits<double>::infinity();
50
54 const double NOT_A_NUMBER
55 = std::numeric_limits<double>::quiet_NaN();
56
60 const double EPSILON = std::numeric_limits<double>::epsilon();
61
65 const double NEGATIVE_EPSILON
66 = - std::numeric_limits<double>::epsilon();
67
71 const double POISSON_MAX_RATE = std::pow(2.0, 30);
72
77 const double LOG_PI_OVER_FOUR
78 = std::log(boost::math::constants::pi<double>()) / 4.0;
79
85 inline double pi() {
86 return boost::math::constants::pi<double>();
87 }
88
94 inline double e() {
95 return E;
96 }
97
103 inline double sqrt2() {
104 return SQRT_2;
105 }
106
112 inline double log10() {
113 return LOG_10;
114 }
115
121 inline double positive_infinity() {
122 return INFTY;
123 }
124
130 inline double negative_infinity() {
131 return NEGATIVE_INFTY;
132 }
133
139 inline double not_a_number() {
140 return NOT_A_NUMBER;
141 }
142
149 inline double machine_precision() {
150 return EPSILON;
151 }
152
153 const double SQRT_PI
154 = std::sqrt(boost::math::constants::pi<double>());
155
156 const double SQRT_2_TIMES_SQRT_PI = SQRT_2 * SQRT_PI;
157
158 const double TWO_OVER_SQRT_PI
159 = 2.0 / SQRT_PI;
160
161 const double NEG_TWO_OVER_SQRT_PI = -TWO_OVER_SQRT_PI;
162
163 const double INV_SQRT_TWO_PI
164 = 1.0 / std::sqrt(2.0 * boost::math::constants::pi<double>());
165
166 const double LOG_PI
167 = std::log(boost::math::constants::pi<double>());
168
169 const double LOG_SQRT_PI
170 = std::log(SQRT_PI);
171
172 const double LOG_ZERO = std::log(0.0);
173
174 const double LOG_TWO = std::log(2.0);
175
176 const double LOG_HALF = std::log(0.5);
177
178 const double NEG_LOG_TWO = - LOG_TWO;
179
180 const double NEG_LOG_SQRT_TWO_PI
181 = - std::log(std::sqrt(2.0 * boost::math::constants::pi<double>()));
182
183 const double NEG_LOG_PI = - LOG_PI;
184
185 const double NEG_LOG_SQRT_PI
186 = -std::log(std::sqrt(boost::math::constants::pi<double>()));
187
188 const double NEG_LOG_TWO_OVER_TWO = - LOG_TWO / 2.0;
189
190 const double LOG_TWO_PI = LOG_TWO + LOG_PI;
191
192 const double NEG_LOG_TWO_PI = - LOG_TWO_PI;
193
194 }
195 }
196
197 #endif
stan::math::LOG_2
const double LOG_2
The natural logarithm of 2, .
Definition: constants.hpp:32
stan::math::NEG_LOG_PI
const double NEG_LOG_PI
Definition: constants.hpp:183
stan::math::LOG_HALF
const double LOG_HALF
Definition: constants.hpp:176
stan::math::INV_SQRT_TWO_PI
const double INV_SQRT_TWO_PI
Definition: constants.hpp:164
stan::math::sqrt
fvar< T > sqrt(const fvar< T > &x)
Definition: sqrt.hpp:14
stan::math::NOT_A_NUMBER
const double NOT_A_NUMBER
(Quiet) not-a-number value.
Definition: constants.hpp:55
stan
Definition: log_sum_exp.hpp:8
stan::math::LOG_PI
const double LOG_PI
Definition: constants.hpp:167
stan::math::log
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:14
stan::math::NEG_LOG_SQRT_PI
const double NEG_LOG_SQRT_PI
Definition: constants.hpp:186
stan::math::LOG_SQRT_PI
const double LOG_SQRT_PI
Definition: constants.hpp:170
stan::math::LOG_10
const double LOG_10
The natural logarithm of 10, .
Definition: constants.hpp:38
stan::math::log10
fvar< T > log10(const fvar< T > &x)
Definition: log10.hpp:13
stan::math::LOG_ZERO
const double LOG_ZERO
Definition: constants.hpp:172
stan::math::LOG_TWO
const double LOG_TWO
Definition: constants.hpp:174
stan::math::LOG_TWO_PI
const double LOG_TWO_PI
Definition: constants.hpp:190
stan::math::sqrt2
double sqrt2()
Return the square root of two.
Definition: constants.hpp:103
stan::math::TWO_OVER_SQRT_PI
const double TWO_OVER_SQRT_PI
Definition: constants.hpp:159
stan::math::SQRT_2_TIMES_SQRT_PI
const double SQRT_2_TIMES_SQRT_PI
Definition: constants.hpp:156
stan::math::SQRT_2
const double SQRT_2
The value of the square root of 2, .
Definition: constants.hpp:20
stan::math::INV_SQRT_2
const double INV_SQRT_2
The value of 1 over the square root of 2, .
Definition: constants.hpp:26
stan::math::EPSILON
const double EPSILON
Smallest positive value.
Definition: constants.hpp:60
stan::math::LOG_PI_OVER_FOUR
const double LOG_PI_OVER_FOUR
Log pi divided by 4 .
Definition: constants.hpp:78
stan::math::machine_precision
double machine_precision()
Returns the difference between 1.0 and the next value representable.
Definition: constants.hpp:149
stan::math::NEG_TWO_OVER_SQRT_PI
const double NEG_TWO_OVER_SQRT_PI
Definition: constants.hpp:161
stan::math::POISSON_MAX_RATE
const double POISSON_MAX_RATE
Largest rate parameter allowed in Poisson RNG.
Definition: constants.hpp:71
stan::math::NEG_LOG_SQRT_TWO_PI
const double NEG_LOG_SQRT_TWO_PI
Definition: constants.hpp:181
stan::math::positive_infinity
double positive_infinity()
Return positive infinity.
Definition: constants.hpp:121
stan::math::e
double e()
Return the base of the natural logarithm.
Definition: constants.hpp:94
stan::math::E
const double E
The base of the natural logarithm, .
Definition: constants.hpp:14
stan::math::NEG_LOG_TWO
const double NEG_LOG_TWO
Definition: constants.hpp:178
stan::math::NEG_LOG_TWO_PI
const double NEG_LOG_TWO_PI
Definition: constants.hpp:192
stan::math::NEG_LOG_TWO_OVER_TWO
const double NEG_LOG_TWO_OVER_TWO
Definition: constants.hpp:188
stan::math::INFTY
const double INFTY
Positive infinity.
Definition: constants.hpp:43
stan::math::pi
double pi()
Return the value of pi.
Definition: constants.hpp:85
stan::math::pow
fvar< T > pow(const fvar< T > &x1, const fvar< T > &x2)
Definition: pow.hpp:17
stan::math::not_a_number
double not_a_number()
Return (quiet) not-a-number.
Definition: constants.hpp:139
stan::math::NEGATIVE_INFTY
const double NEGATIVE_INFTY
Negative infinity.
Definition: constants.hpp:49
stan::math::NEGATIVE_EPSILON
const double NEGATIVE_EPSILON
Largest negative value (i.e., smallest absolute value).
Definition: constants.hpp:66
stan::math::SQRT_PI
const double SQRT_PI
Definition: constants.hpp:154
stan::math::negative_infinity
double negative_infinity()
Return negative infinity.
Definition: constants.hpp:130

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