deal.II version GIT relicensing-6750-g1dc21bc838 2026-09-15 17:20:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Functions | Variables
fast_transcendental::internal Namespace Reference

Functions

template<typename number >
VectorizedArray< number, 1 > type_cast (const VectorizedArray< number, 1 > &in)
 
template<int degree, typename CoeffsType , typename ValueType >
ValueType horner_scheme (const std::array< CoeffsType, degree+1 > &c, const ValueType &x)
 
template<int degree, typename CoeffsType , typename ValueType >
ValueType estrin_scheme (const std::array< CoeffsType, degree+1 > &c, const ValueType &x)
 

Variables

template<int degree, typename Number >
constexpr std::array< Number, degree+1 > exp_pol_coeff
 
template<typename Number >
constexpr std::array< Number, 4 > exp_pol_coeff< 3, Number >
 
template<typename Number >
constexpr std::array< Number, 5 > exp_pol_coeff< 4, Number >
 
template<typename Number >
constexpr std::array< Number, 6 > exp_pol_coeff< 5, Number >
 
template<typename Number >
constexpr std::array< Number, 7 > exp_pol_coeff< 6, Number >
 
template<typename Number >
constexpr std::array< Number, 8 > exp_pol_coeff< 7, Number >
 
template<typename Number >
constexpr std::array< Number, 9 > exp_pol_coeff< 8, Number >
 
template<typename Number >
constexpr std::array< Number, 10 > exp_pol_coeff< 9, Number >
 
template<typename Number >
constexpr std::array< Number, 11 > exp_pol_coeff< 10, Number >
 
template<typename Number >
constexpr std::array< Number, 12 > exp_pol_coeff< 11, Number >
 
template<typename Number >
constexpr Number exp_coeff_a = numbers::signaling_nan<Number>()
 
template<>
constexpr double exp_coeff_a< double > = 4503599627370496
 
template<>
constexpr float exp_coeff_a< float > = 8388608
 
template<typename Number >
constexpr Number exp_coeff_b = numbers::signaling_nan<Number>()
 
template<>
constexpr double exp_coeff_b< double > = 4.60718241880001741e+18
 
template<>
constexpr float exp_coeff_b< float > = 1065353216
 
template<typename Number >
constexpr Number max_exponent = numbers::signaling_nan<Number>()
 
template<>
constexpr double max_exponent< double > = 9.218868437227405312e+18
 
template<>
constexpr float max_exponent< float > = 2139095040
 
template<typename Number >
constexpr Number exp_max_abs_x = numbers::signaling_nan<Number>()
 
template<>
constexpr double exp_max_abs_x< double > = 709.196208642
 
template<>
constexpr float exp_max_abs_x< float > = 87.49823353f
 

Function Documentation

◆ type_cast()

template<typename number >
VectorizedArray< number, 1 > fast_transcendental::internal::type_cast ( const VectorizedArray< number, 1 > &  in)
inline

The functions below provide architecture-specific specializations used as a helper by the fast_exp() implementation. Each specialization performs a two-step operation:

  1. Static cast of each floating-point value to its corresponding integer type (float to int32_t, double to int64_t).

  2. Reinterpretation of the resulting integer vector as a floating-point vector via bitwise casting.

Definition at line 326 of file fast_transcendental.h.

◆ horner_scheme()

template<int degree, typename CoeffsType , typename ValueType >
ValueType fast_transcendental::internal::horner_scheme ( const std::array< CoeffsType, degree+1 > &  c,
const ValueType &  x 
)
inline

This function computes the value of a polynomial

\[ P(x) = c_0 + c_1 x + c_2 x^2 + \dots + c_{\text{degree}} x^{\text{degree}} \]

where the coefficients \(c_i\) are provided in ascending order using Horner's scheme.

Template Parameters
degreeDegree of the polynomial.
CoeffsTypeType of the stored coefficients.
ValueTypeType of the evaluation point and result.
Parameters
cArray of polynomial coefficients in ascending order.
xThe point at which the polynomial should be evaluated.
Returns
The value \(P(x)\).

Definition at line 356 of file fast_transcendental.h.

◆ estrin_scheme()

template<int degree, typename CoeffsType , typename ValueType >
ValueType fast_transcendental::internal::estrin_scheme ( const std::array< CoeffsType, degree+1 > &  c,
const ValueType &  x 
)
inline

This function computes the value of a polynomial

\[ P(x) = c_0 + c_1 x + c_2 x^2 + \dots + c_{\text{degree}} x^{\text{degree}} \]

