ClausenFunctions Class Reference

A class for the Clausen functions. More...

#include <ClausenFunctions.h>

Inheritance diagram for ClausenFunctions:
[legend]
Collaboration diagram for ClausenFunctions:
[legend]

Detailed Description

A class for the Clausen functions.

Author
HEPfit Collaboration

This class handles the Clausen functions \(\mathrm{Cl}_2(\phi)\) and \(\mathrm{Cl}_3(\phi)\).

Definition at line 22 of file ClausenFunctions.h.

Public Member Functions

double Cl2 (const double phi) const
 The Clausen function of index 2, \(\mathrm{Cl}_2(\phi)\). More...
 
double Cl3 (const double phi) const
 The Clausen function of index 3, \(\mathrm{Cl}_3(\phi)\). More...
 
 ClausenFunctions ()
 The default constructor. More...
 
- Public Member Functions inherited from BernoulliNumbers
 BernoulliNumbers ()
 The default constructor. More...
 

Additional Inherited Members

- Protected Attributes inherited from BernoulliNumbers
double B [19]
 the Bernoulli numbers More...
 

Constructor & Destructor Documentation

ClausenFunctions::ClausenFunctions ( )

The default constructor.

Definition at line 15 of file ClausenFunctions.cpp.

16 {
17 }

Member Function Documentation

double ClausenFunctions::Cl2 ( const double  phi) const

The Clausen function of index 2, \(\mathrm{Cl}_2(\phi)\).

This function calls the GSL function gsl_sf_clausen().

Parameters
[in]phia real variable
Returns
\(\mathrm{Cl}_2(\phi)\)

Definition at line 21 of file ClausenFunctions.cpp.

22 {
23  return ( gsl_sf_clausen(phi) );
24 }
double ClausenFunctions::Cl3 ( const double  phi) const

The Clausen function of index 3, \(\mathrm{Cl}_3(\phi)\).

The function \(\mathrm{Cl}_3(\phi)\) is computed with the help of the GSL function gsl_sf_zeta_int(3). See [101].

Parameters
[in]phia real variable
Returns
\(\mathrm{Cl}_3(\phi)\)
Attention
This function is applicable for \(0\leq \phi\leq \pi\).

Definition at line 26 of file ClausenFunctions.cpp.

27 {
28  if (phi < 0.0 || phi > M_PI)
29  throw std::runtime_error("ClausenFunctions::Cl3(): phi is out of range!");
30 
31  if (phi==0.0) return ( gsl_sf_zeta_int(3) );
32 
33  double TMP = 0.0, l_double = 0.0, lfactorial = 1.0, sign = 1.0;
34  for (int l=2; l<19; l++) {
35  l_double = (double)l;
36  lfactorial *= l_double;
37  if (l%4) { sign = - 1.0; } else { sign = 1.0; }
38  TMP += B[l]*pow(phi,l_double)/l_double/(l_double + 1.0)/(l_double + 2.0)
39  /lfactorial * sign;
40  }
41  return ( gsl_sf_zeta_int(3) - phi*phi*(3.0/4.0 - log(phi)/2.0 - TMP) );
42 }
complex pow(const complex &z1, const complex &z2)
double B[19]
the Bernoulli numbers
complex log(const complex &z)

The documentation for this class was generated from the following files: