polylog.h
Go to the documentation of this file.
1 /*
2  -------------------------------------------------------------------
3 
4  Copyright (C) 2006-2017, Andrew W. Steiner
5 
6  This file is part of O2scl.
7 
8  O2scl is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 3 of the License, or
11  (at your option) any later version.
12 
13  O2scl is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with O2scl. If not, see <http://www.gnu.org/licenses/>.
20 
21  -------------------------------------------------------------------
22 */
23 /** \file polylog.h
24  \brief File defining \ref o2scl::polylog
25 */
26 #ifndef O2SCL_POLYLOG_H
27 #define O2SCL_POLYLOG_H
28 
29 #include <iostream>
30 #include <fstream>
31 #include <string>
32 #include <cmath>
33 #include <o2scl/constants.h>
34 #include <o2scl/err_hnd.h>
35 #include <o2scl/lib_settings.h>
36 #include <gsl/gsl_sf_dilog.h>
37 
38 #ifndef DOXYGEN_NO_O2NS
39 namespace o2scl {
40 #endif
41 
42  /** \brief Polylogarithms (approximate) \f$ Li_n(x)\f$
43 
44  This class is experimental.
45 
46  This gives an approximation to the polylogarithm functions.
47 
48  Only works at present for \f$n=0,1,...,6\f$. Uses GSL library
49  for n=2.
50 
51  Uses linear interpolation for \f$-1<x<0\f$
52  and a series expansion for \f$x<-1\f$
53 
54  \future
55  - Give error estimate?
56  - Improve accuracy?
57  - Use more sophisticated interpolation?
58  - Add the series \f$Li(n,x)=x+2^{-n} x^2+3^{-n} x^3+...\f$
59  for \f$ x \rightarrow 0\f$?
60  - Implement for positive arguments < 1.0
61  - Make another polylog class which implements series acceleration?
62 
63  For reference, there are exact relations
64  \f[
65  \mathrm{Li}_2 \left(\frac{1}{2}\right) =
66  \frac{1}{12}\left[\pi^2-6\left(\ln 2\right)^2\right]
67  \f]
68  \f[
69  \mathrm{Li}_3 \left(\frac{1}{2}\right) =
70  \frac{1}{24}\left[ 4\left(\ln 2\right)^3 - 2 \pi^2 \ln 2 +
71  21 \zeta (3) \right]
72  \f]
73  \f[
74  \mathrm{Li}_{-1} (x) = \frac{x}{\left(1-x\right)^2}
75  \f]
76  \f[
77  \mathrm{Li}_{-2} (x) = \frac{x\left(x+1\right)}{\left(1-x\right)^3}
78  \f]
79 
80  */
81  class polylog {
82 
83  public:
84 
85  /// 0-th order polylogarithm = \f$ x/(1-x)\f$
86  double li0(double x);
87 
88  /// 1-st order polylogarithm = \f$ -\ln(1-x) \f$
89  double li1(double x);
90 
91  /// 2-nd order polylogarithm
92  double li2(double x);
93 
94  /// 3-rd order polylogarithm
95  double li3(double x);
96 
97  /// 4-th order polylogarithm
98  double li4(double x);
99 
100  /// 5-th order polylogarithm
101  double li5(double x);
102 
103  /// 6-th order polylogarithm
104  double li6(double x);
105 
106  polylog();
107  ~polylog();
108 
109  protected:
110 
111 #ifndef DOXYGEN_NO_O2NS
112 
113  double *arg;
114  double *two;
115  double *three;
116  double *four;
117  double *five;
118  double *six;
119  double li2neg1;
120  double li4neg1;
121  double li6neg1;
122 
123 #endif
124 
125  };
126 
127 #ifndef DOXYGEN_NO_O2NS
128 }
129 #endif
130 
131 #endif
double li0(double x)
0-th order polylogarithm =
The main O<span style=&#39;position: relative; top: 0.3em; font-size: 0.8em&#39;>2</span>scl O$_2$scl names...
Definition: anneal.h:42
Polylogarithms (approximate) .
Definition: polylog.h:81
double li2(double x)
2-nd order polylogarithm
double li3(double x)
3-rd order polylogarithm
double li1(double x)
1-st order polylogarithm =
double li5(double x)
5-th order polylogarithm
double li6(double x)
6-th order polylogarithm
double li4(double x)
4-th order polylogarithm

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).