Jpp 19.3.0
the software that should make you happy
Loading...
Searching...
No Matches
utl Namespace Reference

Classes

class  AsymptoticPolynomialA
 
class  AsymptoticPolynomialB
 
class  Branch
 
class  BranchPoint
 
struct  Horner
 
struct  Horner< Float, Tag, 0 >
 
struct  Iterator
 
struct  LogRecursionImpl
 
struct  LogRecursionImpl< Float, branch, 0 >
 
struct  Pade
 
struct  Pade< Float, -1, 4 >
 
struct  Pade< Float, -1, 5 >
 
struct  Pade< Float, -1, 6 >
 
struct  Pade< Float, -1, 7 >
 
struct  Pade< Float, 0, 1 >
 
struct  Pade< Float, 0, 2 >
 
struct  Polynomial
 

Functions

 HORNER_COEFF (BranchPoint, 0, -1)
 
 HORNER_COEFF (BranchPoint, 1, 1)
 
 HORNER_COEFF (BranchPoint, 2, -0.333333333333333333e0)
 
 HORNER_COEFF (BranchPoint, 3, 0.152777777777777777e0)
 
 HORNER_COEFF (BranchPoint, 4, -0.79629629629629630e-1)
 
 HORNER_COEFF (BranchPoint, 5, 0.44502314814814814e-1)
 
 HORNER_COEFF (BranchPoint, 6, -0.25984714873603760e-1)
 
 HORNER_COEFF (BranchPoint, 7, 0.15635632532333920e-1)
 
 HORNER_COEFF (BranchPoint, 8, -0.96168920242994320e-2)
 
 HORNER_COEFF (BranchPoint, 9, 0.60145432529561180e-2)
 
 HORNER_COEFF (BranchPoint, 10, -0.38112980348919993e-2)
 
 HORNER_COEFF (BranchPoint, 11, 0.24408779911439826e-2)
 
 HORNER_COEFF (BranchPoint, 12, -0.15769303446867841e-2)
 
 HORNER_COEFF (BranchPoint, 13, 0.10262633205076071e-2)
 
 HORNER_COEFF (BranchPoint, 14, -0.67206163115613620e-3)
 
 HORNER_COEFF (BranchPoint, 15, 0.44247306181462090e-3)
 
 HORNER_COEFF (BranchPoint, 16, -0.29267722472962746e-3)
 
 HORNER_COEFF (BranchPoint, 17, 0.19438727605453930e-3)
 
 HORNER_COEFF (BranchPoint, 18, -0.12957426685274883e-3)
 
 HORNER_COEFF (BranchPoint, 19, 0.86650358052081260e-4)
 
 HORNER_COEFF (AsymptoticPolynomialB< 2 >, 0, 0)
 
 HORNER_COEFF (AsymptoticPolynomialB< 2 >, 1, -1)
 
 HORNER_COEFF (AsymptoticPolynomialB< 2 >, 2, 1./2)
 
 HORNER_COEFF (AsymptoticPolynomialB< 3 >, 0, 0)
 
 HORNER_COEFF (AsymptoticPolynomialB< 3 >, 1, 1)
 
 HORNER_COEFF (AsymptoticPolynomialB< 3 >, 2, -3./2)
 
 HORNER_COEFF (AsymptoticPolynomialB< 3 >, 3, 1./3)
 
 HORNER_COEFF (AsymptoticPolynomialB< 4 >, 0, 0)
 
 HORNER_COEFF (AsymptoticPolynomialB< 4 >, 1, -1)
 
 HORNER_COEFF (AsymptoticPolynomialB< 4 >, 2, 3)
 
 HORNER_COEFF (AsymptoticPolynomialB< 4 >, 3, -11./6)
 
 HORNER_COEFF (AsymptoticPolynomialB< 4 >, 4, 1./4)
 
 HORNER_COEFF (AsymptoticPolynomialB< 5 >, 0, 0)
 
 HORNER_COEFF (AsymptoticPolynomialB< 5 >, 1, 1)
 
 HORNER_COEFF (AsymptoticPolynomialB< 5 >, 2, -5)
 
 HORNER_COEFF (AsymptoticPolynomialB< 5 >, 3, 35./6)
 
 HORNER_COEFF (AsymptoticPolynomialB< 5 >, 4, -25./12)
 
 HORNER_COEFF (AsymptoticPolynomialB< 5 >, 5, 1./5)
 
 HORNER_COEFF2 (AsymptoticPolynomialA, 0, -y)
 
 HORNER_COEFF2 (AsymptoticPolynomialA, 1, y)
 
 HORNER_COEFF2 (AsymptoticPolynomialA, 2,(Horner< Float, AsymptoticPolynomialB< 2 >, 2 >::Eval(y)))
 
 HORNER_COEFF2 (AsymptoticPolynomialA, 3,(Horner< Float, AsymptoticPolynomialB< 3 >, 3 >::Eval(y)))
 
 HORNER_COEFF2 (AsymptoticPolynomialA, 4,(Horner< Float, AsymptoticPolynomialB< 4 >, 4 >::Eval(y)))
 
 HORNER_COEFF2 (AsymptoticPolynomialA, 5,(Horner< Float, AsymptoticPolynomialB< 5 >, 5 >::Eval(y)))
 
