[SciPy-User] polylogarithm?

Pauli Virtanen pav@iki...
Fri Sep 23 11:18:19 CDT 2011


Fri, 23 Sep 2011 15:21:12 +0200, Johann Cohen-Tanugi wrote:
[clip]
> zetac(z) knows how to eat negative arguments, but not zeta(z,1).... Is
> there a reason why special.zeta does not default to 1+special.zetac for
> s=1? This would make the behavior of the 2 functions more identical.

Probably no reason, except that it wasn't implemented. mpmath is 
impressive, and in several ways ahead of scipy.special --- or at least in 
the parts where the problems overlap, as you can do tricks with arbitrary 
precision that are not really feasible.

Note that if you need to call the zeta function from the Cython extension,
call the C library directly:

	cdef extern from "cephes.h":
	    double zeta(double x, double q)
	    double zetac(double x)

and link the extension with the "sc_cephes" library.

    ***

There's a formula (look in the mpmath sources ;) for the transform
from x < 0 to x > 0 for zeta(x, a) for general a. But that needs polylog.

The implementation for zetac(x) for x < 0 seems also a bit incomplete,
as it goes only down to -30.8148. It seems this is due to a silly reason,
it should use gammaln instead of Gamma to avoid the overflow.

	Pauli



More information about the SciPy-User mailing list