a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
Polylogarithms Class Reference

A class for the polylogarithms. More...

#include <Polylogarithms.h>

+ Inheritance diagram for Polylogarithms:

Detailed Description

A class for the polylogarithms.

Author
HEPfit Collaboration

This class handles the polylogarithms \(\mathrm{Li}_2(x)\), \(\mathrm{Li}_2(z)\) and \(\mathrm{Li}_3(x)\), where \(x\) and \(z\) are real and complex variables, respectively.

Definition at line 24 of file Polylogarithms.h.

Public Member Functions

gslpp::complex Li2 (const double x) const
 The dilogarithm with a real argument, \(\mathrm{Li}_2(x)\). More...
 
gslpp::complex Li2 (const gslpp::complex z) const
 The dilogarithm with a complex argument, \(\mathrm{Li}_2(z)\). More...
 
double Li3 (const double x) const
 The trilogarithm \(\mathrm{Li}_3(x)\). More...
 
 Polylogarithms ()
 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

◆ Polylogarithms()

Polylogarithms::Polylogarithms ( )

The default constructor.

Definition at line 16 of file Polylogarithms.cpp.

17{
18}

Member Function Documentation

◆ Li2() [1/2]

gslpp::complex Polylogarithms::Li2 ( const double  x) const

The dilogarithm with a real argument, \(\mathrm{Li}_2(x)\).

This function calls the GSL function gsl_sf_complex_dilog_xy_e().

Parameters
[in]xa real variable.
Returns
\(\mathrm{Li}_2(x)\)

Definition at line 22 of file Polylogarithms.cpp.

23{
24 gsl_sf_result re, im;
25 gsl_sf_complex_dilog_xy_e(x, 0.0, &re, &im);
26 return gslpp::complex(re.val, im.val, false);
27}

◆ Li2() [2/2]

gslpp::complex Polylogarithms::Li2 ( const gslpp::complex  z) const

The dilogarithm with a complex argument, \(\mathrm{Li}_2(z)\).

This function calls the GSL function gsl_sf_complex_dilog_xy_e().

Parameters
[in]za complex variable.
Returns
\(\mathrm{Li}_2(z)\)

Definition at line 29 of file Polylogarithms.cpp.

30{
31 gsl_sf_result re, im;
32 gsl_sf_complex_dilog_xy_e(z.real(), z.imag(), &re, &im);
33 return gslpp::complex(re.val, im.val, false);
34}

◆ Li3()

double Polylogarithms::Li3 ( const double  x) const

The trilogarithm \(\mathrm{Li}_3(x)\).

Parameters
[in]xa real variable.
Returns
\(\mathrm{Li}_3(x)\)
Attention
This function is applicable for real \(x \leq 1\).

Definition at line 36 of file Polylogarithms.cpp.

37{
38 double Li3 = 0.0;
39 if (x < 0.0)
40 Li3 = -gsl_sf_fermi_dirac_2(log(-x));
41 else if (x == 0.0)
42 Li3 = 0.0;
43 else if (x > 0.0 && x < 0.5) {
44 double log_1mx = log(1.0 - x);
45 double lfactorial = 1.0, kfactorial = 1.0;
46 for (int l=0; l<19; l++) {
47 if (l!=0) lfactorial *= (double)l;
48 kfactorial = 1.0;
49 for (int k=0; k<19; k++) {
50 if (k!=0) kfactorial *= (double)k;
51 Li3 += B[l]*B[k]/((double)l+1.0)/((double)l+(double)k+1.0)
52 /lfactorial/kfactorial
53 * pow(-log_1mx, (double)l+(double)k+1.0);
54 }
55 }
56 } else if (x == 0.5) {
57 double log2 = log(2.0);
58 double zeta3 = gsl_sf_zeta_int(3);
59 Li3 = (4.0*pow(log2, 3.0) - 2.0*M_PI*M_PI*log2 + 21.0*zeta3)/24.0;
60 } else if (x > 0.5 && x < 1.0) {
61 double log_x = log(x);
62 double S12 = 0.0, lfactorial = 1.0;
63 for (int l=0; l<19; l++) {
64 if (l!=0) lfactorial *= (double)l;
65 S12 += 0.5 * B[l]/((double)l+2.0)/lfactorial
66 * pow(-log_x, (double)l+2.0);
67 }
68 Li3 = - S12 - log_x*gsl_sf_dilog(1.0-x) - 0.5*log_x*log_x*log(1.0-x)
69 + gsl_sf_zeta_int(2)*log_x + gsl_sf_zeta_int(3);
70 } else if (x == 1.0)
71 Li3 = gsl_sf_zeta_int(3);
72 else
73 throw std::runtime_error("Polylogarithms::Li3(): x is out of range!");
74 return (Li3);
75}
double B[19]
the Bernoulli numbers
double Li3(const double x) const
The trilogarithm .

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