Automatic Differentiation
 
Loading...
Searching...
No Matches
constants.hpp File Reference
#include <stan/math/prim/meta.hpp>
#include <stan/math/prim/fun/inv.hpp>
#include <boost/math/constants/constants.hpp>
#include <cmath>
#include <limits>

Go to the source code of this file.

Namespaces

namespace  stan
 The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation from C or the boost::math::lgamma implementation.
 
namespace  stan::math
 Matrices and templated mathematical functions.
 

Functions

static constexpr double stan::math::e ()
 Return the base of the natural logarithm.
 
static constexpr double stan::math::egamma ()
 Return the Euler's gamma constant.
 
static constexpr double stan::math::pi ()
 Return the value of pi.
 
static constexpr double stan::math::positive_infinity ()
 Return positive infinity.
 
static constexpr double stan::math::negative_infinity ()
 Return negative infinity.
 
static constexpr double stan::math::not_a_number ()
 Return (quiet) not-a-number.
 
static constexpr double stan::math::machine_precision ()
 Returns the difference between 1.0 and the next value representable.
 
static constexpr double stan::math::log10 ()
 Returns the natural logarithm of ten.
 
static constexpr double stan::math::sqrt2 ()
 Returns the square root of two.
 

Variables

static constexpr double stan::math::EPSILON = std::numeric_limits<double>::epsilon()
 Smallest positive value.
 
static constexpr double stan::math::INFTY = std::numeric_limits<double>::infinity()
 Positive infinity.
 
static constexpr double stan::math::NEGATIVE_INFTY = -INFTY
 Negative infinity.
 
static constexpr double stan::math::NOT_A_NUMBER = std::numeric_limits<double>::quiet_NaN()
 (Quiet) not-a-number value.
 
static constexpr double stan::math::TWO_PI = boost::math::constants::two_pi<double>()
 Twice the value of \( \pi \), \( 2\pi \).
 
static constexpr double stan::math::LOG_ZERO = -INFTY
 The natural logarithm of 0, \( \log 0 \).
 
const double stan::math::LOG_EPSILON = std::log(EPSILON)
 The natural logarithm of machine precision \( \epsilon \), \( \log \epsilon \).
 
static constexpr double stan::math::LOG_TWO = boost::math::constants::ln_two<double>()
 The natural logarithm of 2, \( \log 2 \).
 
static constexpr double stan::math::LOG_PI = 1.14472988584940017414342735135
 The natural logarithm of \( \pi \), \( \log \pi \).
 
static constexpr double stan::math::LOG_HALF = -LOG_TWO
 The natural logarithm of 0.5, \( \log 0.5 = \log 1 - \log 2 \).
 
static constexpr double stan::math::LOG_TWO_PI = LOG_TWO + LOG_PI
 The natural logarithm of 2 plus the natural logarithm of \( \pi \), \( \log(2\pi) \).
 
static constexpr double stan::math::LOG_PI_OVER_FOUR = 0.25 * LOG_PI
 The value of one quarter the natural logarithm of \( \pi \), \( \log(\pi) / 4 \).
 
static constexpr double stan::math::LOG_SQRT_PI = LOG_PI / 2
 The natural logarithm of the square root of \( \pi \), \( \log(sqrt{\pi}) \).
 
static constexpr double stan::math::LOG_TEN = boost::math::constants::ln_ten<double>()
 The natural logarithm of 10, \( \log 10 \).
 
static constexpr double stan::math::SQRT_TWO = boost::math::constants::root_two<double>()
 The value of the square root of 2, \( \sqrt{2} \).
 
static constexpr double stan::math::SQRT_PI = boost::math::constants::root_pi<double>()
 The value of the square root of \( \pi \), \( \sqrt{\pi} \).
 
static constexpr double stan::math::SQRT_TWO_PI = boost::math::constants::root_two_pi<double>()
 The value of the square root of \( 2\pi \), \( \sqrt{2\pi} \).
 
static constexpr double stan::math::SQRT_TWO_OVER_SQRT_PI = SQRT_TWO / SQRT_PI
 The square root of 2 divided by the square root of \( \pi \), \( \sqrt{2} / \sqrt{\pi} \).
 
static constexpr double stan::math::INV_SQRT_TWO = boost::math::constants::one_div_root_two<double>()
 The value of 1 over the square root of 2, \( 1 / \sqrt{2} \).
 
static constexpr double stan::math::INV_SQRT_PI = boost::math::constants::one_div_root_pi<double>()
 The value of 1 over the square root of \( \pi \), \( 1 / \sqrt{\pi} \).
 
static constexpr double stan::math::INV_SQRT_TWO_PI = boost::math::constants::one_div_root_two_pi<double>()
 The value of 1 over the square root of \( 2\pi \), \( 1 / \sqrt{2\pi} \).
 
static constexpr double stan::math::TWO_OVER_SQRT_PI = boost::math::constants::two_div_root_pi<double>()
 The value of 2 over the square root of \( \pi \), \( 2 / \sqrt{\pi} \).
 
static constexpr double stan::math::HALF_LOG_TWO = 0.5 * LOG_TWO
 The value of half the natural logarithm 2, \( \log(2) / 2 \).
 
static constexpr double stan::math::HALF_LOG_TWO_PI = 0.5 * LOG_TWO_PI
 The value of half the natural logarithm \( 2\pi \), \( \log(2\pi) / 2 \).
 
const double stan::math::NEG_LOG_SQRT_TWO_PI = -std::log(SQRT_TWO_PI)
 The value of minus the natural logarithm of the square root of \( 2\pi \), \( -\log(\sqrt{2\pi}) \).
 
const double stan::math::POISSON_MAX_RATE = std::pow(2.0, 30)
 Largest rate parameter allowed in Poisson RNG.