Sun Sep 18 05:54:53 CDT 2011
On Fri, Sep 16, 2011 at 7:24 PM, Fredrik Johansson <
> On Fri, Sep 16, 2011 at 7:11 PM, Ralf Gommers
> <firstname.lastname@example.org> wrote:
> > On Thu, Sep 15, 2011 at 8:09 AM, Johann Cohen-Tanugi
> > <email@example.com> wrote:
> >> hi there, any chance for a polylog implementation in scipy.special? I
> >> know it is there in mpmath, but I thought I would ask anyway.
> > If someone (you?) contributes a patch, that would be a great addition to
> > scipy.special imho. mpmath is nice, but it doesn't understand ndarrays
> > is way too slow when you want to use the polylog for something like
> > Bose-Einstein or Fermi-Dirac distributions.
> > It looks like the implementation in mpmath is quite clean and could
> > a starting point for a Cython/C version.
> Maybe it's still too slow, but mpmath.fp.polylog is about 100 times
> faster than the multiprecision version (and usually gives nearly full
> double-precision accuracy anyway).
Thanks for the tip.
In : %timeit mpmath.polylog(2, 10)
1000 loops, best of 3: 1.77 ms per loop
In : %timeit mpmath.fp.polylog(2, 10)
10000 loops, best of 3: 66.6 us per loop
That's much better. Still a little slow for use in curve fitting perhaps,
but when wrapping it with numpy.vectorize it should be useable on reasonable
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User