[SciPy-dev] Zeta Functions !
Warren Weckesser
warren.weckesser@enthought....
Sun Jan 3 20:38:15 CST 2010
I don't know the reason for the names of the functions, but it appears
that the function that you should use to compute the zeta function for
an arbitrary argument is zetac(x) + 1:
In [1]: from scipy.special import zeta, zetac
In [2]: zetac(0) + 1
Out[2]: -0.5
In [3]: zetac(-1) + 1
Out[3]: -0.083333333333333259
In [4]: zetac(0.5) + 1
Out[4]: -1.4603545088095866
In [5]: zetac(1) + 1
Out[5]: 1.7014118346046923e+38
In [6]: zetac(2) + 1
Out[6]: 1.6449340668482264
In [7]: zetac(-2) + 1
Out[7]: 0.0
zeta() and zetac() are wrappers for functions from the cephes library;
you can find the source code at the end of this list:
http://projects.scipy.org/scipy/browser/trunk/scipy/special/cephes
In the C file zeta.c, you can see that zeta(x,q) returns NaN if x < 1.0.
Of course, a SciPy user should not have to dig into the C code to find
this out. Clearly the docstrings for zeta() and zetac() should be improved.
Warren
P.S. Be careful: don't forget the 1/2 is zero, unless you are using
Python 3.
Arkapravo Bhaumik wrote:
> Dear Friends
>
> I found some serious discrepancies with the zeta function modules. I
> have discussed them in my blogspot
> : http://3chevrons.blogspot.com/2010/01/zeta-in-scipy.html . Please
> feel free to comment on it, any other suggestion to improve the module
> is welcome.
>
> Regards
>
> Arkapravo
> ------------------------------------------------------------------------
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>
More information about the SciPy-Dev
mailing list