template<typename Float , int order>
Float AsymptoticExpansionImpl (const Float a, const Float b)
 
template<typename Float >
Float HalleyStep (const Float x, const Float w)
 
template<typename Float >
Float FritschStep (const Float x, const Float w)
 
template<typename Float >
Float SchroederStep (const Float x, const Float w)
 
template<int branch>
double LambertW (const double x)
 
template<>
double LambertW< 0 > (const double x)
 
template<>
double LambertW<-1 > (const double x)
 
double LambertW (const int branch, const double x)
 

Function Documentation

◆ HORNER_COEFF() [1/38]

utl::HORNER_COEFF ( BranchPoint ,
0 ,
- 1 )

◆ HORNER_COEFF() [2/38]

utl::HORNER_COEFF ( BranchPoint ,
1 ,
1  )

◆ HORNER_COEFF() [3/38]

utl::HORNER_COEFF ( BranchPoint ,
2 ,
-0. 333333333333333333e0 )

◆ HORNER_COEFF() [4/38]

utl::HORNER_COEFF ( BranchPoint ,
3 ,
0. 152777777777777777e0 )

◆ HORNER_COEFF() [5/38]

utl::HORNER_COEFF ( BranchPoint ,
4 ,
-0.79629629629629630e- 1 )

◆ HORNER_COEFF() [6/38]

utl::HORNER_COEFF ( BranchPoint ,
5 ,
0.44502314814814814e- 1 )

◆ HORNER_COEFF() [7/38]

utl::HORNER_COEFF ( BranchPoint ,
6 ,
-0.25984714873603760e- 1 )

◆ HORNER_COEFF() [8/38]

utl::HORNER_COEFF ( BranchPoint ,
7 ,
0.15635632532333920e- 1 )

◆ HORNER_COEFF() [9/38]

utl::HORNER_COEFF ( BranchPoint ,
8 ,
-0.96168920242994320e- 2 )

◆ HORNER_COEFF() [10/38]

utl::HORNER_COEFF ( BranchPoint ,
9 ,
0.60145432529561180e- 2 )

◆ HORNER_COEFF() [11/38]

utl::HORNER_COEFF ( BranchPoint ,
10 ,
-0.38112980348919993e- 2 )

◆ HORNER_COEFF() [12/38]

utl::HORNER_COEFF ( BranchPoint ,
11 ,
0.24408779911439826e- 2 )

◆ HORNER_COEFF() [13/38]

utl::HORNER_COEFF ( BranchPoint ,
12 ,
-0.15769303446867841e- 2 )

◆ HORNER_COEFF() [14/38]

utl::HORNER_COEFF ( BranchPoint ,
13 ,
0.10262633205076071e- 2 )

◆ HORNER_COEFF() [15/38]

utl::HORNER_COEFF ( BranchPoint ,
14 ,
-0.67206163115613620e- 3 )

◆ HORNER_COEFF() [16/38]

utl::HORNER_COEFF ( BranchPoint ,
15 ,
0.44247306181462090e- 3 )

◆ HORNER_COEFF() [17/38]

utl::HORNER_COEFF ( BranchPoint ,
16 ,
-0.29267722472962746e- 3 )

◆ HORNER_COEFF() [18/38]

utl::HORNER_COEFF ( BranchPoint ,
17 ,
0.19438727605453930e- 3 )

◆ HORNER_COEFF() [19/38]

utl::HORNER_COEFF ( BranchPoint ,
18 ,
-0.12957426685274883e- 3 )

◆ HORNER_COEFF() [20/38]

