|
Packit |
67cb25 |
/* specfunc/gsl_sf_dilog.h
|
|
Packit |
67cb25 |
*
|
|
Packit |
67cb25 |
* Copyright (C) 1996, 1997, 1998, 1999, 2000, 2004 Gerard Jungman
|
|
Packit |
67cb25 |
*
|
|
Packit |
67cb25 |
* This program is free software; you can redistribute it and/or modify
|
|
Packit |
67cb25 |
* it under the terms of the GNU General Public License as published by
|
|
Packit |
67cb25 |
* the Free Software Foundation; either version 3 of the License, or (at
|
|
Packit |
67cb25 |
* your option) any later version.
|
|
Packit |
67cb25 |
*
|
|
Packit |
67cb25 |
* This program is distributed in the hope that it will be useful, but
|
|
Packit |
67cb25 |
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
67cb25 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
67cb25 |
* General Public License for more details.
|
|
Packit |
67cb25 |
*
|
|
Packit |
67cb25 |
* You should have received a copy of the GNU General Public License
|
|
Packit |
67cb25 |
* along with this program; if not, write to the Free Software
|
|
Packit |
67cb25 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
Packit |
67cb25 |
*/
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
/* Author: G. Jungman */
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
#ifndef __GSL_SF_DILOG_H__
|
|
Packit |
67cb25 |
#define __GSL_SF_DILOG_H__
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
#include <gsl/gsl_sf_result.h>
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
#undef __BEGIN_DECLS
|
|
Packit |
67cb25 |
#undef __END_DECLS
|
|
Packit |
67cb25 |
#ifdef __cplusplus
|
|
Packit |
67cb25 |
# define __BEGIN_DECLS extern "C" {
|
|
Packit |
67cb25 |
# define __END_DECLS }
|
|
Packit |
67cb25 |
#else
|
|
Packit |
67cb25 |
# define __BEGIN_DECLS /* empty */
|
|
Packit |
67cb25 |
# define __END_DECLS /* empty */
|
|
Packit |
67cb25 |
#endif
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
__BEGIN_DECLS
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
/* Real part of DiLogarithm(x), for real argument.
|
|
Packit |
67cb25 |
* In Lewin's notation, this is Li_2(x).
|
|
Packit |
67cb25 |
*
|
|
Packit |
67cb25 |
* Li_2(x) = - Re[ Integrate[ Log[1-s] / s, {s, 0, x}] ]
|
|
Packit |
67cb25 |
*
|
|
Packit |
67cb25 |
* The function in the complex plane has a branch point
|
|
Packit |
67cb25 |
* at z = 1; we place the cut in the conventional way,
|
|
Packit |
67cb25 |
* on [1, +infty). This means that the value for real x > 1
|
|
Packit |
67cb25 |
* is a matter of definition; however, this choice does not
|
|
Packit |
67cb25 |
* affect the real part and so is not relevant to the
|
|
Packit |
67cb25 |
* interpretation of this implemented function.
|
|
Packit |
67cb25 |
*/
|
|
Packit |
67cb25 |
int gsl_sf_dilog_e(const double x, gsl_sf_result * result);
|
|
Packit |
67cb25 |
double gsl_sf_dilog(const double x);
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
/* DiLogarithm(z), for complex argument z = x + i y.
|
|
Packit |
67cb25 |
* Computes the principal branch.
|
|
Packit |
67cb25 |
*
|
|
Packit |
67cb25 |
* Recall that the branch cut is on the real axis with x > 1.
|
|
Packit |
67cb25 |
* The imaginary part of the computed value on the cut is given
|
|
Packit |
67cb25 |
* by -Pi*log(x), which is the limiting value taken approaching
|
|
Packit |
67cb25 |
* from y < 0. This is a conventional choice, though there is no
|
|
Packit |
67cb25 |
* true standardized choice.
|
|
Packit |
67cb25 |
*
|
|
Packit |
67cb25 |
* Note that there is no canonical way to lift the defining
|
|
Packit |
67cb25 |
* contour to the full Riemann surface because of the appearance
|
|
Packit |
67cb25 |
* of a "hidden branch point" at z = 0 on non-principal sheets.
|
|
Packit |
67cb25 |
* Experts will know the simple algebraic prescription for
|
|
Packit |
67cb25 |
* obtaining the sheet they want; non-experts will not want
|
|
Packit |
67cb25 |
* to know anything about it. This is why GSL chooses to compute
|
|
Packit |
67cb25 |
* only on the principal branch.
|
|
Packit |
67cb25 |
*/
|
|
Packit |
67cb25 |
int
|
|
Packit |
67cb25 |
gsl_sf_complex_dilog_xy_e(
|
|
Packit |
67cb25 |
const double x,
|
|
Packit |
67cb25 |
const double y,
|
|
Packit |
67cb25 |
gsl_sf_result * result_re,
|
|
Packit |
67cb25 |
gsl_sf_result * result_im
|
|
Packit |
67cb25 |
);
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
/* DiLogarithm(z), for complex argument z = r Exp[i theta].
|
|
Packit |
67cb25 |
* Computes the principal branch, thereby assuming an
|
|
Packit |
67cb25 |
* implicit reduction of theta to the range (-2 pi, 2 pi).
|
|
Packit |
67cb25 |
*
|
|
Packit |
67cb25 |
* If theta is identically zero, the imaginary part is computed
|
|
Packit |
67cb25 |
* as if approaching from y > 0. For other values of theta no
|
|
Packit |
67cb25 |
* special consideration is given, since it is assumed that
|
|
Packit |
67cb25 |
* no other machine representations of multiples of pi will
|
|
Packit |
67cb25 |
* produce y = 0 precisely. This assumption depends on some
|
|
Packit |
67cb25 |
* subtle properties of the machine arithmetic, such as
|
|
Packit |
67cb25 |
* correct rounding and monotonicity of the underlying
|
|
Packit |
67cb25 |
* implementation of sin() and cos().
|
|
Packit |
67cb25 |
*
|
|
Packit |
67cb25 |
* This function is ok, but the interface is confusing since
|
|
Packit |
67cb25 |
* it makes it appear that the branch structure is resolved.
|
|
Packit |
67cb25 |
* Furthermore the handling of values close to the branch
|
|
Packit |
67cb25 |
* cut is subtle. Perhap this interface should be deprecated.
|
|
Packit |
67cb25 |
*/
|
|
Packit |
67cb25 |
int
|
|
Packit |
67cb25 |
gsl_sf_complex_dilog_e(
|
|
Packit |
67cb25 |
const double r,
|
|
Packit |
67cb25 |
const double theta,
|
|
Packit |
67cb25 |
gsl_sf_result * result_re,
|
|
Packit |
67cb25 |
gsl_sf_result * result_im
|
|
Packit |
67cb25 |
);
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
/* Spence integral; spence(s) := Li_2(1-s)
|
|
Packit |
67cb25 |
*
|
|
Packit |
67cb25 |
* This function has a branch point at 0; we place the
|
|
Packit |
67cb25 |
* cut on (-infty,0). Because of our choice for the value
|
|
Packit |
67cb25 |
* of Li_2(z) on the cut, spence(s) is continuous as
|
|
Packit |
67cb25 |
* s approaches the cut from above. In other words,
|
|
Packit |
67cb25 |
* we define spence(x) = spence(x + i 0+).
|
|
Packit |
67cb25 |
*/
|
|
Packit |
67cb25 |
int
|
|
Packit |
67cb25 |
gsl_sf_complex_spence_xy_e(
|
|
Packit |
67cb25 |
const double x,
|
|
Packit |
67cb25 |
const double y,
|
|
Packit |
67cb25 |
gsl_sf_result * real_sp,
|
|
Packit |
67cb25 |
gsl_sf_result * imag_sp
|
|
Packit |
67cb25 |
);
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
__END_DECLS
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
#endif /* __GSL_SF_DILOG_H__ */
|