where the coefficients \(c_i\) are provided in ascending order using Estrin's scheme.

Template Parameters
degreeDegree of the polynomial.
CoeffsTypeType of the stored coefficients.
ValueTypeType of the evaluation point and result.
Parameters
cArray of polynomial coefficients in ascending order.
xThe point at which the polynomial should be evaluated.
Returns
The value \(P(x)\).

Definition at line 386 of file fast_transcendental.h.

Variable Documentation

◆ exp_pol_coeff

template<int degree, typename Number >
constexpr std::array<Number, degree + 1> fast_transcendental::internal::exp_pol_coeff
constexpr
Initial value:
=
[]() -> std::array<Number, degree + 1> {
static_assert(degree > 2 && degree < 12,
"Unsupported polynomial degree for exp_pol_coeff.");
return std::array<Number, degree + 1>{};
}()

Definition at line 59 of file fast_transcendental.h.

◆ exp_pol_coeff< 3, Number >

template<typename Number >
constexpr std::array<Number, 4> fast_transcendental::internal::exp_pol_coeff< 3, Number >
constexpr
Initial value:
= {
{1.8809206555322363e-04,
3.0316116404944521e-01,
-2.2412622972531135e-01,
-7.9019886953785187e-02}}

Definition at line 67 of file fast_transcendental.h.

◆ exp_pol_coeff< 4, Number >

template<typename Number >
constexpr std::array<Number, 5> fast_transcendental::internal::exp_pol_coeff< 4, Number >
constexpr
Initial value:
= {
{-7.2868375805796964e-06,
3.0706874220004554e-01,
-2.4171033150558635e-01,
-5.1666839694436362e-02,
-1.3676523629674565e-02}}

Definition at line 74 of file fast_transcendental.h.

◆ exp_pol_coeff< 5, Number >

template<typename Number >
constexpr std::array<Number, 6> fast_transcendental::internal::exp_pol_coeff< 5, Number >
constexpr
Initial value:
= {
{2.3053723876408911e-07,
3.0684322094757277e-01,
-2.4013168272249241e-01,
-5.5876569798473615e-02,
-8.9405772567122607e-03,
-1.8943785491846432e-03}}

Definition at line 82 of file fast_transcendental.h.

◆ exp_pol_coeff< 6, Number >

template<typename Number >
constexpr std::array<Number, 7> fast_transcendental::internal::exp_pol_coeff< 6, Number >
constexpr
Initial value:
= {
{-6.1646222105268035e-09,
3.0685316242622318e-01,
-2.4023109751048086e-01,
-5.5478910644035311e-02,
-9.6861881733345725e-03,
-1.2382409419015978e-03,
-2.1871253576104385e-04}}

Definition at line 91 of file fast_transcendental.h.

◆ exp_pol_coeff< 7, Number >

template<typename Number >
constexpr std::array<Number, 8> fast_transcendental::internal::exp_pol_coeff< 7, Number >
constexpr
Initial value:
= {
{1.4276280848886066e-10,
3.0685280921264796e-01,
-2.4022632912712596e-01,
-5.5505401662914296e-02,
-9.6133378710895074e-03,
-1.3431453773612783e-03,
-1.4294822119902167e-04,
-2.1646947017882258e-05}}

Definition at line 101 of file fast_transcendental.h.

◆ exp_pol_coeff< 8, Number >

template<typename Number >
constexpr std::array<Number, 9> fast_transcendental::internal::exp_pol_coeff< 8, Number >
constexpr
Initial value:
= {
{-2.9146986289710858e-12,
3.0685281970141953e-01,
-2.4022651268062989e-01,
-5.5504055603868258e-02,
-9.6183855925465120e-03,
-1.3326461166925901e-03,
-1.5519735866800178e-04,
-1.4147475092332136e-05,
-1.8748679813608566e-06}}

Definition at line 112 of file fast_transcendental.h.

◆ exp_pol_coeff< 9, Number >

template<typename Number >
constexpr std::array<Number, 10> fast_transcendental::internal::exp_pol_coeff< 9, Number >
constexpr
Initial value:
= {
{5.4337475594757437e-14,
3.0685281943421089e-01,
-2.4022650680203564e-01,
-5.5504110470759059e-02,
-9.6181181164443925e-03,
-1.3333950497836748e-03,
-1.5394913684739714e-04,
-1.5370223000068715e-05,
-1.2252831550509094e-06,
-1.4435218373241001e-07}}

