[Numpy-discussion] Possible to use numexpr with user made ufuncs/scipy ufuncs?

Pauli Virtanen pav@iki...
Mon Jun 28 03:22:31 CDT 2010

ma, 2010-06-28 kello 09:48 +0200, Francesc Alted kirjoitti:
> But again, the nice thing would be to implement such a special functions in 
> terms of numexpr expressions so that the evaluation itself can be faster.  
> Admittedly, that would take a bit more time.

Quite often, you need to evaluate a series or continued fraction
expansion to get the value of a special function at some point, limiting
the number of terms by stopping when a certain convergence criterion is
satisfied. Also, which series to sum typically depends on the point
where things are evaluated. These things don't vectorize very nicely. If
I understand correctly, numexpr bytecode interpreter does not support
conditionals and loops like this at the moment?

The special function implementations are typically written in bare
C/Fortran. Do you think numexpr could give speedups there? As I see it,
speedups (at least with MKL) could come from using faster
implementations of sin/cos/exp etc. basic functions. Using SIMD to
maximum effect would then require an amount of cleverness in re-writing
the evaluation algorithms, which sounds like a major amount of work.

Pauli Virtanen  

More information about the NumPy-Discussion mailing list