utl::HORNER_COEFF ( BranchPoint ,
19 ,
0.86650358052081260e- 4 )

◆ HORNER_COEFF() [21/38]

utl::HORNER_COEFF ( AsymptoticPolynomialB< 2 > ,
0 ,
0  )

◆ HORNER_COEFF() [22/38]

utl::HORNER_COEFF ( AsymptoticPolynomialB< 2 > ,
1 ,
- 1 )

◆ HORNER_COEFF() [23/38]

utl::HORNER_COEFF ( AsymptoticPolynomialB< 2 > ,
2 ,
1./ 2 )

◆ HORNER_COEFF() [24/38]

utl::HORNER_COEFF ( AsymptoticPolynomialB< 3 > ,
0 ,
0  )

◆ HORNER_COEFF() [25/38]

utl::HORNER_COEFF ( AsymptoticPolynomialB< 3 > ,
1 ,
1  )

◆ HORNER_COEFF() [26/38]

utl::HORNER_COEFF ( AsymptoticPolynomialB< 3 > ,
2 ,
-3./ 2 )

◆ HORNER_COEFF() [27/38]

utl::HORNER_COEFF ( AsymptoticPolynomialB< 3 > ,
3 ,
1./ 3 )

◆ HORNER_COEFF() [28/38]

utl::HORNER_COEFF ( AsymptoticPolynomialB< 4 > ,
0 ,
0  )

◆ HORNER_COEFF() [29/38]

utl::HORNER_COEFF ( AsymptoticPolynomialB< 4 > ,
1 ,
- 1 )

◆ HORNER_COEFF() [30/38]

utl::HORNER_COEFF ( AsymptoticPolynomialB< 4 > ,
2 ,
3  )

◆ HORNER_COEFF() [31/38]

utl::HORNER_COEFF ( AsymptoticPolynomialB< 4 > ,
3 ,
-11./ 6 )

◆ HORNER_COEFF() [32/38]

utl::HORNER_COEFF ( AsymptoticPolynomialB< 4 > ,
4 ,
1./ 4 )

◆ HORNER_COEFF() [33/38]

utl::HORNER_COEFF ( AsymptoticPolynomialB< 5 > ,
0 ,
0  )

◆ HORNER_COEFF() [34/38]

utl::HORNER_COEFF ( AsymptoticPolynomialB< 5 > ,
1 ,
1  )

◆ HORNER_COEFF() [35/38]

utl::HORNER_COEFF ( AsymptoticPolynomialB< 5 > ,
2 ,
- 5 )

◆ HORNER_COEFF() [36/38]

utl::HORNER_COEFF ( AsymptoticPolynomialB< 5 > ,
3 ,
35./ 6 )

◆ HORNER_COEFF() [37/38]

utl::HORNER_COEFF ( AsymptoticPolynomialB< 5 > ,
4 ,
-25./ 12 )

◆ HORNER_COEFF() [38/38]

utl::HORNER_COEFF ( AsymptoticPolynomialB< 5 > ,
5 ,
1./ 5 )

◆ HORNER_COEFF2() [1/6]

utl::HORNER_COEFF2 ( AsymptoticPolynomialA ,
0 ,
- y )

◆ HORNER_COEFF2() [2/6]

utl::HORNER_COEFF2 ( AsymptoticPolynomialA ,
1 ,
y  )

◆ HORNER_COEFF2() [3/6]

utl::HORNER_COEFF2 ( AsymptoticPolynomialA ,
2 ,
(Horner< Float, AsymptoticPolynomialB< 2 >, 2 >::Eval(y))  )

◆ HORNER_COEFF2() [4/6]

utl::HORNER_COEFF2 ( AsymptoticPolynomialA ,
3 ,
(Horner< Float, AsymptoticPolynomialB< 3 >, 3 >::Eval(y))  )

◆ HORNER_COEFF2() [5/6]

utl::HORNER_COEFF2 ( AsymptoticPolynomialA ,
4 ,
(Horner< Float, AsymptoticPolynomialB< 4 >, 4 >::Eval(y))  )

◆ HORNER_COEFF2() [6/6]

utl::HORNER_COEFF2 ( AsymptoticPolynomialA ,
5 ,
(Horner< Float, AsymptoticPolynomialB< 5 >, 5 >::Eval(y))  )

◆ AsymptoticExpansionImpl()

template<typename Float , int order>
Float utl::AsymptoticExpansionImpl ( const Float a,
const Float b )
inline

Definition at line 158 of file LambertW.hh.

