Automatic Differentiation
 
Loading...
Searching...
No Matches
inc_beta.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_INC_BETA_HPP
2#define STAN_MATH_PRIM_FUN_INC_BETA_HPP
3
8#include <boost/math/special_functions/beta.hpp>
9
10namespace stan {
11namespace math {
12
25inline double inc_beta(double a, double b, double x) {
26 check_not_nan("inc_beta", "a", a);
27 check_not_nan("inc_beta", "b", b);
28 check_not_nan("inc_beta", "x", x);
29 return boost::math::ibeta(a, b, x, boost_policy_t<>());
30}
31
44template <typename T1, typename T2, typename T3,
47inline auto inc_beta(const T1& a, const T2& b, const T3& c) {
48 return apply_scalar_ternary([](const auto& d, const auto& e,
49 const auto& f) { return inc_beta(d, e, f); },
50 a, b, c);
51}
52
53} // namespace math
54} // namespace stan
55#endif
require_any_t< is_container< std::decay_t< Types > >... > require_any_container_t
Require any of the types satisfy is_container.
require_all_not_t< is_var_matrix< std::decay_t< Types > >... > require_all_not_var_matrix_t
Require none of the types satisfy is_var_matrix.
static constexpr double e()
Return the base of the natural logarithm.
Definition constants.hpp:20
fvar< T > inc_beta(const fvar< T > &a, const fvar< T > &b, const fvar< T > &x)
Definition inc_beta.hpp:19
void check_not_nan(const char *function, const char *name, const T_y &y)
Check if y is not NaN.
auto apply_scalar_ternary(const F &f, const T1 &x, const T2 &y, const T3 &z)
Base template function for vectorization of ternary scalar functions defined by applying a functor to...
boost::math::policies::policy< boost::math::policies::overflow_error< boost::math::policies::errno_on_error >, boost::math::policies::pole_error< boost::math::policies::errno_on_error >, boost::math::policies::promote_double< false >, boost::math::policies::digits2< B > > boost_policy_t
Boost policy that overrides the defaults to match the built-in C++ standard library functions.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...