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

Francesc Alted faltet@pytables....
Sat Jun 26 07:24:38 CDT 2010

A Friday 25 June 2010 21:33:43 John Salvatier escrigué:
> Hello,
> Does anyone know whether it is possible to use numexpr with scipy ufuncs
> (such as those in scipy.special) or user made ufuncs? This functionality
> would be extremely useful. I don't see them in the list of supported
> functions (http://code.google.com/p/numexpr/wiki/Overview) and I get a
> 'TypeError: 'VariableNode' object is not callable' error when I try this.

Yeah, you need to explicitly code the support for new functions in numexpr.  
But another possibility, more doable, would be to code the scipy.special 
functions by using numexpr as a computing back-end.

However, I understand that many scipy.special functions need to evaluate basic 
transcendental functions (trignonometrical, exponential, logarithmic...), so 
you should no expect big speed-ups just by using a plain Numexpr.

However, you can always link Numexpr with Intel's VML (Vector Math Library), 
which can use SIMD and multi-core capabilities in modern Intel/AMD processors 
so as to accelerate the evaluation of such transcendental functions (typically 
between 2x and 10x, depending on the function and number of cores in your 

Francesc Alted

More information about the NumPy-Discussion mailing list