159 {
161 }

◆ HalleyStep()

template<typename Float >
Float utl::HalleyStep ( const Float x,
const Float w )
inline

Definition at line 210 of file LambertW.hh.

211 {
212 const Float ew = exp(w);
213 const Float wew = w * ew;
214 const Float wewx = wew - x;
215 const Float w1 = w + 1;
216 return w - wewx / (ew * w1 - (w + 2) * wewx/(2*w1));
217 }

◆ FritschStep()

template<typename Float >
Float utl::FritschStep ( const Float x,
const Float w )
inline

Definition at line 223 of file LambertW.hh.

224 {
225 const Float z = log(x/w) - w;
226 const Float w1 = w + 1;
227 const Float q = 2 * w1 * (w1 + Float(2./3)*z);
228 const Float eps = z / w1 * (q - z) / (q - 2*z);
229 return w * (1 + eps);
230 }

◆ SchroederStep()

template<typename Float >
Float utl::SchroederStep ( const Float x,
const Float w )
inline

Definition at line 236 of file LambertW.hh.

237 {
238 const Float y = x * exp(-w);
239 const Float f0 = w - y;
240 const Float f1 = 1 + y;
241 const Float f00 = f0*f0;
242 const Float f11 = f1*f1;
243 const Float f0y = f0*y;
244 return w - 4*f0*(6*f1*(f11 + f0y) + f00*y) / (f11*(24*f11 + 36*f0y) + f00*(6*y*y + 8*f1*y + f0y));
245 }

◆ LambertW() [1/2]

template<int branch>
double utl::LambertW ( const double x)

◆ LambertW< 0 >()

template<>
template double utl::LambertW< 0 > ( const double x)

Definition at line 345 of file LambertW.hh.

347 {
348 typedef double d;
349 return Y5(
351 x < -0.367679,
352 (Iterator<d, HalleyStep<d> >::Depth<1>::Recurse(x, Branch<d, 0>::BranchPointExpansion<10>(x))),
353 x < -0.311,
354 (Iterator<d, HalleyStep<d> >::Depth<1>::Recurse(x, Pade<d, 0, 1>::Approximation(x))),
355 x < 1.38,
356 (Iterator<d, HalleyStep<d> >::Depth<1>::Recurse(x, Pade<d, 0, 2>::Approximation(x))),
357 x < 236,
358 (Iterator<d, HalleyStep<d> >::Depth<1>::Recurse(x, Branch<d, 0>::AsymptoticExpansion<6-1>(x)))
359 );
360 }
#define Y5(d1, c12, d2, c23, d3, c34, d4, c45, d5)
Definition LambertW.hh:88

◆ LambertW<-1 >()

template<>
template double utl::LambertW<-1 > ( const double x)

Definition at line 364 of file LambertW.hh.

366 {
367 typedef double d;
368 return Y7(
370 x < -0.367579,
371 (Iterator<d, HalleyStep<d> >::Depth<1>::Recurse(x, Branch<d, -1>::BranchPointExpansion<4>(x))),
372 x < -0.366079,
373 (Iterator<d, HalleyStep<d> >::Depth<1>::Recurse(x, Pade<d, -1, 7>::Approximation(x))),
374 x < -0.289379,
375 (Iterator<d, HalleyStep<d> >::Depth<1>::Recurse(x, Pade<d, -1, 4>::Approximation(x))),
376 x < -0.0509,
377 (Iterator<d, HalleyStep<d> >::Depth<1>::Recurse(x, Pade<d, -1, 5>::Approximation(x))),
378 x < -0.000131826,
379 (Iterator<d, HalleyStep<d> >::Depth<1>::Recurse(x, Pade<d, -1, 6>::Approximation(x))),
380 x < -6.30957e-31,
381 (Iterator<d, HalleyStep<d> >::Depth<1>::Recurse(x, Branch<d, -1>::LogRecursion<3>(x)))
382 );
383 }
#define Y7(d1, c12, d2, c23, d3, c34, d4, c45, d5, c56, d6, c67, d7)
Definition LambertW.hh:92

◆ LambertW() [2/2]

double utl::LambertW ( const int branch,
const double x )
inline

Definition at line 397 of file LambertW.hh.

398 {
399 switch (branch) {
400 case -1: return LambertW<-1>(x);
401 case 0: return LambertW<0>(x);
402 default: return std::numeric_limits<double>::quiet_NaN();
403 }
404 }