1#ifndef STAN_MATH_REV_FUNCTOR_INTEGRATE_1D_DOUBLE_EXPONENTIAL_HPP
2#define STAN_MATH_REV_FUNCTOR_INTEGRATE_1D_DOUBLE_EXPONENTIAL_HPP
38template <
typename F,
typename T_a,
typename T_b,
typename... Args,
41 const F &f,
const T_a &a,
const T_b &b,
double relative_tolerance,
42 double absolute_tolerance,
int max_refinements, std::ostream *msgs,
43 const Args &... args) {
44 static constexpr const char *function =
"integrate_1d_double_exponential";
50 [&](
auto &&integrand) {
51 return integrate_de(std::forward<
decltype(integrand)>(integrand),
53 absolute_tolerance, max_refinements);
87template <
typename F,
typename T_a,
typename T_b,
typename... Args,
90 const F &f,
const T_a &a,
const T_b &b, std::ostream *msgs,
91 const Args &... args) {
93 f, a, b, std::sqrt(
EPSILON), 0.0,
typename return_type< Ts... >::type return_type_t
Convenience type for the return type of the specified template parameters.
require_any_t< is_var< scalar_type_t< std::decay_t< Types > > >... > require_any_st_var
Require any of the scalar types satisfy is_var.
return_type_t< T_a, T_b, Args... > integrate_1d_adjoint(const char *function, const F &f, const T_a &a, const T_b &b, Integrator &&integrator, std::ostream *msgs, const Args &... args)
Build the reverse-mode result of a one-dimensional adaptive quadrature.
void check_less_or_equal(const char *function, const char *name, const T_y &y, const T_high &high, Idxs... idxs)
Throw an exception if y is not less than high.
void check_nonnegative(const char *function, const char *name, const T_y &y)
Check if y is non-negative.
static constexpr double EPSILON
Smallest positive value.
T value_of(const fvar< T > &v)
Return the value of the specified variable.
return_type_t< T_a, T_b, Args... > integrate_1d_double_exponential_tol(const F &f, const T_a &a, const T_b &b, double relative_tolerance, double absolute_tolerance, int max_refinements, std::ostream *msgs, const Args &... args)
Return the integral of f from a to b using adaptive double-exponential quadrature,...
double integrate_1d_double_exponential(const F &f, double a, double b, std::ostream *msgs, const Args &... args)
Compute the integral of the single variable function f from a to b using adaptive double-exponential ...
double integrate_de(const F &f, double a, double b, double relative_tolerance, double absolute_tolerance, int max_refinements)
Integrate a single variable function f from a to b using Boost's adaptive double-exponential quadratu...
constexpr int INTEGRATE_1D_DOUBLE_EXPONENTIAL_MAX_REFINEMENTS
Default maximum refinement count used by integrate_1d_double_exponential when the user does not pass ...
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...