Definition at line 124 of file fast_transcendental.h.

◆ exp_pol_coeff< 10, Number >

template<typename Number >
constexpr std::array<Number, 11> fast_transcendental::internal::exp_pol_coeff< 10, Number >
constexpr
Initial value:
= {
{7.6072080297756739e-12,
3.0685281862960340e-01,
-2.4022648563631835e-01,
-5.5504349821691862e-02,
-9.6166785909533817e-03,
-1.3384970969245304e-03,
-1.4276337493295606e-04,
-3.0711077326624553e-05,
1.1584454591775664e-05,
-6.0984990187293866e-06,
1.1810109241254786e-06}}

Definition at line 137 of file fast_transcendental.h.

◆ exp_pol_coeff< 11, Number >

template<typename Number >
constexpr std::array<Number, 12> fast_transcendental::internal::exp_pol_coeff< 11, Number >
constexpr
Initial value:
= {
{3.6083394569535254e-13,
3.0685281939395403e-01,
-2.4022650549710606e-01,
-5.5504128716495800e-02,
-9.6179813320517119e-03,
-1.3340079120703319e-03,
-1.5221190054222076e-04,
-1.8563222423500779e-05,
2.5694826992914108e-06,
-2.9577981133179920e-06,
1.1827521620524028e-06,
-2.1525063398151332e-07}}

Definition at line 151 of file fast_transcendental.h.

◆ exp_coeff_a

template<typename Number >
constexpr Number fast_transcendental::internal::exp_coeff_a = numbers::signaling_nan<Number>()
constexpr

This is 2^52 for double and 2^23 for float.

Definition at line 169 of file fast_transcendental.h.

◆ exp_coeff_a< double >

template<>
constexpr double fast_transcendental::internal::exp_coeff_a< double > = 4503599627370496
inlineconstexpr

Definition at line 171 of file fast_transcendental.h.

◆ exp_coeff_a< float >

template<>
constexpr float fast_transcendental::internal::exp_coeff_a< float > = 8388608
inlineconstexpr

Definition at line 173 of file fast_transcendental.h.

◆ exp_coeff_b

template<typename Number >
constexpr Number fast_transcendental::internal::exp_coeff_b = numbers::signaling_nan<Number>()
inlineconstexpr

This is 2^52 * 1023 for double and 2^23 * 127 for float.

Definition at line 179 of file fast_transcendental.h.

◆ exp_coeff_b< double >

template<>
constexpr double fast_transcendental::internal::exp_coeff_b< double > = 4.60718241880001741e+18
inlineconstexpr

Definition at line 181 of file fast_transcendental.h.

◆ exp_coeff_b< float >

template<>
constexpr float fast_transcendental::internal::exp_coeff_b< float > = 1065353216
inlineconstexpr

Definition at line 183 of file fast_transcendental.h.

◆ max_exponent

template<typename Number >
constexpr Number fast_transcendental::internal::max_exponent = numbers::signaling_nan<Number>()
inlineconstexpr

This is the maximum exponent for a floating point representation shifted to the exponent bits. In numbers this is 2^52 * 2047 for double and 2^23

  • 255 for float.

Definition at line 191 of file fast_transcendental.h.

◆ max_exponent< double >

template<>
constexpr double fast_transcendental::internal::max_exponent< double > = 9.218868437227405312e+18
inlineconstexpr

Definition at line 193 of file fast_transcendental.h.

◆ max_exponent< float >

template<>
constexpr float fast_transcendental::internal::max_exponent< float > = 2139095040
inlineconstexpr

Definition at line 195 of file fast_transcendental.h.

◆ exp_max_abs_x

template<typename Number >
constexpr Number fast_transcendental::internal::exp_max_abs_x = numbers::signaling_nan<Number>()
inlineconstexpr

The largest |x| for which exp(x) remains a finite, representable value of type Number. For double this is approximately 308 / log10(e), and for float approximately 38 / log10(e).

Definition at line 203 of file fast_transcendental.h.

◆ exp_max_abs_x< double >

template<>
constexpr double fast_transcendental::internal::exp_max_abs_x< double > = 709.196208642
inlineconstexpr

Definition at line 205 of file fast_transcendental.h.

◆ exp_max_abs_x< float >

template<>
constexpr float fast_transcendental::internal::exp_max_abs_x< float > = 87.49823353f
inlineconstexpr

Definition at line 207 of file fast_transcendental.h.