Automatic Differentiation
 
Loading...
Searching...
No Matches
erfcx.hpp File Reference
#include <stan/math/prim/meta.hpp>
#include <stan/math/prim/fun/constants.hpp>
#include <stan/math/prim/functor/apply_scalar_unary.hpp>
#include <array>
#include <cmath>
#include <cstddef>
#include <utility>

Go to the source code of this file.

Classes

struct  stan::math::erfcx_fun
 Structure to wrap erfcx() so that it can be vectorized. More...
 

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.
 
namespace  stan::math::internal
 A comparator that works for any container type that has the brackets operator.
 

Functions

template<std::size_t N, typename T , typename It >
std::pair< T, T > stan::math::internal::erfcx_tail_polynomials (It p, It q, const T &t)
 The two tail polynomials, taking the coefficients in the order the iterators give them as descending powers of t.
 
template<typename T , std::size_t N>
stan::math::internal::erfcx_paired_horner (const std::array< double, N > &c, const T &y, const T &y2)
 Horner in y^2 over adjacent coefficient pairs, so the two halves of the chain are independent.
 
double stan::math::internal::erfcx_cody_tail (double x)
 Cody (1969) third-interval rational, valid for x >= 4.
 
template<typename T >
stan::math::internal::erfcx_derivative (const T &x, const T &value)
 Derivative of erfcx, 2 * x * erfcx(x) - 2 / sqrt(pi).
 
double stan::math::internal::erfcx_cody_middle (double y)
 Cody (1969) second-interval rational, valid for 0.46875 <= x <= 4.
 
double stan::math::internal::erfcx_small (double x)
 Degree-18 polynomial for |x| < 0.46875.
 
template<typename T , require_arithmetic_t< T > * = nullptr>
double stan::math::erfcx (T &&xx)
 Return the scaled complementary error function of the argument.
 
template<typename T , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr, require_container_t< T > * = nullptr, require_not_var_matrix_t< T > * = nullptr>
auto stan::math::erfcx (T &&x)
 Returns the elementwise erfcx() of the input, which may be a scalar or any Stan container of numeric scalars.
 

Variables

constexpr std::array< double, 6 > stan::math::internal::erfcx_tail_p
 
constexpr std::array< double, 6 > stan::math::internal::erfcx_tail_q
 
constexpr double stan::math::internal::erfcx_tail_leading_only = 0x1p27
 
constexpr std::array< double, 9 > stan::math::internal::erfcx_middle_p
 
constexpr std::array< double, 9 > stan::math::internal::erfcx_middle_q